Repository navigation
feat(tui): add the /jev picker and status badge for the session Jev mode (ADR-0042) - #170
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…ode (ADR-0042) Reserve /jev in the protocol again now that the TUI registers it. The picker lists configured plus the five rungs, opens on the rung in effect, sends set_jev_mode for the focused session (running or not; the runtime reads it at the next claim), and reports the receipt. The top row shows 'jev <mode>' while a rung is set; 'configured' shows nothing. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Live QA (server + TUI), against a real
|
| Check | Result |
|---|---|
POST /v1/sessions/jev-mode for low, medium, high, max, ultrajev |
200, outcome jev_mode_set with the mode echoed, committed_through.sequence advancing 2..6 |
Clear (mode omitted) |
200, outcome jev_mode_set without mode; sessions.jev_mode is NULL in SQLite |
| SQLite after each set | sessions.jev_mode holds the canonical string (high, ultrajev, ...) |
POST /v1/workspaces/snapshot |
SessionSummary.jev_mode present when pinned, omitted when cleared; focused.summary.jev_mode matches |
SSE replay from Last-Event-ID: <store>:<ws>:0 |
one session_updated per command, in order, jev_mode = low, medium, high, max, ultrajev, <absent>, high, ...; session_created for the child already carries the inherited high |
| Child inherits parent pin | child row jev_mode = high in SQLite and in the snapshot |
Kill and restart qq serve |
snapshot and replay unchanged after restart (durable); further set/clear after restart behaves the same |
| Validation | unknown mode "turbo" -> 400 invalid request; unknown session -> 400 session was not found; no bearer -> 401 |
| Rung applied at claim time (fail closed) | with a placeholder OPENAI_API_KEY and no TYPESAFE_API_KEY: pinned high -> run_finished failed{kind: configuration, "JEV review or routing requires the stored typesafe-jev credential or TYPESAFE_API_KEY before the agent starts"} before any provider call; pin cleared -> the same session reaches OpenAI (provider_authentication 401 on the placeholder key). The pin changes runtime composition for the next run only, as documented. |
TUI /jev (recorded, real terminal, attached to the same server)
- Passed:
/jevlisted under Model in/helpand/commands; pickerJEV MODEshows six ordered rows (configured, low, medium, high, max, ultrajev) with summaries and the current row marked active. - Passed: choosing
maxcloses the picker, statussession jev mode set to max from the next run, top row showsjev max. - Passed: reopening marks
maxactive; accepting it showssession already uses jev mode max, SQLite unchanged, persisted event count unchanged (26 -> 26). - Passed: choosing
configuredshowsjev mode cleared: the configured Jev settings apply from the next run, badge removed, SQLiteNULL. - Passed: set
high, quit, relaunch: badgejev highis back from server state. - Passed (regression):
/modelsand/effortopen and close normally. - Untested: the no-focus warning (
/newneeds a client-side model credential in this environment, so a no-focus state was not reached; covered by the unit testjev_mode_picker_needs_a_focused_session).
| Six-mode picker | Max selection and receipt |
|---|---|
|
Incorporated by replacement in merged #181, main 2103aa5. Independent exact-source review accounted for all unique #166/#170 changes: saved session mode, /jev picker and badge, receipts, guards and focused tests remain, with misleading active/approval wording repaired. The retained integration c5a5836 includes this exact head as its second parent; the accepted replacement tree is now main. Closed as incorporated, not merged. Original head 6cbe790 and branch are retained. Review report SHA256 c84c39eb2f75aa066e68517f83dee144fb565989b20b2142702ebe6d947cd0dd. No unique output was discarded; live runtime/release qualification remains separate. |
Stacked on #166 (base:
devin/1790291940-jev-mode-kernel). Merge #166 first; this PR is the TUI surface for theset_jev_modecommand it adds.What changes for users
/jevopens a picker for the focused session's Jev mode —configured,low,medium,high,max,ultrajev— with a one-line summary of what each rung enables andactiveon the rung in effect. The picker opens on the current rung;Entersendsset_jev_modefor the focused session (running or not — the runtime reads it when it claims the next run, the active run keeps its plan), and the receipt reports:The top row shows
jev maxwhile a rung is set and nothing when the session uses the configured capabilities, mirroring theeffort …badge./jevis listed under/helpand/commandsin the Model group next to/modelsand/effort, which are unchanged.Why / design
ADR-0042 (
docs/adr/0042-session-model-and-jev-mode-switchers.md). The picker mirrors/delegate: the mode belongs to a session that exists, so there is no "default for the next/new" path (children inherit the parent's mode in the store instead). Rows come fromJevMode::ALL, so the TUI cannot drift from the protocol's ladder order. The/jevreservation inRESERVED_CLIENT_SLASH_COMMANDSmoves from #166 to this PR because the TUI's registry test requires every reserved slash command to be registered.Mode::Jev(notMode::JevMode) because Clippy'senum_variant_namesrejects a variant that ends with the enum's name;Overlay::JevMode(Picker<JevModeRow>)keeps the full name.Linear: ENG-
Slice: workstream (d) model switcher, TUI slice (ADR-0042)
How verified
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace— all suites green;qq-tui326 passed (3 new),qq-protocol48 passedcargo test -p qq-provider --no-default-features --features test-support(n/a —qq-providerunchanged in this PR; run green on the base)cargo build --workspaceNew tests:
app::tests::jev_mode_picker_switches_the_focused_session_and_reports_the_receipt— row order equals[None] ++ JevMode::ALL;ultrajevsendsSetJevMode { mode: Some(Ultrajev) }for the focused (running) session; theJevModeSetreceipt sets the status; reopening on the active rung sends nothing;configuredsendsmode: Noneand the clear receipt is reportedapp::tests::jev_mode_picker_needs_a_focused_sessionview::tests::jev_mode_picker_and_badge_name_the_rung_in_effect— no badge forNone,jev maxbadge forSome(Max), picker rendersJEV MODEwith all six rows and marks onlymaxactive/jev(24 reserved slash commands ↔ 42 command specs)Impact
PROTOCOL_VERSIONstays 29 (set in feat(protocol)!: add the per-session Jev mode switcher (ADR-0042) #166);RESERVED_CLIENT_SLASH_COMMANDSgains/jev(23 → 24). Store schema unchanged (37 from feat(protocol)!: add the per-session Jev mode switcher (ADR-0042) #166).StatusItem::DEFAULTgainsJev(6 → 7 items); the badge is omitted unless a rung is set, so default frames are unchangeddocs/guide/tui.md(picker table row + command summary),docs/runbooks/jev.md(TUI sentence in the Jev mode section)Link to Devin session: https://app.devin.ai/sessions/5288c73e9e644e0dad0a0c23700b9b46
Open in Devin Desktop: https://app.devin.ai/desktop/session/5288c73e9e644e0dad0a0c23700b9b46?variant=devin
Requested by: @integrate-your-mind