Skip to content

Comments

feat: add 'ready' activity state for live session detection#98

Open
AgentWrapper wants to merge 1 commit intomainfrom
fix/ready-activity-state
Open

feat: add 'ready' activity state for live session detection#98
AgentWrapper wants to merge 1 commit intomainfrom
fix/ready-activity-state

Conversation

@AgentWrapper
Copy link
Collaborator

Summary

  • Adds a new "ready" activity state (🟢) to distinguish sessions that finished their turn and are waiting for input from truly stale sessions
  • Sessions where Claude finished responding were shown as "idle" (💤) — indistinguishable from abandoned sessions. Users couldn't tell if ao-38 was alive and ready vs dead.
  • ready (🟢) = process alive, finished turn, <5min since last activity
  • idle (🟡) = process alive but no activity for >5min (stale/dormant)

Changes

File Change
packages/core/src/types.ts Added "ready" to ActivityState union + ACTIVITY_STATE.READY
packages/plugins/agent-claude-code/src/index.ts Rewrote getActivityState() with ready/idle split at 5min threshold
packages/core/src/session-manager.ts Fallback on detection error → "ready" (runtime is known alive)
packages/web/src/components/SessionCard.tsx Added 🟢 ready icon, changed idle to 🟡
packages/cli/src/lib/format.ts Added cyan "ready" display in CLI
packages/cli/src/commands/status.ts Map assistant/system → "ready" instead of "idle"
Tests (2 files) Updated expectations for new semantics

Activity state semantics

State Icon Meaning
active Processing (thinking, running tools)
ready 🟢 Finished turn, alive, waiting for input (<5min)
idle 🟡 Process alive but stale (>5min)
waiting_input Permission prompt
blocked 🚧 Error
exited 💀 Process terminated

Test plan

  • All 131 core tests pass
  • All 138 CLI tests pass
  • All plugin tests pass
  • Typecheck clean across all 22 packages
  • Lint clean (no new issues)
  • Build succeeds including Next.js web package
  • Verify ao-38 (alive, waiting) shows 🟢 ready on dashboard
  • Verify actively processing sessions show ⚡ active
  • Verify old stale sessions show 🟡 idle
  • Verify killed sessions show 💀 exited

🤖 Generated with Claude Code

…ale ones

Sessions where Claude finished responding were shown as "idle" (💤) —
indistinguishable from truly stale/abandoned sessions. Users couldn't tell
if a session was alive and ready vs dormant.

Adds a "ready" state (🟢) for sessions that finished their turn recently
(<5min), keeping "idle" (🟡) for sessions with no activity for >5 minutes.

- active ⚡ = processing (thinking, running tools)
- ready 🟢 = finished turn, alive, waiting for input (<5min)
- idle 🟡 = process alive but stale (>5min)
- waiting_input ❓ = permission prompt
- blocked 🚧 = error
- exited 💀 = process terminated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

const activityIcon: Record<string, string> = {
active: "\u26A1",
idle: "\uD83D\uDCA4",
ready: "\uD83D\uDFE2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SessionDetail missing "ready" in activity label map

Medium Severity

The new "ready" activity state is added to SessionCard.tsx's activityIcon map but not to SessionDetail.tsx's activityLabel map (line 20–26 of that file). Sessions in the "ready" state — now the most common state for finished-turn sessions — will fall through to the fallback, displaying a raw lowercase "ready" string in muted gray instead of a properly formatted "Ready" label with a distinct color. This defeats the purpose of the feature in the detail view.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant