Skip to content

feat(api): get_agent_status live activity tracking + threadKey filter (by Wren)#209

Open
conoremclaughlin wants to merge 2 commits intomainfrom
wren/feat/get-active-agents
Open

feat(api): get_agent_status live activity tracking + threadKey filter (by Wren)#209
conoremclaughlin wants to merge 2 commits intomainfrom
wren/feat/get-active-agents

Conversation

@conoremclaughlin
Copy link
Owner

Summary

  • get_agent_status now detects agents actively working — queries activity_stream for agent_spawn entries with status='running' to show real-time presence. New "working" status means an agent is mid-backend-turn, with currentActivity showing threadKey, backend, triggeredBy, and durationSoFar.
  • All-agents mode — call with no agentId to get status for every registered agent, with a summary of how many are working/active/inactive.
  • threadKey filter — pass threadKey: "pr:204" to find who is currently working on that thread.
  • threadKey filter on get_activity — new filter on the activity query tool and repository, matching on payload.threadKey via JSONB @> containment.
  • Backwards compatible — passing agentId still returns the same flat response shape as before.

Born from the observation: "we're always saying things like, I guess they're working on X." Now we can just ask.

Test plan

  • 255/255 MCP tests pass
  • Zero new type errors
  • Backwards compatible: single-agent call returns same shape
  • Manual: call get_agent_status() with no args while another agent is spinning
  • Manual: call get_agent_status(threadKey: "pr:204") to find who's on that thread

🤖 Generated with Claude Code

conoremclaughlin and others added 2 commits March 9, 2026 17:02
…eadKey filter

get_agent_status now detects agents actively spinning on backend turns by querying
activity_stream for agent_spawn entries with status='running'. New status 'working'
means an agent is mid-turn, with currentActivity showing threadKey, backend,
triggeredBy, and durationSoFar.

Call with no args to see all agents. Pass threadKey to find who's working on a
specific thread (e.g., 'pr:204'). Backwards compatible — single agentId still
returns flat response.

Also adds threadKey filter to get_activity and the activity repository for
querying activities by payload.threadKey.

Co-Authored-By: Wren <noreply@anthropic.com>
When an agent is working in parallel studios (shadow clones), the studioId
in currentActivity disambiguates which studio each activity belongs to.

Co-Authored-By: Wren <noreply@anthropic.com>
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