Skip to content

Support num_predict as a preset key and strengthen split-write recovery guidance - #1198

Merged
Kewton merged 4 commits into
developfrom
feature/issue-1173-support-num-predict-as-a-preset-key-and-strength
Dec 1, 2026
Merged

Kewton merged 4 commits into
developfrom
feature/issue-1173-support-num-predict-as-a-preset-key-and-strength

Conversation

@Kewton

@Kewton Kewton commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Refs #1173 (close by hand after merge; this PR targets develop).

Summary

  • num_predict is 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.
  • Split-write recovery guidance at the output limit is stronger.
  • SUPPORTED_PRESET_KEYS moved unchanged into the new leaf src/config/preset_keys.rs, in a separate commit (99288dc). This makes room under the config.rs limit without raising its baseline. codex confirmed the commit only moves the list.
  • With PROMPT_VERSION 2, the golden records are unchanged.
  • The user guides (en/ja) document the key.

Verification

  • commandmate verify run 853 on cb7db9b: exit 0, 17 gates pass.
  • Run 842 on an earlier head failed only the scope gate, because the base checkout's local develop was stale. Both runs are recorded.
  • Linux clippy: 0 warnings.
  • The branch overlaps develop only in src/provider_call.rs, and git merge-tree reports no conflict.
  • Review: codex REJECT twice, fixed in 020cee6 and cb7db9b. The third review was by claude-5 while codex was at its usage limit: APPROVE.

🤖 Generated with Claude Code

Kewton and others added 4 commits December 1, 2026 22:05
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>
@Kewton
Kewton merged commit cc6e9b7 into develop Dec 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant