feat(auto): surface routing scope and per-turn receipts#4500
Conversation
6a8cfe6 to
e6215f6
Compare
|
Release-blocker fixes are pushed at exact head Resolved in this head:
Exact-head local gates are green: fmt, diff check, bin clippy with warnings denied, 27 routing tests, 10 inventory tests, 17 localization tests, 3 model-bound redaction tests, 31 session lifecycle tests, and 2 receipt persistence tests. Hosted CI restarted for the rebased head and is currently queued/running. The PR body now reflects the corrected durability claim and the remaining scope: latest TUI receipt persistence is included; a historical receipt ledger and runtime-thread/sub-agent receipt surfaces are not. The release changelog lane in #4487 should list this PR after merge. Contributor credit is unchanged; no external contributor material was added by this fix. |
Record provider-safe strong/fast pairs, selected tier, scope, reason, and local/classifier data path for every Auto selection. Redact classifier inventory inputs and reject unready provider/model recommendations.
Carry Auto decision metadata with the exact authoritative turn, disclose classifier scope and data flow in the localized model picker, and show resolved route diagnostics in the Turn Inspector. Document the classifier context boundary and fallback behavior.
Update resolved-route diagnostics atomically at dispatch time so the inspector cannot combine a newly selected provider/model with stale Auto decision metadata. Keep the Auto picker row construction isolated from provider rows.
Redact flattened routing context at the classifier boundary and derive receipt pairs from the selected model family. Persist the latest atomic Auto route receipt across automatic and explicit session lifecycle paths while keeping legacy sessions loadable. Signed-off-by: Hunter B <hmbown@gmail.com>
e6215f6 to
1e7c016
Compare
|
Rebased cleanly onto exact main New exact head: Local exact-head verification passed:
Fresh exact-head CI and CodeQL are running now; I will not mark ready or merge until the platform matrix is green. |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Summary
/save, fork, rename, and session restore while keeping older session JSON loadableselect per turnpicker hint with localized disclosure of local vs. DeepSeek classifier behavior and the last resolved provider/modelCtrl+OTurn Inspector outputWhy
Auto routing can select across the runnable provider inventory and send the latest request plus bounded recent context to
DeepSeek / deepseek-v4-flash. Before this lane, the picker did not disclose that behavior and the decision metadata was not attached to the exact turn. The initial implementation also exposed two release blockers: flattened tool results could bypass structured tool-result redaction, and a non-default OpenRouter model could inherit the provider default's unrelated pair in its receipt.This makes the existing behavior observable, auditable, secret-safe, model-family-correct, and durable across TUI session lifecycle operations without copying credentials, endpoints, provider failure text, or raw classifier errors into diagnostics.
User impact
The model picker now states whether a routing request may be sent and shows the last resolved route. After dispatch, the localized toast identifies the concrete route and source. The Turn Inspector keeps the detailed receipt aligned with the authoritative runtime route, including classifier-fallback cases where data was sent before the local heuristic took over. The latest receipt remains available after saving and resuming the session.
Verification
Exact tested head:
e6215f6a354ee9764a81bdddada728cf3d5455caRebased base:
8ab67a0bc03ac78406677339f3e4e3714e138885cargo fmt --all -- --checkgit diff --check origin/main...HEADcargo clippy -p codewhale-tui --bin codewhale-tui --locked -- -D warningscargo test -p codewhale-tui --bin codewhale-tui --locked model_routing— 27 passedcargo test -p codewhale-tui --bin codewhale-tui --locked model_inventory— 10 passedcargo test -p codewhale-tui --bin codewhale-tui --locked localization::tests::— 17 passedcargo test -p codewhale-tui --bin codewhale-tui --locked model_bound_request_— 3 passedcargo test -p codewhale-tui --bin codewhale-tui --locked commands::groups::session::session::tests— 31 passedcargo test -p codewhale-tui --bin codewhale-tui --locked auto_route_receipt— 2 passedDeliberate residual scope
[auto] cost_savingbehavior from fix(auto): honor cost_saving in inventory routing #4486 are preserved.Refs #4405
Refs #4411