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 start by exploring the repository structure and understanding the codebase to resolve this issue.
Assistant
The issue mentions a file path
src/renderer/src/lib/agent-status-terminal-title.tsthat should contain a functionresolveAgentStatusTerminalTitle. Let me check if this file exists or needs to be created.Assistant
The file doesn't exist yet. Let me explore the existing agent-status files to understand the structure and what needs to be implemented.
Assistant
Now let me look at the store slice for agent-status to understand how titles are stored:
Assistant
Now let me look at the IPC integration where the title is stored, and also look for any existing tests related to terminal titles:
Assistant
Let me look for the IPC handler that stores agent status titles:
Assistant
Now let me look at the agent hooks server where status is stored:
Assistant
Now let me search for where the terminal title is stored and where the resolver should be called:
Assistant
Let me search for where terminalTitle gets set:
Assistant
Let me look at where the terminal title flows from PTY to agent status:
Assistant
Let me look at where the title is actually sent to the store:
Assistant
Now let me look at the main process
index.tsaround line 609 whereagentStatus:setis sent:Assistant
Now I see where the synthetic title profiles are used. Let me look at the
SYNTHETIC_TITLE_PROFILESand related code:Assistant
Now I need to understand where the terminal title is stored in the agent status IPC. Let me look at where the renderer receives the IPC and calls
setAgentStatus:Assistant
Now let me look at where the IPC
agentStatus:setevent is handled in the renderer - it should be in the preload or somewhere that listens to it:Assistant
Now let me find where the renderer actually processes the
agentStatus.onSetcallback and stores the title:Assistant
Continuing my investigation to find where the IPC agent status events are consumed and where the terminal title gets stored.
Assistant
Now let me find the
applyAgentStatusfunction that processes the IPC data:Assistant
Now I can see the key line at 2295:
store.setAgentStatus(data.paneKey, statusPayload, title, { ... }). Thetitlevariable comes fromresolvePaneKeywhich returns the current terminal title. According to the issue, we need a resolver functionresolveAgentStatusTerminalTitlethat reconciles the terminal title with the agent's synthetic title profile. Let me look at what exists and what tests might already cover this area:Assistant
Let me look at the resolvePaneKey function and understand where the title resolver should be integrated:
Assistant
Now I understand the architecture. Let me look at what the issue is asking for more carefully. The issue mentions:
- A new function
resolveAgentStatusTerminalTitleinsrc/renderer/src/lib/agent-status-terminal-title.ts - This function should reconcile terminal titles with agent state
- For Cursor:
donestate should replace spinner/working titles, bare "Cursor Agent" title, and stale permission titles with "Cursor ready" waitingorblockedshould use "Cursor - action required"- The IPC status integration must call this resolver before storing the title
Let me check the synthetic-title-spinner module to understand the spinner frames:
- A new function
Assistant
Now I have a clear picture. Let me look at the imports at the top of
useIpcEvents.tsto understand the module structure:Assistant
Now let me look at the specific area around line 2295 where
setAgentStatusis called with thetitleparameter, to understand exactly where the resolver should be called:Assistant
Now I have a complete understanding. I need to:
- Create the file
src/renderer/src/lib/agent-status-terminal-title.tswith theresolveAgentStatusTerminalTitlefunction - Call this resolver in
useIpcEvents.tsbefore storing the title viasetAgentStatus
According to the issue's evaluation contract:
- For Cursor agent:
- When state is
done: replace spinner/working titles, bare "Cursor Agent" title, and stale permission titles with "Cursor ready" - When state is
waitingorblocked: use "Cursor - action required"
- When state is
- Preserve descriptive completed titles that are not classified as working or permission
- Do not rewrite agents without a synthetic-title profile
Let me also check what titles would be classified as "spinner", "working", "permission" for Cursor:
- Create the file
Assistant
Now I have all the information needed. Let me create the resolver function and integrate it. Let me first check what the ParsedAgentStatusPayload looks like:
Assistant
Now let me create the new file
agent-status-terminal-title.ts:Assistant
Now I need to integrate this resolver into the IPC status handler in
useIpcEvents.ts. Let me update the file to import and call the resolver before storing the title:Assistant
I need to add the import for the new resolver and then modify the
setAgentStatuscall to use it:Assistant
I'll add the import after the agent-status-identity imports:
Assistant
Now I'll add the import for the resolver after line 55:
Assistant
Now let me verify the import was added correctly:
Assistant
Good. Now I need to modify the
setAgentStatuscall to use the resolver. The key line is around line 2296 (now shifted by 1 due to the import). Let me find it:Assistant
I need to modify line 2295 to use the resolver. Let me look at the context to understand exactly how to modify it.
Assistant
Now I need to replace the
titleargument with a call toresolveAgentStatusTerminalTitle. The resolver takes the payload (which contains agentType and state) and the currentTitle:Assistant
Let me verify the change:
Assistant
The change looks correct. Now let me write a test file to verify the resolver function works correctly:
Assistant
Let me run the tests to see if they pass:
Assistant
The tests show that some braille spinner characters are missing from my set. The character
⠙(U+2819) is not in my set. Let me check the actual spinner frames used and fix the set:Assistant
I need to debug why the braille spinner detection isn't working for certain frames. Let me check if my Set construction is correct by examining the Unicode code points more carefully.
Assistant
The character
⠙is U+2819, but I only included\u2804through\u283Ein my set and skipped\u2819. Let me look at the actual spinner frames used in the codebase:Assistant
I see the issue - I missed several braille characters. Let me simplify the approach by using a character range instead, since all braille patterns are in U+2800 to U+28FF:
Assistant
Let me run the tests again to see if the fix works:
Assistant
All 24 tests pass. Now let me run the existing tests related to agent-status to make sure my changes don't break anything:
Assistant
This test failure is unrelated to my changes - it's a missing package issue. Let me run the agent-status tests in the store slices to check:
Assistant
These test failures are pre-existing environment issues with missing packages, not related to my changes. Let me run the IPC-related tests to verify my integration:
Assistant
The test failures are pre-existing environment issues unrelated to my changes. Let me verify my changes compile correctly by checking if there are any TypeScript errors:
Assistant
Good, no TypeScript errors. Let me also verify my integration into useIpcEvents.ts by checking for any TypeScript issues there:
Assistant
The errors are all from node_modules, not from my code. This is a pre-existing environment issue. Let me verify that my specific files don't have TypeScript errors by filtering:
Assistant
These are all
@/alias resolution issues from the TypeScript standalone check - they're all pre-existing issues with running tsc without the full project config. The error on line 56 about my new import is just the alias resolution failing too. Let me verify the file content is correct by looking at the actual code changes:Assistant
_commands>
Assistant
Perfect. Let me verify my solution once more by reviewing the complete implementation:
Assistant
<tool_call> <function=bash_terminal> <parameter=command> sed -n '2288,2310p' /orca/src/renderer/src/hooks/useIpcEvents.ts </tool_call>
Assistant
I need to run a bash command to view the modified section of useIpcEvents.ts.
Assistant
Let me run my tests one final time to confirm everything is working:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.