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
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /orca, current file: none) bash-$
Assistant
Let me start by exploring the repository structure to understand the codebase.
Assistant
The file doesn't exist yet. Let me explore the repository structure to understand the codebase and find related files.
Assistant
I need to make single tool calls. Let me explore the structure first.
Assistant
Let me look at the IPC status integration and how terminalTitle is stored.
Assistant
Now let me look at the store slice where terminalTitle is stored, to understand the full flow.
Assistant
Let me look at how the terminalTitle flows from IPC to the store, and look for any existing synthetic title profiles.
Assistant
Now let me understand where the agent-status snapshot title is stored. The issue says: "The IPC status integration must call this resolver before storing the title." Let me find where the terminalTitle is set in the IPC status integration (the main process or renderer side).
Let me look at the main process server.ts and where status is stored/sent.
Assistant
Let me understand the full flow. The terminalTitle on the AgentStatusEntry comes from the renderer side, in the store slice. Let me trace where the renderer gets the terminalTitle and stores it.
The store's
setAgentStatustakes aterminalTitleparam. Let me find the call site in useIpcEvents.ts where the agentStatus:set IPC is handled.Assistant
Now let me look at where
titleis determined in this function. Let me see the broader context of this handler.Assistant
Let me look at the agent-detection.ts to understand how titles are classified.
Assistant
Let me check whether SYNTHETIC_TITLE_PROFILES is shared/exported and look at related test files for the existing patterns.
Assistant
Let me check if there's already a test file for this function and look at how other agent-status lib files are tested.
Assistant
Let me look at the agent-detection.ts exports and helper functions.
Assistant
Now let me look at the
containsBrailleSpinnerandcontainsAnyhelper functions to understand how to classify titles.Assistant
Now I have a good understanding. Let me look at the rest of the detectAgentStatusFromTitle function to fully understand the classification, especially the cursor-specific handling.
Assistant
Now I have a clear understanding. Let me look at the imports in useIpcEvents.ts to understand what's already imported.
Assistant
Let me check the test setup and run a sample test to understand the runner.
Assistant
Now let me create the
agent-status-terminal-title.tsfile.Assistant
Now let me wire the resolver into the IPC status integration. Let me look at the exact lines again.
Assistant
Now let me add the import and modify the
setAgentStatuscall to use the resolver.Assistant
The replace tool needs the lines visible. Let me use sed for precise editing.
Assistant
Now let me modify the
setAgentStatuscall to reconcile the title.Assistant
Now let me create a temporary test to verify the function's behavior.
Assistant
All 16 tests pass. Now let me remove the temporary test file and verify the existing tests still pass.
Assistant
Now let me run the existing tests related to agent-status and useIpcEvents to ensure I didn't break anything.
Assistant
Let me check for tests related to useIpcEvents and the store slice.
Assistant
Now let me run the store agent-status tests and related snapshot tests to ensure nothing breaks.
Assistant
Let me run a broader set of tests that involve terminalTitle to make sure nothing breaks.
Assistant
All pass. Now let me verify the type-checking of the new file to ensure imports are correct. Let me run a tsc check on the renderer.
Assistant
Typecheck passes. Let me run the linter on the new/modified files.
Assistant
Let me review the final diff.
Assistant
Let me check if there are other callers of
setAgentStatusthat store a terminalTitle and should also use the resolver.Assistant
Let me examine the pty-connection.ts callers to understand whether they're part of the IPC integration or a separate OSC fallback path.
Assistant
These pty-connection.ts callers are specific to command-code and initial agent status seeding — not the synthetic-title agents (cursor/opencode/droid/hermes). The line 1154 is the OSC-fallback path. Let me look at it.
Assistant
The
onAgentStatusat line 1154 is the OSC 9999 in-PTY path, which synthetic-title agents (Cursor/OpenCode/Droid/Hermes) don't use — they report via the HTTP hook server →agentStatus:setIPC channel that I've already handled. The contract specifically targets "the IPC status integration," so my change is correctly placed.Let me do a final review of the new file and run the orca-runtime Cursor title test (main process, untouched) plus a broader hook test to confirm nothing is affected.
Assistant
Let me run a final broader test to confirm everything is consistent, including the agent-hook-completion-notifications and pty-connection tests.
Assistant
All tests pass. Let me verify the final state of changes and confirm no temp files remain.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →