Repository navigation
Support num_predict as a preset key and strengthen split-write recovery guidance - #1198
Merged
Kewton merged 4 commits intoDec 1, 2026
Conversation
The production size of src/config.rs leaves no room for the upcoming num_predict preset key. Move the unchanged key list into a new leaf and re-export it under the same path so keys, order, types, and behavior stay identical. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Resolution follows context_budget/chat_timeout_secs: CLI --num-predict >
preset num_predict > default 8192. --num-predict is Option<usize> so an
explicit 8192 differs from an absent flag; Config.num_predict keeps usize.
Parsing and resolution live in the new leaf src/config/num_predict.rs, and a
preset value must be a positive integer (${ENV} expansion allowed). The
classifier keeps its 64-token cap. --doctor and /status report the resolved
num_predict and its source.
Rewrite the output_limit_feedback sentence (prompt_version 2) to ask for a
short reasoning turn and a split write. Bilingual configuration guides list
the preset key, precedence, and the completeness-trap exclusion.
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Blocker 1: a preset num_predict whose ${ENV} reference is invalid, or whose
environment value is not UTF-8, failed with the reference or value in the cause
chain, so both the normal startup error and --doctor --json showed it. Fold
every failure source into one fixed reason that names only the file, line, and
key. Cover both cases against startup stderr and --doctor --json in an
isolated child process.
Blocker 2: the classifier cap test set Config.num_predict directly and compared
the received limit to the implementation constant, so it never exercised preset
resolution. Start from a synthetic preset that resolves num_predict to 16384 and
compare the loopback's received limit to the literal 64.
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
The classifier cap test resolved its preset in the executor's own environment, so a same-named preset in HOME could supply the provider and base URL, and COMMANDAGENT_EVAL_EVENTS could redirect or append to an existing event file. Run the test body in a child process with a cleared environment, an empty synthetic HOME, and a decoy COMMANDAGENT_EVAL_EVENTS; the child keeps the real preset resolution but writes only to its own event file. The parent then asserts the synthetic HOME holds no preset and the decoy file was never written. Also point the num_predict leaf comment at the relocated redaction tests. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
6 tasks
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.
Refs #1173 (close by hand after merge; this PR targets develop).
Summary
num_predictis a preset key. A value of 0 is refused. The preset value also drives the classifier cap. The key is redacted where secrets are scrubbed.SUPPORTED_PRESET_KEYSmoved unchanged into the new leafsrc/config/preset_keys.rs, in a separate commit (99288dc). This makes room under theconfig.rslimit without raising its baseline. codex confirmed the commit only moves the list.PROMPT_VERSION2, the golden records are unchanged.Verification
commandmate verifyrun 853 on cb7db9b: exit 0, 17 gates pass.src/provider_call.rs, andgit merge-treereports no conflict.🤖 Generated with Claude Code