Repository navigation
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.
Summary
The CLI loads
plugins.maxOutputTokensbut previously ignored it when constructing conversation requests. A configured limit of 512 or 1024 still producedmax_tokens: 64000for the tested models. Local OpenAI-compatible servers with smaller context limits can reject such requests.Carry the existing merged setting through runtime construction into the conversation client and apply the existing
max_tokens_for_model_with_overridehelper on every request. Requests after tool results use the same configured limit. Omitting the setting preserves the existing per-model default. Document configuration inUSAGE.md.Add four HTTP-level integration tests: configured limits across an Anthropic tool roundtrip, project-local precedence over user configuration, default preservation, and an OpenAI-compatible tool roundtrip. The latter verifies both outgoing limits and that the second request contains the actual file-read result. All tests use temporary workspaces with spaces, isolated credentials/configuration, loopback mocks, and portable fixtures; no live model server or paid API is required. Each Claw subprocess has a 60-second deadline, with termination and captured output on timeout.
This PR changes three files and is based on upstream
mainat6a29e0888308f0aff9724c108edfba5106a2f9bf(v0.1.13), which already includes the merged Windows compatibility fixes from #3378. A separate preparatory commit adds the existing current-directory lock to four CLI tests that depend on process-wide cwd, including subprocess launchers. This addresses Windows cleanup races without changing production behavior. No generated state or tool-alias/repeated-read changes are included.Compatibility: there are no new flags, dependencies, configuration keys, or JSON response fields. Existing configured overrides now take effect, which is the intended behavior change. This does not automatically query server limits, validate the selected value against a server's remaining context, or configure separate sub-agent/
claw-analogclients. Select a positive output limit that leaves room for the request input.Anti-slop triage
Verification
git diff --checkpasses.Completed locally on Linux with Rust 1.99.1 for the final source:
cargo test --workspace --locked --no-fail-fast): 1,837 passed, zero failed, one existing ignored live-provider test. This includes 227 CLI unit tests and the four output-token integration tests.cargo clippy --workspace --all-targets --locked -- -D warnings): passed.Regression evidence from the original feature validation: the three configured-limit cases fail on unmodified upstream request construction (64000 instead of the configured limit), while the default case passes.
Completed on native Windows on 2026-11-11:
These Windows results cover the complete source included in the consolidated patch: output-token support, its test deadlines, and all four current-directory test guards. The source was reconstructed from the exact patch sequence applied before the successful local run. No additional test skips were introduced.
Pending: GitHub-hosted CI for this PR. Local Windows verification does not establish a hosted CI result.
Resolution gate