Skip to content

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

@franklixuefei

Description

@franklixuefei

Feature Request / Bug

The Claude provider's execute() method accepts an event_callback parameter but never invokes it. This means the web dashboard (--web / --web-bg) shows only agent input and output, with no visibility into intermediate activity (tool calls, reasoning, MCP interactions).

The Copilot provider correctly forwards events via _forward_event(), emitting agent_reasoning, agent_tool_start, agent_tool_complete, agent_turn_start, and agent_message events that the web dashboard renders in real-time.

Root Cause

In src/conductor/providers/claude.py:

  1. execute() (line ~395) accepts event_callback: EventCallback | None = None
  2. But _execute_with_retry() (line ~420) is called without forwarding event_callback
  3. The agentic loop in _execute_agentic_loop() has all the information needed (tool names, tool results, iteration counts, API responses) but never calls the callback

Expected Behavior

The web dashboard should show real-time intermediate activity for Claude provider agents:

  • Tool call start — which MCP tool is being called and with what arguments
  • Tool call complete — tool result (truncated)
  • Turn/iteration progress — which iteration of the agentic loop
  • Text content — any text blocks in intermediate responses

This matches the Copilot provider's behavior (see _forward_event() at line ~1161 of copilot.py).

Actual Behavior

  • Web dashboard shows agent name, input prompt, and final output only
  • No intermediate activity visible — tool calls, file reads, MCP interactions are invisible
  • Users have to tail -f the log file to see what's happening

Suggested Fix

  1. Pass event_callback through execute()_execute_with_retry()_execute_with_retry_inner()_execute_agentic_loop()

  2. In _execute_agentic_loop(), emit events at key points:

# At start of each iteration:
if event_callback:
    event_callback("agent_turn_start", {"turn": iteration})

# When MCP tool calls are identified:
for tool_use in mcp_tool_uses:
    if event_callback:
        event_callback("agent_tool_start", {
            "tool_name": tool_use.name,
            "arguments": str(dict(tool_use.input))[:500] if hasattr(tool_use, "input") else None,
        })

# After each MCP tool completes:
if event_callback:
    event_callback("agent_tool_complete", {
        "tool_name": tool_use.name,
        "result": str(result)[:500] if result else None,
    })

# For text content in responses:
for block in response.content:
    if hasattr(block, "type") and block.type == "text" and block.text:
        if event_callback:
            event_callback("agent_message", {"content": block.text})

Relationship to #37 and #38

This is independent of the tool_filter (#37) and parse recovery (#38) bugs, but becomes visible only after those are fixed — with MCP tools actually working, the lack of intermediate events is noticeable.

Environment

  • Conductor v0.1.0 (commit 391ddaf)
  • Python 3.12.13

Impact

Medium — The web dashboard is significantly less useful with the Claude provider compared to Copilot. Users cannot monitor agent progress in real-time and must rely on log files instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions