Skip to content

feat(ce-plan,ce-brainstorm): configurable reasoning effort for model elevation - #1554

Open
Amanjyot-P wants to merge 1 commit into
EveryInc:mainfrom
Amanjyot-P:issue-1415-configurable-elevation-effort
Open

feat(ce-plan,ce-brainstorm): configurable reasoning effort for model elevation#1554
Amanjyot-P wants to merge 1 commit into
EveryInc:mainfrom
Amanjyot-P:issue-1415-configurable-elevation-effort

Conversation

@Amanjyot-P

Copy link
Copy Markdown

Summary

Adds plan_effort and brainstorm_effort CE config keys so a checkout can pin the reasoning effort of the elevated Claude CLI worker used by ce-plan and ce-brainstorm model elevation, mirroring the existing cross_model_effort pattern already supported for cross-model review.

Fixes #1415.

Changes

  • skills/ce-plan/scripts/elevation-dispatch.sh (and its byte-identical ce-brainstorm copy):
    • Reads CE_ELEVATION_EFFORT (set by the calling skill from plan_effort/brainstorm_effort), validated against the Claude CLI's supported set (low|medium|high|xhigh|max).
    • Both the --emit-adapter test hook and the real dispatch path reject an unsupported value: the real path fails closed with a status:failed envelope (exit 0, same shape as the existing jq-missing degrade path) rather than silently running at a different effort than configured.
    • Unset preserves the existing high default — no behavior change for checkouts that don't set the key.
    • Every result envelope (success and failure) now carries requested_effort. Successful envelopes also carry served_effort, always "unverified" since the CLI's terminal event exposes no per-call effort receipt to confirm it against (unlike served_model).
  • skills/ce-plan/references/reasoning-elevation.md (and its byte-identical ce-brainstorm copy): documents effort resolution (config-only, no live-conversation/caller-carrier source, Claude-CLI-route-only), the CE_ELEVATION_EFFORT env pass-through on the start invocation, and the updated envelope shape.
  • .compound-engineering/config.example.yaml / skills/ce-setup/references/config-template.yaml (kept byte-identical, per check-health's diff assertion): document and add commented plan_effort / brainstorm_effort keys.
  • skills/guides/configuration.md: adds a table row for the new keys.
  • tests/skills/elevation-dispatch.test.ts: covers the CE_ELEVATION_EFFORT override reaching --effort, rejection of an unsupported value (both --emit-adapter and a real dispatch), and the new envelope fields on success.

Testing

bun test tests/skills/elevation-dispatch.test.ts
bun test tests/peer-job-runner-parity.test.ts tests/reasoning-elevation-parity.test.ts tests/skills/ce-setup-check-health.test.ts

All pass (15 + 62 tests).

…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +129 to +130
printf '{"status":"failed","requested_model":"%s","requested_effort":"%s","evidence":"invalid effort override: %s"}' \
"$MODEL" "$EFFORT" "$EFFORT" > "$RESULT_PATH" 2>/dev/null || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

Configurable reasoning effort for ce-plan and ce-brainstorm model elevation

1 participant