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.
- Assistant
I'll explore the repository structure and locate the agent status terminal title handling described in the issue.
- Assistant
The terminal-title resolver file is missing; I'll inspect related agent-status code and tests next.
- Assistant
Let me look at agent-title-decoration and agent-status related code for synthetic titles and Cursor.
- Assistant
Let me search more specifically for cursor agent status and how terminal titles are handled in the agent status store.
- Assistant
The search for terminalTitle returned empty which is strange. Let me try again differently.
- Assistant
There's already synthetic-title logic in the main process; I'll read those profiles and the renderer's status snapshot path.
- Assistant
Let me look at the agent status store/slice to see how titles are set when receiving IPC, and also look at agent-status.ts for detection.
- Assistant
Let me find where agent status IPC is received and terminal title is stored, and look at how title detection works.
- Assistant
I'll inspect the IPC event handler where agent status titles get applied.
- Assistant
So the issue is that when Cursor finishes, the terminal title still shows a spinner/working title, and the agent status stays looking like loading. The evaluation contract wants a resolver that reconc...
- Assistant
There's a recent commit about stale terminal status; I'll inspect title detection and any incomplete resolver work.
- Assistant
Let me inspect title classification and how synthetic titles are driven from hooks.
- Assistant
I'll check existing tests and
detectAgentStatusFromTitleso the resolver can classify spinning/working/permission titles correctly. - Assistant
I'll review the rest of title detection and the setAgentStatus call path in more detail.
- Assistant
I'll inspect how UI consumes
terminalTitlefor loading and whether the profiles are shared anywhere. - Assistant
I'll inspect how the terminal pane chooses between status and live titles.
- Assistant
I'll check how dashboard and sidebar interpret a done entry that still carries a working title.
- Assistant
I have enough context to implement the resolver and wire it into the IPC status path.
- Assistant
Creating the resolver module and wiring it into the IPC path.
- Assistant
The file looks empty — I'll rewrite it properly.
- Assistant
There might have been issues with bang history expansion. Let me read the file.
- Assistant
Bash history expansion corrupted the conditionals — I'll repair the file.
- Assistant
Wiring the resolver into the IPC
applyAgentStatuspath next. - Assistant
No python3 - try node instead.
- Assistant
I'll verify the IPC wiring and run a quick temp script to exercise the resolver.
- Assistant
I'll exercise the resolver with a temporary tsx script (no repo tests).
- Assistant
Descriptive and bare-title cases look good. Next I'll scan how status rows use
terminalTitleand run related unit tests. - Assistant
Vitest timed out earlier; I'll rerun the targeted suite with a longer window.
- Assistant
Vitest seems stuck at startup — I'll check the test setup path.
- Assistant
Corepack was prompting for input — I'll invoke the local vitest binary instead.
- Assistant
I'll run the agent-status unit tests with the local vitest binary.
- Assistant
Quick check of the final diff and whether the new file is complete.
- Assistant
I need to confirm how
submittreats new untracked files so the resolver isn't dropped. - Assistant
I'll use
git add -Nso the new file shows up in unstagedgit difffor submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.