Repository navigation
feat(tui): pin reasoning effort per session and expose it as /effort - #122
Merged
Merged
Conversation
Reasoning effort has been configurable since PR #76 (config + profiles), but only at plan-compile time; there was no way to see or change it from the TUI. This makes effort a first-class per-session control. Protocol 26: - `SessionCommand::CreateSession.reasoning_effort` (optional) - `SessionCommand::SetSessionEffort { session_id, effort }` - `CommandOutcome::SessionEffortSet` - `SessionSummary.reasoning_effort` (optional, omitted when unset) - `/effort` is reserved as a client slash command Omission keeps the compiled plan's configured/profile choice; an explicit value is applied at the next claimed run. Children inherit the parent pin. Store schema 34 adds nullable `sessions.reasoning_effort`, threaded through claim -> RuntimeLoadRequest so the runtime honours the pin. TUI: - `/effort` picker (default / none / minimal / low / medium / high / xhigh) - with a session focused: sets that session; refused mid-run like /profile - with nothing focused: becomes the default for the next CreateSession - `StatusItem::Effort` badge shows only when a pin is set Regression fix found on the way: every earlier migration guard listed "33" as already-applied but not "34", so a fully migrated store failed its second open with Persistence(Constraint). Added "34" to all guards and a reopen regression test that would have caught it. `ReasoningEffort` gains `ALL` and `as_str()` so the wire spelling has one source across codec, TUI, and pickers. Verification: cargo test --workspace, fmt --check, clippy -D warnings, qq-provider --no-default-features --features test-support.
…rotocol 27 Protocol 26 was claimed by #120 (turn recovery, ADR-0040) while #122 was open, so the effort pin moves to protocol 27. v26/ goldens are #120's; v27/ is regenerated from them plus command_set_session_effort and receipt_session_effort_set. Harbor trace fixtures bump 26 -> 27. Store schema stays 34 (main is on 33). MAX_TURN_RETRIES kept. Also picks up #126-#128 (RR6, RR7, onboarding); no overlap. Verified on the identical tree as a rebase: cargo test --workspace, fmt --check, clippy -D warnings all green.
Merged
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reasoning effort has been configurable since #76 (config + profiles), but only at plan-compile time — there was no way to see or change it from the TUI. This makes effort a first-class per-session control:
/effortopens a picker (default/none/minimal/low/medium/high/xhigh), the choice is persisted on the session, applied at the next claimed run, and shown as a status badge when set.User-visible behaviour
/effortwith a session focused pins that session's effort. Refused while a run is in flight (a running turn keeps the effort it started with), same rule as/profile./effortwith nothing focused sets the default for the nextCreateSession.defaultclears the pin and restores the configured/profile omission.StatusItem::Effortbadge in the status row, shown only when an explicit pin is set (omission is the unremarkable case).Design
Protocol 27 (
qq-protocol):SessionCommand::CreateSession.reasoning_effort: Option<ReasoningEffort>SessionCommand::SetSessionEffort { session_id, effort }CommandOutcome::SessionEffortSetSessionSummary.reasoning_effort(optional, omitted when unset)/effortreserved as a client slash commandOlder clients reject the new command/outcome/field; v23–v26 goldens kept as decode-only. (Protocol 26 was taken by #120's turn-recovery work while this PR was open, so this became 27 on sync.)
Store schema 34: nullable
sessions.reasoning_effort. Threaded claim →ClaimedRun→RuntimeLoadRequest, so the compiled plan honours the pin. Omission (NULL) means "use the compiled plan's configured/profile choice"; explicitnoneremains distinct from omission, per ADR-0031.ReasoningEffortgainsALLandas_str()so the wire spelling has one source across codec, TUI label, and picker rows.Regression fix found along the way
Every earlier migration guard in
schema.rslisted"33"as already-applied but not"34", so a fully migrated store failed its second open withPersistence(Constraint)— first open fine, reopen dead. Surfaced byheadless::tests::session_resume_after_an_unclean_exit_recovers_the_interrupted_run_first. Added"34"to all 22 guards plus a direct regression test (a_current_store_reopens_without_rerunning_migrations) that fails inqq-coreinstead of three crates away.Verification
cargo test --workspace— green, including the previously failing headless resume testcargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p qq-provider --no-default-features --features test-support(minimal profile;qq-reasoningis re-exported there)set_session_effort; wire goldens for the new command/receipt; runtimeset_session_effort_pins_and_clears_on_the_published_summary; TUI picker tests for focused-idle / focused-running / unfocused paths; schema 34 migration + bad-shape rejection + reopen.mainafter fix(runtime): refuse reserved and malformed slash prompts at admission (RR2) #116/fix(runtime): record Jev verdicts as evidence instead of failing the run (RR3) #117 (/clearlanded in the same reserved-commands array; merged to 22) and again after fix(provider): honour Retry-After above the backoff cap and retry 529 (RR5) #118–feat(runtime)!: retry a turn after a transient provider fault and settle paused on exhaustion (RR4, ADR-0040) #120, feat(runtime): compact on a provider window rejection and admit exhausted prompts from the summary alone (RR6) #126–docs(onboarding): user guide, onboarding plan, and actionable first-run errors (OB0) #128 (protocol 26 collision → 27;MAX_TURN_RETRIESkept;v27/goldens regenerated from feat(runtime)!: retry a turn after a transient provider fault and settle paused on exhaustion (RR4, ADR-0040) #120'sv26/). The sync is a merge commit rather than a rewrite so history stays reviewable; the tree is byte-identical to a rebase that passed the full workspace suite.Performance / compatibility
protocol_version26 → 27 (same one-token change feat(runtime): add opt-in Jev task routing #77 and feat(runtime)!: retry a turn after a transient provider fault and settle paused on exhaustion (RR4, ADR-0040) #120 made).Follow-up
Stacked on this PR: #130 — per-model effort catalog (
ModelDescriptor.reasoning_efforts,/effortfiltered to the focused model, plan-time rejection of unsupported pins). Merge this first; #130 then retargets tomain.Also not in this PR
The 22-guard
matches!(schema_version, Some("…"))pattern inschema.rsis what made the reopen bug possible; it's an easy trap for the next migration. Worth replacing with a numeric compare in a separate change.Linear
Linear connection needs re-auth in this session, so I could not query or link a
DEVissue. Please link one (or tell me the ID) and I'll update the title/body.