story-kit: create 147_bug_activity_indicator_still_only_shows_thinking_despite_bug_140_fix

This commit is contained in:
Dave
2026-02-24 13:58:52 +00:00
parent 1e229843be
commit 0e76bbfc55

View File

@@ -0,0 +1,38 @@
---
name: "Activity indicator still only shows Thinking despite bug 140 fix"
---
# Bug 147: Activity indicator still only shows Thinking despite bug 140 fix
## Description
Bug 140 fixed the frontend display condition but activity labels still never appear. The likely root cause is that Claude Code stream-json PTY output does not emit raw Anthropic API format events (content_block_start with type tool_use) inside stream_event wrappers. The handle_stream_event function in server/src/llm/providers/claude_code.rs line 486 only matches content_block_start, which is the Anthropic streaming API format. Claude Code CLI stream-json may use a different event structure for tool calls.
Investigation needed:
1. Add temporary logging in process_json_event (line 327) to dump all event types received from the PTY
2. Determine the actual event format Claude Code uses for tool calls in stream-json mode
3. Add matching for that format in handle_stream_event or process_json_event to fire activity_tx
Key files:
- server/src/llm/providers/claude_code.rs line 327: process_json_event
- server/src/llm/providers/claude_code.rs line 486: handle_stream_event
- server/src/http/ws.rs line 251: activity callback wiring
## How to Reproduce
1. Rebuild both frontend and backend from master (which includes story 86 and bug 140)
2. Open web UI chat
3. Send a message that causes tool use (e.g. ask agent to read a file)
4. Watch the activity indicator
## Actual Result
Indicator always shows Thinking and never changes to tool activity labels like Reading file or Executing command
## Expected Result
Indicator should cycle through tool activity labels as the agent calls tools
## Acceptance Criteria
- [ ] Bug is fixed and verified