mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4230] [TUI] strata connect: use bigger output caps on bigger context windows #4964
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4964
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4230
Author: @qwertie
Created: 10/26/2026
Status: 🔄 Open
Base:
main← Head:connect-output-cap📝 Commits (1)
b9ef6b4Bug fix: strata connect capped every reply at 4,096 tokens📊 Changes
2 files changed (+29 additions, -8 deletions)
View changed files
📝
strata_cli/launch/harness.py(+16 -7)📝
tests/terminal/test_launch.py(+13 -1)📄 Description
Problem and result
strata connectwrites a 4,096-token output cap into every config it makes[1], no matter how big the context window is.Thinking counts against the cap, so on a wide window a long reply is cut off. The usual case is a whole file written in one tool call.
On my server with Claude Code set up from
strata connect claude-code: a sub-agent writing one source file hit the cap three times in a row. Claude Code threw each cut-off reply away and asked again. The engine log:Each retry's prompt reuses the history only up to the start of the dropped reply. The three cut-off replies cost 290 s of decoding. The model's next reply began: "The long single write keeps getting truncated. I'll build
engine.tsin three smaller chunks."After this change the cap grows with the window (the tested window is still 4096):
Related discussion
None for this cause. #2708 (closed in the 0.2.0-beta reset) reported a related symptom: Codex replies ending at
max_output_tokens.Approach
The five configs that set an output cap use
Target.output_capinstead ofOUTPUT_CAP. The Claude Code limits note now prints the actual value instead of a hard-coded 4096. An eighth of the window has no upper limit, because I've seen long thinking alone exceeding 32K in Qwen3.8 27B and I'm unsure if that ever happens in Qwen-flash-next.Compatibility:
compact_at), is unchanged at every size. So the configs for wider windows change only in their output cap.fit_max_tokens). So a request near the end of the window is not refused because of the larger cap.Validation
Passed:
python -m unittest tests.terminal.test_launchonb9ef6b46, Windows 11, Python 3.14: 115 tests OK (1 skipped). This includes the newtest_the_output_cap_grows_with_the_window(caps at 8K to 512K, the Claude Code env and limits note at 204,800, opencode's limits at 128K).python strata.py connect claude-code --url http://127.0.0.1:8080 --context 204800:CLAUDE_CODE_MAX_OUTPUT_TOKENSis4096on4b9e05a2(main),25600onb9ef6b46.Failed:
python -m unittest discover -s tests/terminalhangs (stopped after 25 minutes), both on unmodified main (4b9e05a2) and on a local branch that has this commit merged with others. Both runs hang intests/terminal/test_runtime.py: attest_failed_generation_probe_does_not_report_readyon main, attest_failed_new_port_rolls_back_previous_owned_launchon the local branch. Those tests pass when run alone on both. An earlier quiet run of the suite on this branch alone also hung (no test names printed).pytestwas not installed in this environment.Not run:
Limits
fit_max_tokens) shortens such a request. A server started with--no-fit-max-tokens(or"fit_max_tokens": false) answers it with a 400, so with that setting the larger cap makes 400s more likely late in a long conversation.[1] into Claude Code's
CLAUDE_CODE_MAX_OUTPUT_TOKENS, opencode'slimit.output, andmaxTokensfor pi, omp and openclaw🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.