story-kit: create 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat

This commit is contained in:
Dave
2026-02-24 11:53:29 +00:00
parent 1f9ed34735
commit 831555043b

View File

@@ -21,6 +21,14 @@ As a user chatting with Claude in the web UI, I want to see what the agent is ac
Previous implementation (now reverted to upcoming) only wired up activity events for the Anthropic API provider. The Claude Code provider in `claude_code.rs` was left with no `on_activity` callback — it only streams text tokens. Since agents use Claude Code, the web UI showed no activity during agent work. Previous implementation (now reverted to upcoming) only wired up activity events for the Anthropic API provider. The Claude Code provider in `claude_code.rs` was left with no `on_activity` callback — it only streams text tokens. Since agents use Claude Code, the web UI showed no activity during agent work.
### Implementation hints for the Claude Code provider
1. Add an `on_activity` callback parameter to `ClaudeCodeProvider::chat_stream()` (matching the Anthropic provider signature)
2. In `handle_stream_event()`, parse tool names from Claude Code's stream-json output (tool activity events are already in the stream, just currently ignored — only text deltas are extracted)
3. Call the `on_activity` callback when a tool use event is detected
4. In `chat.rs`, pass the `on_activity` closure to the Claude Code path (same as the Anthropic path already does)
5. `ws.rs` will then send `ToolActivity` WebSocket messages to the frontend — no frontend changes needed
## Out of Scope ## Out of Scope
- TBD - TBD