Repository navigation
engine: no fixed cap on a tool's result; the cut and the routing follow the model's window, read from OpenRouter on every turn - #1448
Merged
Merged
Conversation
…w, read from OpenRouter on every turn
A result comes back whole. exec, glob/grep and read_file lose their fixed caps (10000/50000, 12000 and 2000
per line, 128000) and the general 12000-character cut is gone. A request that outgrows the model's window is
compacted first, as before; only if it still does not fit are the results of its latest round cut to what the
window leaves, measured with the estimate that judges the request, and the cut says how many characters came
through of how many and how to ask for less. A result is stored cut only beyond what no compaction could make
room for.
The window is read on every turn from the providers OpenRouter lists for the model
(GET /models/{model}/endpoints), not once per process from the whole list: of the providers serving it, the
widest window and the longest answer at that window.
…dow; image: invisible-playwright-mcp 0.72.1 OpenRouter routes a request by the answer it asks for but not by the prompt it carries, so a request sized for the model's widest window could land on a provider with a narrower one (glm-5.3-flash: Reka at 262144 among providers at 1048576) and fail there. The providers read with the limits on every turn now route the model's requests: provider.only is the slugs of the widest window's providers. When none of them can serve, OpenRouter refuses with "No allowed providers are available" and the turn fails with those words. invisible-playwright-mcp 0.72.1 drops its last caps: browser_type quotes the value the field kept whole, and an error detail in its chat and routes comes whole. The tools' schemas are unchanged.
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.
No tool result has a fixed cap any more. The only limit left is the model's own context window, read from OpenRouter on every turn, and a model's requests now go only to the providers that have that window.
Tool results come back whole
These fixed caps are gone:
The model's own paging stays: read_file's
offset/limitand the search tools'head_limit.A request that outgrows the model's window is compacted first, as before: old results are cleared, then the history is summarized. Only if it still does not fit are the results of its latest round cut, by
ContextGovernor.fit_latest_round:[Cut here: the first N of M characters. The whole result does not fit in the context window of <model> (<W> tokens) beside the rest of the request; ask for less to see the rest: a narrower selector, a pattern, an offset and a limit.]A result is stored cut only past what no compaction could make room for: the window less the system prompt and the tool definitions.
The prompt caps stay: MEMORY.md at 25000 characters and MCP server instructions at 2048.
The window: read on every turn, and the routing follows it
GET /models/{model}/endpoints, about 32 KB. Before, the wholeGET /modelslist (768 KB) was read once per process, so a long-lived engine never saw a model's providers change. Of the providers serving the model (a negative status means down), the model takes the widest window and the longest answer at that window.provider.only, set to the slugs of the providers with the widest window, from the same reading.openrouter/auto) lists no providers, so it gets no limits and no route.Image
invisible-playwright-mcp 0.72.1 removes its last caps:
browser_typequotes the value the field kept in full.The tools' schemas are unchanged; the recaptured interface differs only in its version.
Verification
provider.only.Known effect
An exec session that nobody polls keeps its whole output in memory until the next poll or the idle cleanup.