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
Now let's look at
store.setAgentStatusin the agent-status slice, to see howterminalTitlegets stored.Assistant
Need to place the probe test under src/. Let's put it in src/shared temporarily.
Assistant
Good, lowercase 'cursor' is used consistently, matches SYNTHETIC_TITLE_PROFILES keys. Now let's create the new file.
Assistant
Now let's wire this into
useIpcEvents.tsbeforestore.setAgentStatuscall.Assistant
All pass. Now let's remove the temp test and run existing related tests.
Assistant
All existing relevant tests pass, including
useIpcEvents.test.ts. Now let's check the diff.Assistant
They use
oxlint, not eslint. Let's run that instead.Assistant
Clean. Now let's run the full oxlint over the whole repo quickly for a sanity check, and try a scoped typecheck limited to these two files if possible using
tsc --noEmitdirectly rather than tsgo full project (to speed up). Let's check tsconfig for renderer.Assistant
No errors reported — typecheck passed cleanly.
Assistant
Clean typecheck. Now let's view the final diff and the new file content once more for review.
Assistant
This looks solid. Let's now run the broader renderer test suite briefly to catch any regression (at least a good chunk related to terminal-pane and store).
Assistant
All 354 test files / 3526 tests pass. Let's double-check that git status reflects only intended changes and clean up any leftovers.
Assistant
Clean. Now let's go through the checklist explicitly.
Assistant
Checklist review:
- Reproduced the reported error: The issue is a UX bug (stale loading state) without a crash/exception to reproduce via stack trace. I traced the actual mechanism (main process synthesizes OSC titles for Cursor via
driveSyntheticTitleFromHook, which the renderer'suseIpcEventscaches ontoAgentStatusEntry.terminalTitle) and identified the race/staleness window described in the evaluation contract. I verified the before behavior conceptually (the old code passed the raw, possibly-staletitlestraight tostore.setAgentStatuswith no reconciliation against the hook-reported state) and confirmed with targeted unit tests that, prior to my change, no such reconciliation function existed at all. - Confirmed the fix resolves it: I wrote temporary tests exercising
resolveAgentStatusTerminalTitlefor all the contract's cases (stale spinner/working title, bare native title, stale permission title, waiting/blocked, descriptive completed titles, agents without a profile, undefined title) — all passed — then wired the resolver intouseIpcEvents.tsright beforestore.setAgentStatus, so adonehook event now always reconciles a lagging Cursor title to"Cursor ready"instead of leaving a stale working/permission title cached. - Edge cases: undefined
currentTitle, agents without a synthetic profile (returned unchanged),workingstate left untouched (spinner mechanism owns it), descriptive completed titles preserved, waiting/blocked always forced to the permission label, and case-insensitive/trimmed matching for the bare native title. - Existing tests: Ran the full relevant suites (
store,hooks,lib,components/terminal-pane,shared) — 354 files / 3526 tests all passed — plusoxlint(0 warnings/errors) and the project'stsgoweb typecheck (clean, no errors). Temporary test file was removed before submission per instructions.
- Reproduced the reported error: The issue is a UX bug (stale loading state) without a crash/exception to reproduce via stack trace. I traced the actual mechanism (main process synthesizes OSC titles for Cursor via
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 →
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 →