Fit OpenCode tool output to the Qwen context window - #25
Merged
Conversation
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.
What changed
--max-context-tokensmodel-bridge contract, defaulting to the documented 49,152-token TRL server window.Why
After PR #24 fixed Qwen tool-argument shape, the live red-wine canary still stalled on the second turn. Reconstructing the exact follow-up showed:
59,146tokens.49,152tokens and the bridge reserves4,096tokens for the next completion.The model had called OpenCode's
readtool without a line limit, so the 1,600-line CSV result alone contributed about 51k characters. vLLM remained stuck atRendering conversations: 0%instead of returning a usable overflow error. The bridge is the authoritative boundary because it has the actual normalized messages, tool schema, tokenizer, generation cap, and server context contract.Validation
217package contract tests pass.48focused bridge/CLI/GRPO tests pass.git diff --checkpass.59,146to45,056tokens and returned from the real Qwen3.5-9B TRL server in 8 seconds with two tool calls.1.0, and pass rate1/1.