fix(server): classify ACP Task tool calls as collab agent tool calls #8443
ClosedNoahLinckeScout(GitHub profile, opens in a new tab)wants to merge 5 commits into
main fromrefs/pull/8443/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/provider/acp/AcpCoreRuntimeEvents.ts lines 76 to 77Resolvedby NoahLinckeScout(GitHub profile, opens in a new tab)@@ -62,0 +66,21 @@66+ * the wire. Classifying them as `dynamic_tool_call` renders them as generic67+ * tool rows, which is how a Cursor thread's delegated subagents became68+ * invisible to the timeline. Claude and Codex classify the same work as69+ * `collab_agent_tool_call`, so match them on every recognizable spelling.70+ */71+function isAcpTaskToolCall(toolCall: AcpToolCallState): boolean {72+ const rawInput = toolCall.data.rawInput;73+ if (74+ typeof rawInput === "object" &&75+ rawInput !== null &&76+ "_toolName" in rawInput &&77+ typeof rawInput._toolName === "string"78+ ) {79+ return rawInput._toolName.trim().toLowerCase() === "task";80+ }81+ return typeof toolCall.title === "string" && /^task:/i.test(toolCall.title.trim());82+}83+84+function canonicalItemTypeFromAcpToolCall(toolCall: AcpToolCallState): ToolLifecycleItemType {85+ if (isAcpTaskToolCall(toolCall)) {86+ return "collab_agent_tool_call";
- apps/mobile/src/lib/threadActivity.ts line 967Resolvedby NoahLinckeScout(GitHub profile, opens in a new tab)@@ -650,6 +650,7 @@650650 if (entry.itemType === "web_search") return "globe";651651 if (entry.itemType === "image_view") return "eye";652652 if (entry.itemType === "mcp_tool_call") return "wrench";653- if (entry.itemType === "dynamic_tool_call" || entry.itemType === "collab_agent_tool_call") {654- return "hammer";655- }653+ // The ACP Task-tool reclassification now files delegated subagent launches654+ // here; they are agent work, not another anonymous tool row. Matches the655+ // web timeline, which reads the same type as `agent-tool`.656+ if (entry.itemType === "collab_agent_tool_call" || entry.taskId) return "agent";
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
- apps/server/src/provider/acp/AcpCoreRuntimeEvents.ts line 69OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -49,3 +50,20 @@4950 }5051 }515253+/**54+ * Task-tool launches over ACP (Cursor, Grok) currently arrive as anonymous55+ * background tool calls titled "Task: Subagent task" with no agent identity on56+ * the wire. Classifying them as `dynamic_tool_call` renders them as generic57+ * tool rows, which is how a Cursor thread's delegated subagents became58+ * invisible to the timeline. Claude and Codex classify the same work as59+ * `collab_agent_tool_call`, so match them on every recognizable spelling.60+ */61+function isAcpTaskToolCall(toolCall: AcpToolCallState): boolean {62+ const rawInput = toolCall.data.rawInput;63+ if (64+ typeof rawInput === "object" &&65+ rawInput !== null &&66+ "_toolName" in rawInput &&67+ typeof rawInput._toolName === "string"68+ ) {69+ return rawInput._toolName.trim().toLowerCase() === "task";
juliusmarminge closed this
Sign in to join this conversation.


No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
536dcaa5-ff53-4974-aae4-f4fd22440249📥 Commits
Reviewing files that changed from the base of the PR and between d3a9d4343f9c93f7a21d436da3479fd1c53ceecd and b2fcb9d42dfcb1940668b1d730a41bd7c5f6f373.
📒 Files selected for processing (2)
apps/mobile/src/lib/threadActivity.test.tsapps/mobile/src/lib/threadActivity.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough#
ACP Task tool calls are classified as
collab_agent_tool_call. Mobile activity rendering maps these calls to theagenticon and failed entries to thealerticon. Tests cover ACP classification and mobile rendering.Changes#
ACP task activity handling
apps/server/src/provider/acp/AcpCoreRuntimeEvents.ts,apps/server/src/provider/acp/AcpCoreRuntimeEvents.test.tsTasktool name orTask:title now usecollab_agent_tool_call. Other tool calls retain their existing classifications. Tests cover mixed-input, MCP, and search variants.apps/mobile/src/lib/threadActivity.ts,apps/mobile/src/lib/threadActivity.test.tsalertbefore other icon checks. Collab-agent entries and entries with ataskIduseagentwhen they are not failed. Tests cover agent and failed task entries.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)#
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
b2fcbACP Task activity is classified and rendered with the intended agent and failure icons; no actionable merge-blocking risk remains.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.