fix(canvas): show task text in Agent Comms for MCP delegate_task calls (#158) #163
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/canvas-agent-comms-show-task-text"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
MCP delegate_task and delegate_task_async bypassed the delegation activity lifecycle entirely — no activity_log row was written for MCP-initiated delegations. As a result the canvas Agent Comms tab rendered outbound delegations as bare "Delegation dispatched" events with no task body.
Fix: insert a delegation row (mirroring insertDelegationRow from delegation.go) before the A2A call so the canvas Agent Comms tab can show the task text.
Changes
workspace-server/internal/handlers/mcp_tools.go:
Root cause (issue #158)
When delegate_task is called via MCP, the task text is embedded in the A2A body but never written to activity_logs. The canvas AgentCommsPanel shows "Delegating to ${peerName}" instead of the actual task because request_body.task is empty.
Related
Test plan
Generated with Claude Code
Phase 1 Self-Review (dev-sop.md Phase 1)
Brief claims (each a hypothesis until verified)
Verification
Layer map
Risk assessment
Test plan
Known limitation
This fix makes MCP delegations visible in the canvas but does NOT emit DELEGATION_SENT/STATUS/COMPLETE WebSocket events. Full lifecycle parity (issue #49) requires the DelegationWriter extraction — tracked separately.