feat(api): get_agent_status live activity tracking + threadKey filter (by Wren)#209
Open
conoremclaughlin wants to merge 2 commits intomainfrom
Open
feat(api): get_agent_status live activity tracking + threadKey filter (by Wren)#209conoremclaughlin wants to merge 2 commits intomainfrom
conoremclaughlin wants to merge 2 commits intomainfrom
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_agent_statusnow detects agents actively working — queriesactivity_streamforagent_spawnentries withstatus='running'to show real-time presence. New"working"status means an agent is mid-backend-turn, withcurrentActivityshowingthreadKey,backend,triggeredBy, anddurationSoFar.agentIdto get status for every registered agent, with a summary of how many are working/active/inactive.threadKey: "pr:204"to find who is currently working on that thread.get_activity— new filter on the activity query tool and repository, matching onpayload.threadKeyvia JSONB@>containment.agentIdstill 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
get_agent_status()with no args while another agent is spinningget_agent_status(threadKey: "pr:204")to find who's on that thread🤖 Generated with Claude Code