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
I’ll inspect the repository structure and locate the existing agent-status parsing, terminal-title profiles, and IPC snapshot integration. Then I’ll reproduce the stale-title behavior with the project’s existing test tooling or a temporary script before implementing the resolver.
- Assistant
The requested resolver file does not yet exist. I’ll now trace
ParsedAgentStatusPayload, title classification/profile logic, and where status snapshots are written so the new function reuses established conventions rather than duplicating incompatible matching rules. - Assistant
rgis unavailable in this environment, so I’ll use recursivegrepto perform the same code search. - Assistant
The IPC bridge in
useIpcEvents.tsappears to be the snapshot write path, whilelib/agent-status.tsowns title heuristics andpty-transport.tsdocuments Cursor’s synthetic title behavior. I’ll inspect those exact sections and the shared status-state definitions. - Assistant
The existing PTY filter only prevents native
Cursor Agentredraws from overwriting synthetic frames; it cannot repair an already-stale spinner or permission title when a hook status is applied directly through IPC. I’ll inspectapplyAgentStatusin full and shared title classifiers to identify the precise title categories required by the evaluation contract. - Assistant
The contract requires a narrower concept than general
detectAgentStatusFromTitle: only agents with a synthetic-title profile should be rewritten, and descriptive completed titles must survive. I’ll inspect exact Cursor detection and any centralized synthetic-title profile definitions (likely main-process generation) before designing the renderer resolver. - Assistant
A centralized main-process profile confirms Cursor is currently the relevant synthetic-title agent. I’ll inspect that profile and generation semantics, then add the renderer-side pure resolver at the specified path and wire it immediately before
setAgentStatus, using the resolved hook payload’s agent identity. - Assistant
The main process defines four synthetic-title profiles (
cursor,opencode,droid,hermes). I’ll mirror those profile labels in the renderer resolver so agents truly lacking a profile remain untouched. For non-working states: blocked/waiting will always use the profile’s action-required title; done will replace only the profile’s bare native title or titles classified as working/permission, preserving undefined, idle, and descriptive completed titles. Then I’ll invoke it with the identity-resolved payload immediately before snapshot storage. - Assistant
The resolver file is now created. The environment lacks Python, so I’ll use the repository’s
editutility to add the import and integration. I’ll pass the identity resolver’s finalagentType(not merely the raw hook value), ensuring same-pane status updates still reconcile correctly when a hook omits its agent type. - Assistant
The line insertion landed inside a multiline import and malformed it. I’ll correct that import block explicitly, then replace the storage call with a resolved title variable.
- Assistant
The second line-range edit was offset after the import correction and accidentally replaced the closing brace of the suppression guard while leaving an extra
}). I’ll repair the entire guard-and-store block atomically, then inspect syntax and include untracked-file status. - Assistant
The integration block is repaired and
git diff --checkis clean. I’ll format the two changed files, run the web typechecker, and run the focused renderer tests covering title classification and IPC status snapshot application. After that I’ll directly exercise the resolver’s required edge cases with a temporary script outside the repository if the installed tooling supports it. - Assistant
pnpminvoked Corepack and blocked on an interactive download prompt, which this environment cannot answer. Dependencies are already installed, so I’ll bypass Corepack and invoke the local project binaries directly for formatting, typechecking, and tests. - Assistant
Formatting, web typechecking, and 146 focused tests passed. One integration edge case remains: when pane layout metadata temporarily has no title, the slice falls back to the prior snapshot title. If that prior title is a stale Cursor spinner, resolving only
undefinedwould preserve the bug. I’ll therefore reconciletitle ?? existingStatus?.terminalTitle, matching the slice’s own fallback semantics, then bundle and directly execute the resolver against the contract cases. - Assistant
The direct contract harness passed all 10 cases, including stale spinner/working/native/permission titles, descriptive completion preservation, action-required states, undefined titles, working-state no-op, and an unprofiled Claude title. I’ll now run final lint/typecheck plus the focused IPC/title tests after the fallback adjustment, inspect the complete new file and repository status, and verify no test files were changed.
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 →