Skip to content

Conversation

@cnbrenci
Copy link
Contributor

@cnbrenci cnbrenci commented Jan 7, 2026

This limits the number of console output lines added to the hidden context in AI Tutor to 50.

We saw some quota exceeded issues for input token count due to messages being sent with enormous hiddenContext due to console output. This was partly mitigated by increasing the rate limits for the tutor project, but very large hiddenContext was also causing problems with the db so we are implementing this fix in addition.

Links

Testing story

Tested locally that the console output is truncated.

Copy link
Contributor

@drizco drizco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

const consoleLines = CodebridgeRegistry.getInstance()
.getConsoleManager()
?.getTerminalLines()
?.slice(-MAX_CONSOLE_LINES)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I was kind of hoping this could be done in the base class in case another context helper adds the console lines in the future, but that would require splitting and slicing the string there instead of just slicing here... probably fine to leave this as is

@cnbrenci cnbrenci merged commit 5db791b into staging Jan 7, 2026
6 checks passed
@cnbrenci cnbrenci deleted the cassi/bug/console-lines branch January 7, 2026 22:55
@tess323
Copy link

tess323 commented Jan 7, 2026

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants