Skip to content

feat: expose reasoning effort for Claude (--effort) + /effort command, picker & cron/webhook - #161

Closed
ryuhaneul wants to merge 1 commit into
PleasePrompto:mainfrom
ryuhaneul:feat/claude-effort
Closed

feat: expose reasoning effort for Claude (--effort) + /effort command, picker & cron/webhook#161
ryuhaneul wants to merge 1 commit into
PleasePrompto:mainfrom
ryuhaneul:feat/claude-effort

Conversation

@ryuhaneul

Copy link
Copy Markdown
Contributor

Summary

Exposes Claude Code's --effort reasoning-depth control through ductor, unifying reasoning-effort handling across Codex and Claude.

Previously reasoning_effort was Codex-only (-c model_reasoning_effort); the Claude provider ignored it. Claude Code supports --effort <low|medium|high|xhigh|max> for both headless (-p) and the TUI, so this wires it through.

Changes

  • Claude --effort: claude_provider passes --effort <level> when reasoning_effort is set (mirrors the Codex -c model_reasoning_effort pattern; skipped on medium/default).
  • Provider-aware validation: effort validation is now provider-aware — Claude supports low..max (incl. max), Codex low..xhigh. Switching providers re-validates the stored effort (e.g. Claude max → Codex resets to medium); a Codex no-cache fallback keeps max rejected for Codex even when the model cache is unavailable.
  • /effort command: new command to set reasoning effort for the active provider (provider-appropriate options), reusing the existing reasoning-selection path.
  • Model-picker integration: selecting a Claude model in /model now offers the effort sub-selector (as Codex already did).
  • /status: now displays the active provider's current reasoning effort (previously shown for neither provider).
  • cron/webhook: the task executor now emits --effort for Claude tasks (Codex keeps -c model_reasoning_effort; other providers unchanged).
  • RULES docs + i18n strings updated.

Tests

Added coverage for: --effort pass/skip, provider-aware validation (Claude max OK, Codex max rejected incl. no-cache fallback), /effort selection, model-picker effort for Claude (with Codex no-regression), /status effort display, and executor per-provider emission.

Notes

Standalone — no dependency on the interactive-REPL work; applies to the -p execution path.

…ffort command and /status display

reasoning_effort was a shared config field but only Codex consumed it. Wire it
into the Claude path and surface it to users:

- claude_provider passes --effort <reasoning_effort> when set (skips
  "default"/unset), mirroring codex_provider's -c model_reasoning_effort.
- Provider-aware effort validation: Claude supports low|medium|high|xhigh|max
  (max is Claude-only); Codex uses its live model cache, falling back to a
  constant set so max is rejected even when the cache is unavailable.
- New /effort command: active-provider-aware effort buttons (Claude shows max,
  Codex does not), reusing the model wizard's reasoning step so selection flows
  through switch_model as an effort-only change. Unsupported providers
  (gemini/antigravity) get an info message and no UI.
- /model provider switch re-validates the carried-over effort against the new
  provider and resets it to medium when unsupported (prevents Claude max
  reaching Codex). Effort is no longer wiped when switching between Codex and
  Claude (only dropped for non-effort providers).
- /status shows the active provider's reasoning effort (Claude and Codex).
- RULES docs and i18n (all languages) updated.
@ryuhaneul

Copy link
Copy Markdown
Contributor Author

Closing for now — the topic-scoped effort change here regresses behavior: setting reasoning effort inside a forum topic overwrites the global default (this also affects Codex, which previously no-op'd in topics). Reworking effort to be session-scoped (per-topic in topics, default in the main chat) for both providers; will resubmit as a fresh PR. Thanks!

@ryuhaneul ryuhaneul closed this Jun 22, 2026
ryuhaneul pushed a commit to ryuhaneul/ductor that referenced this pull request Jun 25, 2026
Expose reasoning effort for Claude (--effort) with a /effort command,
provider-aware validation (claude low..max, codex low..xhigh with a no-cache
fallback), /status display, cron/webhook executor support, model-picker effort
sub-selector, and i18n — scoped per-session like model (replaces the closed
PleasePrompto#161, which made topic effort changes leak globally and broke codex).

Mirror the existing per-session model mechanism exactly:
- SessionData gains a reasoning_effort field; sync_session_target/resolve_session
  store and capture-on-first-use (fixed at creation time, like model).
- AgentRequest gains effort_override; CLIService resolves
  request.effort_override or config default (like model_override or default_model).
- flows (_prepare_normal, named, heartbeat), injection, tasks/hub, and the
  background observer thread the effective per-session effort into every turn.
- switch_model applies the global default only from main/DM (if not is_topic);
  in a topic it writes the topic session's effort, with provider-switch
  re-validation resetting an unsupported carried-over effort to medium.
- NamedSession/BackgroundSubmit/BackgroundTask/TaskSubmit/TaskEntry carry
  reasoning_effort so named foreground/background runs keep their session effort.
- claude_provider (--effort) and codex_provider (-c model_reasoning_effort) both
  consume the resolved per-turn effort.
- /status shows the effective effort (session in a topic, else global default).
@ryuhaneul

Copy link
Copy Markdown
Contributor Author

Superseded by #164, which resolves reasoning effort per session (parity with model selection) for both Claude and Codex.

ryuhaneul pushed a commit to ryuhaneul/ductor that referenced this pull request Jun 25, 2026
Expose reasoning effort for Claude (--effort) with a /effort command,
provider-aware validation (claude low..max, codex low..xhigh with a no-cache
fallback), /status display, cron/webhook executor support, model-picker effort
sub-selector, and i18n — scoped per-session like model (replaces the closed
PleasePrompto#161, which made topic effort changes leak globally and broke codex).

Mirror the existing per-session model mechanism exactly:
- SessionData gains a reasoning_effort field; sync_session_target/resolve_session
  store and capture-on-first-use (fixed at creation time, like model).
- AgentRequest gains effort_override; CLIService resolves
  request.effort_override or config default (like model_override or default_model).
- flows (_prepare_normal, named, heartbeat), injection, tasks/hub, and the
  background observer thread the effective per-session effort into every turn.
- switch_model applies the global default only from main/DM (if not is_topic);
  in a topic it writes the topic session's effort, with provider-switch
  re-validation resetting an unsupported carried-over effort to medium.
- NamedSession/BackgroundSubmit/BackgroundTask/TaskSubmit/TaskEntry carry
  reasoning_effort so named foreground/background runs keep their session effort.
- claude_provider (--effort) and codex_provider (-c model_reasoning_effort) both
  consume the resolved per-turn effort.
- /status shows the effective effort (session in a topic, else global default).
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