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
Let me start by understanding the repository structure and the issue. The issue is about a Cursor CLI agent staying in loading state after a task completes. The fix involves implementing a function
resolveAgentStatusTerminalTitleinsrc/renderer/src/lib/agent-status-terminal-title.ts.Let me first explore the repository structure and find the relevant files.
Assistant
Let me look for the specific file mentioned in the issue:
src/renderer/src/lib/agent-status-terminal-title.tsAssistant
The file doesn't exist yet. Let me look at the directory structure to understand the code
Assistant
Let me look at related files to understand the codebase patterns, especially around agent status and terminal
Assistant
Let me try opening with the correct parameter name.
Assistant
Let me read the relevant files directly
Assistant
Let me look at the shared types and agent detection module:
Assistant
Let me look at the shared types and agent-detection module.
Assistant
Now let me look at the agent-detection.ts to understand
detectAgentStatusFromTitle:Assistant
Now let me search for any existing references to
resolveAgentStatusTerminalTitleoragent-status-terminal-titleAssistant
Let me search for references to the filename pattern
Assistant
Let me look at
agent-status-identity.tsand the store slice for agent-status:Assistant
Now let me look at the store slice for agent-status:
Assistant
Let me look at the useIpcEvents hook:
Assistant
Now let me look for where
setAgentStatusis called andterminalTitleis handledAssistant
Let me look at the terminal-pane lifecycle hook:
Assistant
Let me look for where
setAgentStatusis called withterminalTitle:Assistant
Let me see the context around line 2294:
Assistant
Now let me understand how terminalTitle flows. Let me check the
setAgentStatusimplementation to see howterminalTitleis used inAssistant
Let me search for how Cursor synthetic titles are set:
Assistant
Let me look at the Cursor title profile in
src/main/index.ts:Assistant
Let me look at more of the synthetic title logic in main/index
Assistant
Let me look at the agent-hook-listener.ts to find how Cursor hook events handle title synthesis:
Assistant
Let me search for
sendSyntheticTitle:Assistant
Let me look at the synthetic title dispatch logic in main/index
Assistant
Let me look at the full applyAgentStatus function in useIpcEvents
Assistant
Now let me look at how the
containsBrailleSpinnerand working keyword detection works in agent-detection.ts (which isAssistant
Let me look at the existing test for agent-status to understand patterns
Assistant
Let me check what's exported from agent-detection.ts:
Assistant
Now I have enough context. Let me create the
resolveAgentStatusTerminalTitlefunction and integrate it. First, let me createAssistant
Now let me integrate the resolver in
useIpcEvents.ts. First let me find the exact lines to editAssistant
Let me find the import section of useIpcEvents.ts
Assistant
Now let me add the import and integrate the resolver. First, let me add the import:
Assistant
Let me see the exact lines around the import for agent-status-identity:
Assistant
Now let me add the import for
resolveAgentStatusTerminalTitle:Assistant
Let me verify the import was added correctly
Assistant
Now let me modify the
setAgentStatuscall to use the resolver:Assistant
Now let me edit the line to resolve the title before passing it to setAgentStatus:
Assistant
Let me verify the change:
Assistant
Let me check that TypeScript compiles correctly by running the build or typecheck
Assistant
Let me run a more focused typecheck:
Assistant
Good, TypeScript compilation passes. Let me now create a temporary script to verify the function works
Assistant
All tests pass. Let me now run the existing test suite for the affected modules
Assistant
The test failure is pre-existing (path resolution issue), unrelated to my changes. Let me verify by running the shared tests
Assistant
Let me check whether the test infrastructure works
Assistant
Good, tests pass. Let me now clean up the temp test file and do a final check on my changes:
Assistant
Let me do a final review of all changes:
Assistant
Let me see the new file
Assistant
Let me do a final TypeScript check to make sure everything compiles:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.