Bugfix: Why does MCP handoff_pending return no handoffs for Testing ...
Documentation for Sessions
🐛 Bugfix: Why does MCP handoff_pending return no handoffs for Testing ...
Date: 2026-02-06
Time: 23:29:35 UTC
Session: editor2-97.16
Agent: testing
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why does MCP handoff_pending return no handoffs for Testing Director (Cowork/Claude Desktop)?
Task: Fix MCP agent identity and handoff routing for Testing Director
🎯 Decision Made
Chosen:
Replace hardcoded agentType='code' with dynamic detection via getHandoffAgentType() that maps platform → agent type (cursor/claude-code → 'code', claude-desktop → 'browser')
Options Considered:
- Dynamic platform-to-agentType mapping
- Always query with agentType='any' to match everything
- Add agentType parameter to handoff_pending tool input
💭 Reasoning
Three bugs: (1) handoff.ts hardcodes agentType='code' in both handleGetPendingHandoffs and handleWatchHandoffs, so browser-targeted handoffs are never matched for Claude Desktop agents. (2) server.ts resource handler hardcodes agentType=code AND workspace=editor2 instead of using WORKSPACE_ID. (3) session-detector.ts isCursor() checks history.json for any cursor session, causing false positives for Claude Desktop. Fixed all three: dynamic agent type mapping, WORKSPACE_ID constant, removed the unreliable history.json check from isCursor().
📁 Files Involved
MCP/mcp-gograb-ai/src/tools/handoff.tsMCP/mcp-gograb-ai/src/server.tsMCP/mcp-gograb-ai/src/session/session-detector.ts
🔗 Related
- Decision ID:
dev_1770420575368_z87dr2z - Session: 97
- Workspace: editor2
Auto-generated by MCP Smart Consolidation