feat(ce-plan,ce-brainstorm): configurable reasoning effort for model elevation - #1554
feat(ce-plan,ce-brainstorm): configurable reasoning effort for model elevation#1554Amanjyot-P wants to merge 1 commit into
Conversation
…elevation Add plan_effort and brainstorm_effort CE config keys so a checkout can pin the reasoning effort of the elevated Claude CLI worker, mirroring the existing cross_model_effort pattern for cross-model review. - elevation-dispatch.sh reads CE_ELEVATION_EFFORT (forwarded by the calling skill from plan_effort/brainstorm_effort), validates it against the Claude CLI's supported set (low|medium|high|xhigh|max), and fails closed with a status:failed envelope on an invalid value instead of silently running at a different effort. Unset preserves the existing high default. - Both the emit-adapter test hook and the real dispatch path validate before running. - requested_effort is now included in every result envelope (success and failure); served_effort is recorded as unverified since the CLI exposes no per-call effort receipt. - ce-brainstorm's copy of the worker script and reference doc stay byte-identical per the existing duplication convention. - Document effort resolution in reasoning-elevation.md, add the keys to config.example.yaml / config-template.yaml, and document them in the configuration.md reference table. - Add elevation-dispatch.test.ts coverage for the override argv, the invalid-value rejection (both emit-adapter and a real run), and the new envelope fields on a successful run. Refs EveryInc#1415 Co-authored-by: multica-agent <github@multica.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 271fae9692
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| ### Effort resolution (Claude CLI route only) | ||
|
|
||
| Once a model is resolved, separately resolve the reasoning effort the Claude CLI worker runs at, from the matching per-skill config key: `plan_effort` for ce-plan, `brainstorm_effort` for ce-brainstorm. Read it from the same config layer as the model (`config.local.yaml` then `config.yaml`, ordinary-key rule). One of `low`, `medium`, `high`, `xhigh`, `max` is a valid override; anything else — an unrecognized word, a number, a blank value — is **invalid, not a fallback to high**: name the offending value and the accepted set, and skip elevation for that run rather than dispatch at a silently different effort than configured. **Unset or absent stays `high`** — the effort key is opt-in and never changes existing behavior for a checkout that has not set it. There is no live-conversation or caller-carrier source for effort; config is the only input. The native adapter (Claude Code `Agent`/`Task` tool) has no per-dispatch effort override, so this key only affects the Claude CLI route (see Adapter selection): a native dispatch always runs at whatever effort the invoking harness uses by default. |
There was a problem hiding this comment.
Keep effort resolution inside the Claude CLI adapter
When native dispatch is available, this pre-adapter rule still says an invalid plan_effort/brainstorm_effort skips elevation entirely, even though the same paragraph says the option only affects the Claude CLI route. It also contradicts the ordinary-scalar contract in skills/guides/configuration.md, where an invalid local value must continue to a valid tracked value and then the default. Define effort as an independently resolved ordinary key and validate/apply it only when selection reaches the Claude CLI adapter, leaving native elevation unaffected.
AGENTS.md reference: AGENTS.md:L121-L123
Useful? React with 👍 / 👎.
| printf '{"status":"failed","requested_model":"%s","requested_effort":"%s","evidence":"invalid effort override: %s"}' \ | ||
| "$MODEL" "$EFFORT" "$EFFORT" > "$RESULT_PATH" 2>/dev/null || true |
There was a problem hiding this comment.
Encode invalid effort envelopes as JSON
When an invalid configured effort contains a JSON-significant character, such as plan_effort: 'bad"value', interpolating it directly produces malformed JSON while the worker still exits 0. Reproducing this value yields "requested_effort":"bad"value", which jq rejects, so the runner cannot read the promised failure envelope or its named reason. Since jq has already been preflighted on this path, construct this envelope with jq --arg as the other result paths do.
Useful? React with 👍 / 👎.
Summary
Adds
plan_effortandbrainstorm_effortCE config keys so a checkout can pin the reasoning effort of the elevated Claude CLI worker used byce-planandce-brainstormmodel elevation, mirroring the existingcross_model_effortpattern already supported for cross-model review.Fixes #1415.
Changes
skills/ce-plan/scripts/elevation-dispatch.sh(and its byte-identicalce-brainstormcopy):CE_ELEVATION_EFFORT(set by the calling skill fromplan_effort/brainstorm_effort), validated against the Claude CLI's supported set (low|medium|high|xhigh|max).--emit-adaptertest hook and the real dispatch path reject an unsupported value: the real path fails closed with astatus:failedenvelope (exit 0, same shape as the existing jq-missing degrade path) rather than silently running at a different effort than configured.highdefault — no behavior change for checkouts that don't set the key.requested_effort. Successful envelopes also carryserved_effort, always"unverified"since the CLI's terminal event exposes no per-call effort receipt to confirm it against (unlikeserved_model).skills/ce-plan/references/reasoning-elevation.md(and its byte-identicalce-brainstormcopy): documents effort resolution (config-only, no live-conversation/caller-carrier source, Claude-CLI-route-only), theCE_ELEVATION_EFFORTenv pass-through on thestartinvocation, and the updated envelope shape..compound-engineering/config.example.yaml/skills/ce-setup/references/config-template.yaml(kept byte-identical, percheck-health's diff assertion): document and add commentedplan_effort/brainstorm_effortkeys.skills/guides/configuration.md: adds a table row for the new keys.tests/skills/elevation-dispatch.test.ts: covers theCE_ELEVATION_EFFORToverride reaching--effort, rejection of an unsupported value (both--emit-adapterand a real dispatch), and the new envelope fields on success.Testing
All pass (15 + 62 tests).