Skip to content

feat(core): reasoning effort setting, sent as reasoning_effort - #502

Merged
ajianaz merged 1 commit into
developfrom
feat/reasoning-effort
Nov 3, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/reasoning-effort

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What (description of the change)

Reasoning effort setting (#457): --effort <minimal|low|medium|high> on run/chat/resume/mission, TOLE_REASONING_EFFORT env, config reasoning_effort (flag > env > config > user config > default unset). Validated at parse; unknown values fail loudly with the accepted list.

  • Per-session override in the durable register fact/reasoning_effort (mirrors fact/model): the session's register beats the process default, so a session keeps its level across resume and a future TUI can change it mid-session.
  • Sent as reasoning_effort on OpenAI-compatible chat completions ONLY when set; unset = today's request body byte-for-byte (wire-shape stability, eval-tested both ways).
  • Provider rejects the parameter with an HTTP 400 whose body names reasoning_effort -> ONE degraded retry without it; the rejection is recorded (tole_degraded in the step usage row, not counted as a provider step) and the parameter is dropped for the provider's later calls. Other 400s and repeat rejections do not loop.
  • Core plumbing: parse_reasoning_effort, with_reasoning_effort on the provider, last_degraded accessors; failover + transcript/turn carry the field additively. A register setter (TUI /thinking) is deliberately NOT here — that lands with epic: tole-tui — pi-style terminal UI #464/feat(tui): model picker, thinking level, slash-command menu #461.

Why (the problem you're solving)

Closes #457 — tole never sent a reasoning/thinking level; the model's effort could not be chosen or seen, and the TUI epic (#464, Phase 0) needs it.

Testing (how you verified this works)

  • RED first (compile-level, disclosed): both crates' new tests failed to build on the missing symbols (parse_reasoning_effort, with_reasoning_effort, last_degraded, session_effort, effort_error, new config/settings fields), then passed after implementation.
  • Acceptance coverage: wire-shape eval test asserts the body carries reasoning_effort exactly when set and is unchanged otherwise; register round-trips across resume (session_effort_e2e, new, includes the register-beats-default case); 400-rejection retry covered by a mock test (one retry, no loop; other 400s / no-effort-set / failed-retry each tested not to loop); tole config check shows the effective value + source.
  • Gates run by the implementer AND independently re-run by the orchestrator (sequential, isolated target dirs): cargo fmt --all -- --check clean; cargo clippy --workspace --all-targets -- -D warnings clean; cargo test --workspace --no-fail-fast 1018/0 (first run had 5 verify_package port-range flakes from parallel sibling worktrees — pass isolated + clean re-run); cargo test -p tole-core -p tole-cli --no-default-features 887/0; cargo build -p tole-cli --no-default-features OK.
  • Honest notes / deviations: retry detection matches a 400 whose body contains reasoning_effort — a 422-style rejection is NOT retried (issue said 400; recorded here as the contract). Standard rooms: only uteke-conventions read in full (others' listings exceeded the tool; fell back to AGENTS.md/CONTRIBUTING.md). No live-provider round trip (mock only), no ACP surface.
  • Integration grep: no prior reasoning-effort surface existed; reasoning_tokens usage reporting and streamed reasoning deltas untouched.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

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.

feat(core): reasoning effort setting, sent as reasoning_effort

1 participant