From 88aa2de2adaf5f75a60672ea0663288c7d560afd Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Feb 2026 13:05:07 +0000 Subject: [PATCH] story-kit: create 131_bug_get_agent_output_stream_always_times_out_for_running_agents --- ..._stream_always_times_out_for_running_agents.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.story_kit/work/1_upcoming/131_bug_get_agent_output_stream_always_times_out_for_running_agents.md b/.story_kit/work/1_upcoming/131_bug_get_agent_output_stream_always_times_out_for_running_agents.md index 18e87be..fd4881e 100644 --- a/.story_kit/work/1_upcoming/131_bug_get_agent_output_stream_always_times_out_for_running_agents.md +++ b/.story_kit/work/1_upcoming/131_bug_get_agent_output_stream_always_times_out_for_running_agents.md @@ -25,6 +25,21 @@ The `get_agent_output` MCP tool consistently returns "Stream timed out; call aga `get_agent_output` streams back text tokens and status events from the running agent in real time. `session_id` is populated once the agent's first streaming event arrives. +## Reopened — Previous Fix Did Not Work + +This was archived after a coder pass but the bug is still present. With 3 agents actively running: +- `get_agent_output` returned 141 events on one call, then 0 events on the next call with a 5s timeout +- None of the events contained text output — only metadata/status events +- The server logs (`get_server_logs`) DO show agent activity (spawn commands, MCP calls), so the agents are working — the output just isn't being captured/forwarded + +### Investigation needed + +The coder needs to trace the full data path: +1. How does `run_agent_pty_streaming` (server/src/agents.rs) capture PTY output from the claude process? +2. How are those events published to the broadcast channel that `get_agent_output` subscribes to? +3. Is the broadcast channel being created before the agent starts producing output, or is there a race where early events are lost? +4. Are text tokens from the PTY being sent as `AgentEvent` variants that `get_agent_output` actually serializes, or are they filtered out? + ## Acceptance Criteria - [ ] get_agent_output returns streaming text events while an agent is actively running