Repository navigation
OpenRouter models: 32k tokens a call, and a call cut off at its limit is told to the model and retried - #382
Merged
Merged
Conversation
…e model ran out of room where it was cut off before it said anything, rather than that it had nothing to say
… ask a model cut off at its limit again, told so, before telling the person it ran out of room
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A turn on the proxy harness (OpenRouter) gave the model 4,000 output tokens per call. That's too little for agentic work: about 300 lines of code, and for GLM its thinking came out of the same budget. Also, if the model was cut off at the limit, the turn quietly dropped the unfinished answer and any tool calls in it, and the person saw the stock "I had nothing to say to that." Thread cmwqu03k7002sqx01wxxavvcl hit this: 5,712 tokens in, exactly 4,000 out, no text and no calls. Over the last 14 days, all 8 GLM turns that hit the cap ended this way, and none of the 12 steps that hit the cap on either model had a tool call left.
proxy-harness.tshas a budget per model: Claude Sonnet 5.5 gets 32,000, and so does GLM 5.3, withreasoning.max_tokens16,000 sent to OpenRouter (TurnRequest.reasoningTokens) so at least half is left for the answer. Room that goes unused costs nothing. The summarizing call uses the same budget.askForTurnreadsfinish_reasonand setsModelTurn.cutOffwhen it islength. The harness then asks the model again in the same turn (up to 2 more times). It passes back any text the model had written, plus a note: its last answer was cut off and dropped, none of its calls ran, and it should think less or write a large file in parts. The tool calls of a cut-off answer are dropped, since the last one may be incomplete. The turn'soutputTokenscounts every call; itsinputTokensis the last call's, since compaction reads it as the size of the log.Tests: proxy-harness, open-router, inference and worker tests pass (76).
tsc --noEmitpasses for the api.