feat(config): require an explicit context window instead of assuming 16384 - #229
Merged
Conversation
…16384 `context_tokens` defaulted to 16384, a window sized for the small local models the loop was first hardened against. Every setting derived from it (the transcript budget, the compaction trigger, the max_tokens clamp) then treated a 128k or 500k model as a 16k one, so the harness's own context protection became the constraint on the models it now targets. A larger default is wrong the other way for a small model, and nothing is queried from the server, so the honest answer is the one base_url and model already give: no default, and a resolve error that names both places the window can be set (settings.json, or the model's providers.json entry, which wins). Old files still parse; a turn refuses with the reason until one is set, and `openmax --check` warns on a settings file that parses but cannot resolve, naming the reason where the reader is looking. Tests: resolve refuses without a window and accepts either source; --check warns on the unresolvable file and reports the window on a resolvable one; every fixture that relied on the old default now sets a window.
Max17190
force-pushed
the
explicit-context-window
branch
from
August 19, 2026 03:45
4b74832 to
138a839
Compare
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.
Why
context_tokensdefaulted to 16384, a window sized for the small local models the loop was first hardened against. Everything derived from it (the transcript budget, the compaction trigger, themax_tokensclamp) then treated a 128k or 500k model as a 16k one, so the harness's own context protection became the constraint on the models it now targets. A larger default is wrong the other way for a small model, and nothing is queried from the server, so the honest answer is the onebase_urlandmodelalready give: no default.Summary
Settings.context_tokensisOption<usize>with no default; old files still parse.providers::resolvereturnsResolveError::MissingContextTokenswhen neither the model'sproviders.jsonentry norsettings.jsonsets a window; the message names both places and the launch-read rule. Every surface that shows resolve errors (turn start,-p/--stdiofail-fast,/status,/provider) inherits it.openmax --checknow warns on a settings file that parses but cannot resolve (endpoint, model, window, provider), and reports the resolved window on a healthy one.docs/configuration.md,config.rsmodule doc, and--spec settingsupdated; the README example setscontext_tokens.Test Plan
a_context_window_is_required_from_settings_or_the_model_entry: flat and named-provider resolution refuse without a window, a per-model entry satisfies it,settings.jsonsatisfies it for an unsized model.check_names_a_settings_file_that_would_brick_the_next_launchextended: warns with the reason when the window is missing, prints the window when resolvable.-prefuses with the message;--checkprints the warn line.cargo test --workspacegreen; clippy at zero warnings.Note for reviewers: users upgrading with a
settings.jsonthat omitscontext_tokensget a one-time resolve error naming the field; the external rigs already set it.Greptile Summary
This change removes the assumed context-window size and requires each model to declare its actual window through settings or a provider model entry. A local endpoint check confirmed that a model-specific provider window starts successfully, while unsized configurations stop before sending a model request.
Confidence Score: 5/5
No blocking failure remains.
No accepted blocking findings remain. The exercised configuration paths correctly allow a provider model's declared window and reject missing windows before network use.
What T-Rex did
Reviews (2): Last reviewed commit: "feat(config): require an explicit contex..." | Re-trigger Greptile