From bb881eca92f5128ab05d4e8985c3596280877083 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Feb 2026 11:51:30 +0000 Subject: [PATCH] story-kit: create 131_bug_get_agent_output_stream_always_times_out_for_running_agents --- ...eam_always_times_out_for_running_agents.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .story_kit/work/1_upcoming/131_bug_get_agent_output_stream_always_times_out_for_running_agents.md 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 new file mode 100644 index 0000000..18e87be --- /dev/null +++ b/.story_kit/work/1_upcoming/131_bug_get_agent_output_stream_always_times_out_for_running_agents.md @@ -0,0 +1,32 @@ +--- +name: "get_agent_output stream always times out for running agents" +--- + +# Bug 131: get_agent_output stream always times out for running agents + +## Description + +The `get_agent_output` MCP tool consistently returns "Stream timed out; call again to continue" even when the agent process is actively running, making API calls, and committing work. The `list_agents` call shows the agent as `running` with `session_id: null` throughout its entire execution, only populating the session_id after the process exits. This makes it impossible to observe agent progress in real time via MCP. + +## How to Reproduce + +1. Start an agent on a story (e.g. `start_agent` with `coder-1`) +2. Confirm the claude process is running (`ps aux | grep claude`) +3. Call `get_agent_output` with the story_id and agent_name +4. Observe it returns "Stream timed out" every time, regardless of timeout_ms value (tested up to 10000ms) +5. `list_agents` shows `session_id: null` throughout +6. Agent completes its work and commits without ever producing observable output + +## Actual Result + +`get_agent_output` never returns any events. `session_id` stays null while the agent is running. The only way to observe progress is to poll the worktree's git log directly. + +## Expected Result + +`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. + +## Acceptance Criteria + +- [ ] get_agent_output returns streaming text events while an agent is actively running +- [ ] session_id is populated in list_agents shortly after agent spawn +- [ ] Calling get_agent_output multiple times yields incremental output from the agent