Repository navigation
Conversation
Cursor reports each subagent as a tool named task. Project that lifecycle onto task.* so the roster and background liveness can see it. Co-authored-by: Cursor <cursoragent@cursor.com>
| title, | ||
| ...(role ? { role } : {}), | ||
| }; | ||
| input.tasks.set(input.toolCall.toolCallId, { title, ...(role ? { role } : {}), phase }); |
There was a problem hiding this comment.
🟡 Medium acp/CursorSubagents.ts:89
Terminal tasks remain in input.tasks for the lifetime of the session, so every completed or failed Cursor Task permanently retains its title and role and ctx.subagents grows without bound as subagents accumulate. Evict terminal entries after suppressing duplicate updates, while preserving any separate deduplication state needed for late tool-call updates.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/acp/CursorSubagents.ts around line 89:
Terminal tasks remain in `input.tasks` for the lifetime of the session, so every completed or failed Cursor Task permanently retains its title and role and `ctx.subagents` grows without bound as subagents accumulate. Evict terminal entries after suppressing duplicate updates, while preserving any separate deduplication state needed for late tool-call updates.
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — This is a focused Cursor adapter bug fix that maps existing Task tool lifecycles into the established Agents-panel event stream, with localized production changes and unit coverage. An unresolved Medium finding notes that terminal task records remain retained for the session lifetime, creating a bounded memory-retention risk that should be addressed separately. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughCursor task tool calls now produce lifecycle events for start, progress, and completion. The Cursor adapter tracks subagent state per session and publishes projected events with provider, thread, turn, and timestamp data. ChangesCursor subagent task events
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant ACP
participant CursorAdapterLive
participant cursorSubagentTaskEvents
participant RuntimeEventStream
ACP->>CursorAdapterLive: tool-call update
CursorAdapterLive->>cursorSubagentTaskEvents: project task events
cursorSubagentTaskEvents-->>CursorAdapterLive: task lifecycle events
CursorAdapterLive->>RuntimeEventStream: publish stamped events
Merge Risk: ⚪ Minimal · up to No actionable issue is established for the Cursor subagent lifecycle change; it is ready for normal merge checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new task tracking is limited to a Cursor session and does not appear to grant an agent new execution authority. One lifecycle identity edge case could cause a later task to be missed; provider ID guarantees and interruption behavior remain unverified. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
One useful follow-up connection: this Generic ACP V2 already covers OMP's model/config discovery, modes/plan, permissions, commands, usage, MCP, resume/load, attachments, and rollback-by-new-session. What it does not generically express is “this ordinary ACP tool call represents a subagent.” #9038 had an OMP-specific parser for its No need to widen this Cursor fix. But after this lands, it may be worth extracting the event-projection shape into a small ACP helper/hook so Cursor, OMP, and future ACP agents can supply only their tool-identity/parser logic instead of rebuilding Agents-panel lifecycle projection per provider. |
|
Note This comment is posted by Julius' dot #14006 shows a Task call reporting |
|
Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition. This change touches CursorAdapter.ts, which the V2 merge removed. Cursor now runs through the SDK-based CursorAdapterV2 instead of the V1 ACP adapter. Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved. |
Summary
rawInput._toolName === "task", titleTask: …). Those calls were stored asdynamic_tool_callitems, so the Agents panel stayed empty.task.started/task.progress/task.completedwithtaskType: "local_agent". Existing ingestion stampsagentKind: "agent", which fills the Agents roster and keeps the thread working until the task finishes.subagentTypebecomes the row role. The object form Cursor sends when the type is unspecified ({unspecified: {}}) is ignored.Closes #14006
Closes discussions
Not in this change
Child tool calls inside the subagent are not tagged with a parent id on the ACP wire, so they still appear on the parent transcript. Nested sidebar threads stay Codex-only.
Test plan
vp test run src/provider/acp/CursorSubagents.test.tsMade with Cursor
Summary by CodeRabbit