Repository navigation
Description
Problem
The /session picker (showSessionList in packages/cli/src/pi-tui-runner.ts) shows each Session's name, id, connection, and model — but no live state: you cannot tell whether a Session is running, waiting for a permission answer, or blocked.
This made the trap in #3380 invisible: from a second TUI, the busy Session looks identical to an idle one, so nothing hints that selecting it attaches you to a live Turn you cannot leave.
Design: reuse the existing SessionStatus vocabulary — do not invent picker-only states
The status model already exists end-to-end and Desktop renders it in its session rail. The CLI picker should show the same facts:
SessionStatus (packages/core/src/session.ts): active / running / waiting_for_user / blocked / aborted
running— a Turn is in flight. Display rule (mirror Desktop'snormalizeSessionSummaryForDisplay): only trustrunningwhenrunningTurnIdsis non-empty.statusis persisted and a crash between turn end and the status write leaves a stalerunningbehind;runningTurnIdsis the live kernel fact.waiting_for_user— the Session is waiting on a person. This already covers the "请求权限" case:sandbox_boundary_requestprojects towaiting_for_user+blockedReason: 'permission_required', anduser_question_requestto plainwaiting_for_user(packages/runtime/src/session-projection-helpers.tsstatusFromEvent). Distinguish the two by the blocked-reason text.blocked— only surface actionable reasons (NO_REAL_CONNECTION/auth/permission_required);tool_failed/unknowndisplay as ordinary resumable sessions (Desktop's rule: bookkeeping noise must not look broken).aborted— neutral marker.active— resting state, no marker (Desktop rail deliberately does not mark the ordinary state; a badge on every idle row is noise).
Example rendering (text badge, not a colour dot — the picker is a plain-text list):
fix login flakiness a1b2c3 · running my-conn gpt-5
chore: bump deps d4e5f6 · needs permission my-conn gpt-5
docs sweep g7h8i9 my-conn gpt-5
The no-raw-enum contract from @maka/ui's status presentation applies here too: labels come from the CLI locale copy, never from the enum identifiers.
Plumbing gaps (CLI only)
SessionSummary.statusandblockedReasonare already forwarded byruntimeHostSessionSummary(packages/cli/src/runtime-host-session-driver.tsL1167) — onlyrunningTurnIdsis dropped. Map it through.- The Host already projects both:
SessionCatalogProjection.runningTurnIds(packages/runtime-host/src/protocol/session-catalog.tsL187), with the live-vs-persisted rationale documented onSessionManager. - Then render the badge in
showSessionList.
Scope
- v1: snapshot when the picker opens. Live refresh while the picker sits open is a stretch goal.
- Out of scope: changing any status semantics — this issue is display + one field mapping only.
Related: #3380
Activity
[-]feat(cli): show live running-Turn status in the /session picker[/-][+]feat(cli): show live Session status (running / waiting-for-user / blocked) in the /session picker[/+]