Skip to content

Fail loudly on max output token reached error#20

Open
naftali-g wants to merge 1 commit into
masterfrom
naftali/fail-on-max-tokens
Open

Fail loudly on max output token reached error#20
naftali-g wants to merge 1 commit into
masterfrom
naftali/fail-on-max-tokens

Conversation

@naftali-g
Copy link
Copy Markdown
Contributor

Otherwise we just go into a loop where the agent tries generating the same (too-long) response over and over.

@naftali-g naftali-g requested a review from jtoman May 28, 2026 07:53
Copy link
Copy Markdown
Contributor

@jtoman jtoman left a comment

Choose a reason for hiding this comment

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

Nope, as discussed on slack; this is too coarse. Claude will sometimes exhaust its token limit while thinking, and graphcore will correct that without problem (the default conversation node implementation). It's far better to intercept the error thrown by pydantic in this case (missing field) and make that the "go down in flames" path.

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.

2 participants