ISSUE DESCRIPTION [Bug]: Cursor CLI agent stays in loading state after task completes…
- User
ISSUE DESCRIPTION
[Bug]: Cursor CLI agent stays in loading state after task completes
Operating system
macOS
Orca version
Unknown (please add from Orca > About Orca if available)
Details
Summary
When running a Cursor CLI agent session in Orca, the UI continues to show a loading/running state after the agent has finished its task — as if work is still in progress.
Steps to reproduce
- Start a Cursor CLI agent session in Orca.
- Give the agent a task and wait for it to complete (agent finishes and produces final output).
- Observe the session UI state.
Expected behavior
Once the Cursor CLI agent finishes, the session should transition to an idle/completed state — loading indicators should stop and the UI should reflect that no work is in progress.
Actual behavior
The session remains in a loading/running state after the task is done, giving the impression the agent is still working.
Environment
- macOS: darwin 25.4.0
- Agent: Cursor CLI
Additional notes
- Reproduces when the agent has clearly finished (final response delivered) but Orca does not update the activity/loading indicator accordingly.
- May cause confusion about whether it is safe to send a follow-up prompt or close the session.
Evaluation contract
When a synthetic-title agent reports a non-working state, reconcile the terminal title with that agent's synthetic title profile. For Cursor,
donereplaces spinner/working titles, the bareCursor Agenttitle, and stale permission titles withCursor ready;waitingorblockedusesCursor - action required. Preserve descriptive completed titles that are not classified as working or permission, and do not rewrite agents without a synthetic-title profile. Apply this resolver before storing agent-status snapshot titles.Interface
Type: Function Name: resolveAgentStatusTerminalTitle Path: src/renderer/src/lib/agent-status-terminal-title.ts Input: payload: Pick<ParsedAgentStatusPayload, 'agentType' | 'state'>, currentTitle: string | undefined Output: string | undefined Description: Reconciles hook-reported state with synthetic terminal-title profiles. For Cursor, done maps stale spinner, working, bare native, or permission titles to "Cursor ready"; waiting/blocked maps to "Cursor - action required". Descriptive completed titles and agents without a synthetic profile are preserved. The IPC status integration must call this resolver before storing the title.
ADDITIONAL ADVICE
- Assistant
I'll start by exploring the repository structure and locating the agent status / terminal title related code.
- Assistant
The target file is missing; I'll inspect related agent-status and title code next.
- Assistant
rg is not available, let me use grep instead.
- Assistant
Let me look at the synthetic title related files and agent status types more carefully.
- Assistant
Let me look at more related code - agent-title-decoration, agent detection, and how terminal titles work for cursor.
- Assistant
There's important synthetic-title logic in main — I'll inspect that and the agent-status store flow.
- Assistant
Let me look at how terminal titles are set when agent status is received in the renderer and the driveSyntheticTitleFromHook function.
- Assistant
I need to find where the renderer IPC path stores agent-status titles so the resolver can be wired in.
- Assistant
Let me look at useIpcEvents.ts where agentStatus is set, and also pty-connection for how title is used.
- Assistant
Let me understand the applyAgentStatus function more completely, especially where
titlecomes from. - Assistant
Next I'll check agent-detection and any existing terminal-title resolver stubs or tests.
- Assistant
I'll inspect agent-detection classification of Cursor titles and how terminalTitle drives load state.
- Assistant
There's a related note around line 2645 in useIpcEvents — I'll read that and the nearby agent-status title tests.
- Assistant
Let me review Cursor title classifications in the tests and the detection helpers.
- Assistant
Let me check if there are any related recent git commits or docs about this.
- Assistant
The related commit
8c6235cdlooks directly relevant — I'll inspect that change. - Assistant
I'll check the snapshot payload shape and how main stores status titles.
- Assistant
I'll find where
entry.terminalTitledrives loading/activity indicators. - Assistant
I have enough context to implement the resolver and wire it into the IPC path. Checking a few style details first.
- Assistant
I'll implement the resolver and call it from the IPC agent-status path before storing titles.
- Assistant
The create command didn't write the full file; I'll rewrite it correctly.
- Assistant
Now wiring the resolver into the IPC apply path, using the existing title as a fallback.
- Assistant
I'll add the import after the agent-status-identity import and update the setAgentStatus call.
- Assistant
Now update the setAgentStatus call site.
- Assistant
Need to navigate to that line first or use sed.
- Assistant
I notice existingStatus is resolved after statusPayload - good. Let me replace the setAgentStatus call.
- Assistant
Using the resolved identity agent type when reconciling titles for better correctness.
- Assistant
I'll run a quick temporary script to verify the resolver behavior.
- Assistant
Let me try tsx or put file in the projectבות temporarily.
- Assistant
All tests passed. Removing the temp test and double-checking OpenCode bare-title classification.
- Assistant
I'll clean up and verify the final diff.
- Assistant
Re-checking one edge case: for
donewith no title, should we still prefer the idle label when the agent has a synthetic profile? The contract only lists stale titles to replace. Implementation looks correct.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.