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
Now let's create the new file.
Assistant
Now let's wire this into useIpcEvents.ts before calling
store.setAgentStatus.Assistant
Let's add the import right after the
parsePaneKeyimport line (line 74) for locality, and edit the setAgentStatus call.Assistant
Let's use the
replacespecial command instead.Assistant
Now update the setAgentStatus call site.
Assistant
Looks identical. Let's try
editcommand directly with line numbers instead.Assistant
Now let's check TypeScript compiles for this file / build.
Assistant
It seems the background process got killed when the parent shell command finished (since it was run with
&inside a subshell of a command that returned). Let's run it directly in background properly using setsid/disown.Assistant
Typecheck passes (exit 0). Now let's run relevant vitest tests.
Assistant
Now let's write a quick temporary test script to sanity-check
resolveAgentStatusTerminalTitlebehavior directly, then remove it.Assistant
All pass. Let's remove the temp test file now and run broader related test suites (agent-status store tests, useIpcEvents related tests if any).
Assistant
All existing tests pass. Now let's run the full test suite for the whole repo briefly to see if broader breakage (limiting to a reasonable time), or at least lint the new file.
Assistant
Now let's run the full renderer test suite to check for regressions broadly (time permitting), focusing on agent-related and terminal-pane tests.
Assistant
All 646 renderer test files pass (5186 tests). Now let's review the final diff.
Assistant
Good,
agentTypeis optionalAgentType | undefined, matching ourpayload.agentType ?? ''handling. Now let's double check the docs/comments referencing this feature don't need updates, and check if there's a docs file listing synthetic title profiles that should mention this fix.Assistant
No docs reference it. Let's view the final new file content once more for review.
Assistant
This resolves the issue cleanly. Let's also check the "opencode" workingLabel case —
detectAgentStatusFromTitle('OpenCode')— does bare "OpenCode" get classified as working via substring match (containing "opencode")? Let's verify no false positive causingisStaleWorkingTitlemislabeling for opencode's bare native title too (shouldn't matter since both conditions map to idleLabel anyway). That's fine either way.Now let's check the AgentType type more carefully to ensure
payload.agentTypeindexing type-checks (string | undefined coerced with?? '').Assistant
Typecheck passes cleanly. Let's also run oxlint across the whole repo to be safe (fast).
Assistant
Everything checks out. Let's do a final review of the git diff/status.
Assistant
Assistant
The implementation satisfies the interface contract exactly as specified:
- 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✓ - Behavior: For Cursor,
donemaps stale spinner/working, bare native, or permission titles to"Cursor ready";waiting/blockedmaps to"Cursor - action required"; descriptive completed titles and agents without a synthetic profile are preserved; wired into the IPC status integration (useIpcEvents.ts) beforestore.setAgentStatusstores the title. ✓
I'm confident this resolves the reported issue. Submitting now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.