Skip to content

fix(claude): wire event_callback through provider for web dashboard#43

Merged
jrob5756 merged 1 commit intomainfrom
fix/wire-event-callback-claude-provider
Mar 16, 2026
Merged

fix(claude): wire event_callback through provider for web dashboard#43
jrob5756 merged 1 commit intomainfrom
fix/wire-event-callback-claude-provider

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

Summary

Fixes #39.

  • Thread event_callback from execute()_execute_with_retry()_execute_agentic_loop() so the web dashboard receives intermediate events from Claude agents
  • Emit agent_turn_start, agent_message, agent_tool_start, and agent_tool_complete events matching the Copilot provider's event types and data shapes
  • All callbacks guarded with if event_callback: and wrapped in try/except to never break the agentic loop
  • Add 15 unit tests covering event emission, threading, truncation, error resilience, and null callback safety

Test plan

  • make lint passes
  • make typecheck passes
  • make test — 1700 passed, 9 skipped
  • Manual test with --web flag and a Claude MCP workflow — dashboard shows tool calls in real-time

🤖 Generated with Claude Code

)

The Claude provider's execute() accepted event_callback but dropped it —
never forwarding it to _execute_with_retry() or _execute_agentic_loop().
This meant the web dashboard (--web) showed zero intermediate activity
for Claude agents.

Thread event_callback through the call chain and emit events at key
points in the agentic loop, matching the Copilot provider's event types:
- agent_turn_start at each iteration
- agent_message for text blocks in responses
- agent_tool_start / agent_tool_complete for MCP tool calls

All callbacks are guarded and wrapped in try/except to never break the
agentic loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jrob5756 jrob5756 merged commit eb6008e into main Mar 16, 2026
7 checks passed
@jrob5756 jrob5756 deleted the fix/wire-event-callback-claude-provider branch March 17, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude provider: event_callback not used — web dashboard shows no intermediate activity

1 participant