feat: one-word status for every kind of agent work

HK
17d ago
+278-54

Summary

The running status fell back to "Working" for 56% of recent tool calls, because one unknown program in a command made the whole command unknown. Now every running thread gets a one-word action: unknown commands count as Running, and new words cover the work that had no word.

Changes

  • packages/contracts/src/orchestrationV2.ts: OrchestrationV2WorkingPhase adds thinking, responding, running, installing, building, committing, pushing, delegating, waiting, planning.
  • packages/shared/src/orchestrationV2WorkingPhase.ts:
    • An unknown program no longer makes the command unknown. The highest phase across segments wins (running < waiting < reading < editing < installing < building < testing < measuring < committing < pushing).
    • Heredoc bodies are skipped. A read filter after a pipe (| head, | grep) does not count.
    • New command rules: file writes (>, mkdir, rm, cp, mv, tee), installs, build tasks, git and gh by subcommand, sleep and poll loops.
    • New tool rules: Agent, thread launch and send (delegating); background and thread waits, Monitor (waiting); Skill, ToolSearch, TodoWrite, plan tools (planning); PR tools (pushing); MCP read and write verbs.
    • reasoning items give Thinking and assistant_message items give Responding. A running run with no items yet is Thinking. Both item types join WORKING_PHASE_TURN_ITEM_TYPES, so the SQL shell read picks them up too.
  • apps/web/src/components/Sidebar.logic.ts: labels and colors for the new phases.
  • apps/web/src/components/sidebar/SidebarThreadRow.tsx: lucide icons for the new phases.

Tests

  • vp run check:changed passes (format, lint, knip, typecheck, tests, React compiler).
  • orchestrationV2WorkingPhase.test.ts: 66 cases, with new rows for each new rule and for Thinking and Responding in deriveWorkingPhase.
  • ProjectionStore.test.ts (52 pass): a thread-wait tool now shows waiting, not null.
  • Measured on the last 3000 real tool items (read-only export of the local database), before and after:
PhaseBeforeAfter
none ("Working")16270
reading11241634
editing119380
testing125259
runningn/a152
committingn/a122
pushingn/a117
waitingn/a88
planningn/a83
buildingn/a67
installingn/a34
delegatingn/a32
measuring532
  • GitHub Actions cannot run on this repo now (billing), so these local checks are the only checks.

Scope affected

Server shell projection (working phase), shared classifier, contracts and the web status label (sidebar, agent overview, switcher). The tui branch decodes the same schema, so it must merge main after this. No change to thread status or wait counts.

Reasoning

Thinking and Responding make the status follow the latest item, not only the latest tool, so a thread that reasons after a read no longer shows Reading. The payload read adds at most one row per running thread.

Preview

The new words with their icons and colors, rendered with the app styles in a headless browser:

preview


Summary by cubic

Running threads now show a one-word activity instead of falling back to “Working” for unrecognized commands or work. This makes the status more useful for seeing what the agent is doing.

  • Adds statuses for thinking, responding, running, installing, building, committing, pushing, delegating, waiting, and planning.
  • Uses the latest turn item to set the status, so reasoning and responses can replace the status from an earlier tool call.
  • Classifies shell commands by their highest-priority action; unknown programs count as Running, and heredoc content and read-only pipe filters are ignored.
  • Adds matching labels, colors, and icons in the sidebar.