Skip to content

feat: at-a-glance agent status (blocked / working / done)#366

Open
frarredondo wants to merge 1 commit into
dcouple:mainfrom
frarredondo:feat/agent-status-cues
Open

feat: at-a-glance agent status (blocked / working / done)#366
frarredondo wants to merge 1 commit into
dcouple:mainfrom
frarredondo:feat/agent-status-cues

Conversation

@frarredondo

Copy link
Copy Markdown
Contributor

Summary

What. Every agent pane now reports a live status (blocked, working, or done) on the sidebar session rows, the pane tabs, and the Pane Chat entry, so a screen full of parallel agents reads in one glance instead of opening each one.

Why. The old indicator was binary (active/idle), so "waiting on your approval", "still thinking", and "finished a while ago" all looked the same. The one thing you actually want to spot, which pane is blocked on you, was invisible. See #365.

How. Each agent pane is classified continuously from three signals its terminal already produces: the live screen snapshot, the OSC window title, and whether PTY bytes are still flowing. A small state machine arbitrates those into blocked / working / idle, with debounce so spinner gaps and startup don't cause flicker. Panel states roll up per session (blocked wins, then working, then idle) and render with distinct colors. A session that finishes while you are looking elsewhere shows as "done" until you open it. Plain shell panes get no badge.

Built test first, so the detection rules, the arbitration, and the rollup all have unit tests.

What changed

Backend (main):

  • Detection engine. A pure, dependency-free rule engine plus per-agent rule sets for Claude, Codex, and a generic fallback. It turns a screen snapshot and OSC title into blocked / working / idle. No side effects, fully unit tested.
  • Terminal screen model. TerminalStateEmulator now also captures the OSC window title and progress, which is where the CLIs encode spinner and "action required" state.
  • Continuous monitor. A new AgentStatusMonitor combines the screen classification with recent PTY activity (the working authority) and debounces working to idle plus a short startup grace. It runs on a 500ms poll inside terminalPanelManager and emits a new panel:agentStatus IPC event. Only agent panes register; plain shells never do.

Frontend:

  • State. panelStore tracks each panel's status along with the sessionId from the event, and one shared rollup helper is used by both the store getter and the useAgentStatus hook, so background sessions and Pane Chat light up without their panels being loaded.
  • UI. A left accent bar on the session rows (amber with an up and down loading sweep for working), a dot with an amber spinner for working on the pane tabs and the Pane Chat entry, and a status badge on the narrow sidebar rail. New Tailwind status-working sweep animation.

Docs:

  • The README "Status Cues" row was rewritten to describe the three states.

Visual overview

No asset yet. State to visual mapping:

Status Meaning Session row bar Tab / Pane Chat dot
blocked waiting on your approval red red dot
working actively running amber, up/down sweep amber spinner
done finished while you were away blue blue dot
idle finished and seen green green dot
(no agent) plain shell pane neutral none

Verification

Run on current head of the branch:

Check Result
pnpm typecheck pass, all 4 workspaces
pnpm lint 0 errors (163 main / 165 frontend warnings, all pre-existing no-console / require-imports)
feature unit tests (main agentStatus + emulator) pass, 42 tests
pnpm --filter frontend test pass, 108 tests
pnpm --filter main test (full) 427 pass, 4 fail

The 4 failures are the better-sqlite3-multiple-ciphers native-arch DB tests that fail under the ambient Node here, an environment artifact unrelated to this change (same set noted in #363).

Manual tests

  • Run a Claude pane, trigger a permission prompt, confirm the session row bar turns red.
  • While it generates, confirm the bar sweeps amber and the tab shows an amber spinner.
  • Let it finish in a background session, confirm blue "done", then open it and confirm it goes green.
  • Open Pane Chat, start the orchestrator, confirm the Pane Chat entry spins amber then settles.
  • Confirm a plain (non-agent) terminal pane shows no badge.

Non-goals

  • Persisting status across restarts. It is live only, so a session you never opened this run shows nothing. Possible follow-up.
  • Changing the existing 30s active/idle pipeline. This is a separate, faster layer alongside it.
  • Line by line transcript parsing. Classification is screen, title, and activity based on purpose.

Residual risks

  • The screen classification is a heuristic. A prompt style the rules do not recognize falls back to idle or working instead of blocked. The rules are structured per agent so they are easy to extend.
  • "Done vs idle" reuses the existing "finished while you were elsewhere" flag, which is session scoped.

Closes #365

Classify each agent pane from its live terminal screen, OSC title, and PTY
activity into blocked / working / idle, debounced, and surface it on the
sidebar session rows, the pane tabs, and the Pane Chat entry. Roll up per
session (blocked > working > idle); a pane that finishes unseen reads as done.

- pure manifest detection engine + Claude/Codex/generic rule sets (unit tested)
- OSC title/progress capture in TerminalStateEmulator
- AgentStatusMonitor: screen + PTY-activity arbitration with debounce, wired
  into terminalPanelManager on a 500ms poll, emits panel:agentStatus
- panelStore keeps per-panel status keyed by sessionId; one shared rollup used
  by the store getter and the useAgentStatus hook
- session-row accent bar (amber sweep), dot+spinner on tabs and Pane Chat
- README Status Cues row updated

Closes dcouple#365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: at-a-glance agent status (blocked / working / done)

1 participant