story-kit: start 93_bug_agent_session_id_is_null_while_running

This commit is contained in:
Dave
2026-02-23 19:43:18 +00:00
parent 0aaefc34c2
commit 306514e6d2

View File

@@ -0,0 +1,28 @@
---
name: "Agent session_id is null while running"
---
# Bug 93: Agent session_id is null while running
## Description
The session_id from Claude Code's initial `system` JSON event is captured during PTY streaming (agents.rs:2011) but only stored on the agent record after the process exits (agents.rs:1293 in run_server_owned_completion). While the agent is actively running, list_agents and get_agent_output always report session_id: null.
## How to Reproduce
1. Start an agent on any story via start_agent
2. Call list_agents while the agent is running
3. Observe session_id is null
## Actual Result
session_id is null for the entire duration of the agent run. Only populated after the process exits.
## Expected Result
session_id should be set on the agent record as soon as the first `system` JSON event is parsed from the PTY stream, making it available for live log retrieval and monitoring.
## Acceptance Criteria
- [ ] list_agents returns a non-null session_id within seconds of agent startup
- [ ] session_id is available for persistent log lookup while agent is still running