feat: make model generation budgets configurable - #37
Merged
Merged
Conversation
minixalpha
marked this pull request as ready for review
September 10, 2026 12:26
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.
Replace the fixed 8192-token reply limit with a configurable generation budget, defaulting to 32768. Add
--max-tokensandANTHROPIC_MAX_TOKENS, including the existing settings-file environment configuration, with CLI > environment > settings > default precedence. Validate the effective positive integer before model execution and apply it to every reply in interactive and headless modes.Forward budgets through Harbor and record the effective limit in startup output, Event Journals, and ATIF separately from usage. Preserve compatibility with older journals and existing truncation behavior.
Validation: 242 core tests and 22 Harbor adapter tests passed, covering precedence, request forwarding, real SDK serialization, invalid values, recorded limits, and truncation. Python 3.13 and 3.14 CI passed. The English development notes were regenerated from the complete Chinese source; examples, links, and experiment figures were checked.
Benchmark diagnostics recorded two
regex-logpasses at 32768, two compressor truncations at 32768, and one compressor pass at 65536 with a longer deadline. That successful run peaked at only 32073 output tokens, so it does not establish a benefit from doubling the cap. The other 18 tasks passed 5/18 at 65536, versus 8/18 in the 8192 baseline; five supplemental attempts added no passes. Different source revisions, deadlines, runtime conditions, and infrastructure faults prevent a controlled budget-only comparison. No benchmark-wide improvement is established. The default remains 32768, with 65536 available as an override.The PR includes changelog entries, bilingual user and Harbor documentation, development notes, and structured experiment results indexing retained local trajectories. Both root READMEs are unchanged; research-note files are unchanged.