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 at hand. The issue is about a Cursor CLI agent that stays in a loading state after task completes in Orca. The fix needs to be in
src/renderer/src/lib/agent-status-terminal-title.ts.Let me first explore the repository structure and find the relevant file.
Assistant
Let me try one command at a time.
Assistant
No results found. Let me explore the directory structure more carefully
Assistant
Let me explore the src directory structure.
Assistant
Let me search for the specific file mentioned in the issue.
Assistant
Let me look for terminal-title related files and also look at the existing agent-status lib files
Assistant
The file
agent-status-terminal-title.tsdoesn't exist yet — I need to create it. Let me first understand the codebase by reading the relatedAssistant
Now let me understand the shared types and agent detection:
Assistant
Now let me look at the shared agent-detection module:
Assistant
Now let me look at the agent-status test file and also check how the agent status store slice works
Assistant
Now let me look at the store slice for agent status to understand the data
Assistant
Let me also check the agent-status-identity and see if there's any existing references to the function I need to implement:
Assistant
Let me search for any existing references to resolveAgentStatusTerminalTitle and also look at the agent-status-identity file.
Assistant
No references exist yet — I need to create the file. Let me check the agent-status-identity and look for how terminal titles are set:
Assistant
Now let me look at how terminalTitle flows through the code - specifically the OSC handler:
Assistant
Let me search for how the Cursor agent's terminal title is set and how setAgentStatus is called:
Assistant
Let me look at where the IPC status integration stores terminalTitle, particularly for Cursor:
Assistant
Let me look at the Cursor title synthesis in main/index.ts:
Assistant
Let me see more of the synthesis logic:
Assistant
Let me find the driveSyntheticTitleFromHook function:
Assistant
Let me see the driveSyntheticTitleFromHook function:
Assistant
Now let me look at the Cursor hook normalization test to understand the expected behavior better:
Assistant
Now I have a thorough understanding of the codebase. Let me check if there's a test file for this function already:
Assistant
Let me look at the terminal-title-contrast file for style reference:
Assistant
Let me search for where setAgentStatus is called in the renderer with terminalTitle to understand the integration:
Assistant
Let me look at the pty-connection.ts around lines 768 and 1148-1160:
Assistant
Let me look at the IPC handler around line 1148-1160:
Assistant
Now I have a thorough understanding. Let me create the
agent-status-terminal-title.tsfile. Let me first check the existing code to understand the import paths:Assistant
Now let me create the
agent-status-terminal-title.tsfile. Let me first look at how patterns are detected for working titles to make sure my implementation is consistent:Assistant
Now I have all the context I need. Let me create the
agent-status-terminal-title.tsfile:Assistant
Now I need to integrate this resolver into the IPC status integration. Let me check if there's already a test file and also look at where it needs to be called:
Assistant
Good, only my file references it. Now let me integrate it into the IPC status integration. Let me look at the pty-connection.ts imports and the relevant call site:
Assistant
Let me find all the setAgentStatus calls in pty-connection.ts with context:
Assistant
Let me look at each call site:
Assistant
Let me look at the setAgentStatus function in the store slice to see how terminalTitle is stored:
Assistant
Let me look at the setAgentStatus function around lines 203-295:
Assistant
Now I need to integrate the resolver into the store slice's
setAgentStatus. Let me add the import and apply the resolver:Assistant
Now let me add the import and modify the setAgentStatus function to use the resolver:
Assistant
Now let me apply the resolver in the setAgentStatus function, right after
effectiveTitleis computed:Assistant
Now let me apply the resolver after the effectiveTitle is computed:
Assistant
I see a duplicate line. Let me fix that:
Assistant
I need to remove the duplicate line and update the stored title to use finalTitle. Let me fix this:
Assistant
Now I need to update the stored title from
effectiveTitletofinalTitle:Assistant
Now let me run the tests to verify everything compiles and existing tests still pass:
Assistant
The test runner has module resolution issues with aliases. Let me try TypeScript compilation to verify my code:
Assistant
No TypeScript errors. Let me verify the final state of both files:
Assistant
Let me verify the changes to agent-status.ts store slice:
Assistant
Let me verify the complete diff of my changes:
Assistant
Let me also make sure the new file is tracked in the diff:
Assistant
The implementation looks good. Let me do a final review of the new file and verify everything is consistent:
Assistant
TypeScript compilation passes. Let me verify the complete file one more time to make sure everything
Assistant
All changes are complete. Let me verify the full diff one final time before
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.