Untitled conversation
- User
[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
Now let me look at how
terminalTitleis consumed and howresolvePaneKeyproduces the title: - Assistant
Now let me check the main/index.ts region around the profile definition and its imports, plus how
pty-connection.ts(the OSC fallback path) stores titles: - Assistant
Now update
main/index.tsto import from the shared module: - Assistant
Now the resolver itself:
- Assistant
Now wire it into the IPC status integration in
useIpcEvents.ts: - Assistant
Now the tests:
- Assistant
All 15 pass. Now run the related existing suites and typecheck:
- Assistant
All 51 pass. Re-run typecheck and lint since the test file changed after the last check:
- Assistant
All checks pass. Here's a summary of the fix:
Root cause
For synthetic-title agents (Cursor, OpenCode, Droid, Hermes), Orca's main process synthesizes OSC title frames from hook events because these agents' native titles carry no working/idle signal — cursor-agent re-emits a bare all turn while Orca injects spinner frames. The hook's event and the synthesized title travel on : the status IPC () lands in the renderer immediately, while the injected idle title still has to round-trip through the PTY data stream and xterm's title parser. So when the event snapshots the pane title into the agent-status entry ( → ), it captures the stale spinner frame — which classifies as — leaving the session UI in a loading state after the agent finished.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.