Skip to content

feat(cli): show live Session status (running / waiting-for-user / blocked) in the /session picker #3384

Closed

Description

@me2seeks

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's normalizeSessionSummaryForDisplay): only trust running when runningTurnIds is non-empty. status is persisted and a crash between turn end and the status write leaves a stale running behind; runningTurnIds is the live kernel fact.
  • waiting_for_user — the Session is waiting on a person. This already covers the "请求权限" case: sandbox_boundary_request projects to waiting_for_user + blockedReason: 'permission_required', and user_question_request to plain waiting_for_user (packages/runtime/src/session-projection-helpers.ts statusFromEvent). Distinguish the two by the blocked-reason text.
  • blocked — only surface actionable reasons (NO_REAL_CONNECTION / auth / permission_required); tool_failed / unknown display 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.status and blockedReason are already forwarded by runtimeHostSessionSummary (packages/cli/src/runtime-host-session-driver.ts L1167) — only runningTurnIds is dropped. Map it through.
  • The Host already projects both: SessionCatalogProjection.runningTurnIds (packages/runtime-host/src/protocol/session-catalog.ts L187), with the live-vs-persisted rationale documented on SessionManager.
  • 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

  1. changed the title [-]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[/+] on Aug 21, 2026
  2. added
    enhancement
    good first issue
    help wanted
    on Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions