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 logic described in the issue.
- Assistant
I'll inspect the agent-status and terminal-title related code next.
- Assistant
rg is not available, let me use grep instead.
- Assistant
Looking at the synthetic title profiles and where agent status titles are stored.
- Assistant
Let me look at more of the agent-status slice - setAgentStatus specifically - and how terminal titles are integrated.
- Assistant
Let me look for where agent status IPC integrates and titles are set. Also the synthetic title spinner code.
- Assistant
There's key logic in useIpcEvents and the main process for synthetic titles when agent status changes — letting me inspect those.
- Assistant
Let me inspect agent-status classification helpers and any existing references to this resolver.
- Assistant
I'll check how terminal titles drive the loading UI and review the agent-detection helpers.
- Assistant
Let me look at more about how agent status title is used for loading indicators, and if there's already any incomplete work or TODO for this.
- Assistant
Based on the evaluation contract, I need to:
- Assistant
I'll search for any shared profile definitions and inspect how useIpcEvents stores titles.
- Assistant
Checking other setAgentStatus call sites and whether snapshots need the same resolution.
- Assistant
I'll check how terminalTitle affects the loading/working display when state is done.
- Assistant
Confirming bare OpenCode title handling, then implementing the resolver.
- Assistant
Inspecting identity resolution so I use the correct agentType in the resolver.
- Assistant
Let me see the rest of useIpcEvents imports for agent status related ones.
- Assistant
Need more imports - let's find where agent status normalize is imported
- Assistant
Now I'll implement the file and wire it up. I should also check ifoconditionallybuiltinusingdetectAgentStatusFromTitle from shared.
- Assistant
I'll write the full file content.
- Assistant
Returning idle when the title is undefined clears a previously stored spinner on done — that's the right fix. Wiring the resolver into the IPC path next.
- Assistant
Now update the setAgentStatus call to use the resolver.
- Assistant
Need to open/goto the right place first.
- Assistant
Hmm the replace failed because the string wasn't in the displayed lines before? Let me try again now that we're at the right place.
- Assistant
Writing a temporary script to verify the resolver behavior against the contract.
- Assistant
I'll check vitest config for path aliases, then run a temporary verification test.
- Assistant
Creating and running a temporary test, then removing it.
- Assistant
All tests passed. Removing the temp file and running related existing tests.
- Assistant
I'll quickly confirm style matches nearby files and the final diff looks right.
- Assistant
Noting the new file may be untracked — checking whether
submitwill pick it up. - Assistant
Staging the new file so submit includes it.
- Assistant
Using intent-to-add so the new file appears in
git 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.