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
I’ll inspect the repository structure and existing agent-status/title handling, then reproduce the stale-title behavior through the relevant tests or a small temporary script before implementing the resolver and wiring it into IPC storage.
- Assistant
The requested resolver file does not yet exist. I’ll now inspect the shared payload types, synthetic-title profiles/classifiers, and the exact IPC status callback that writes snapshots so the implementation reuses established title semantics rather than duplicating ad hoc matching.
- Assistant
The integration point is
onAgentStatusinpty-connection.ts, where the current runtime title is passed directly intosetAgentStatus. I’ll locate the centralized agent profile/title classification APIs and inspect slice behavior and nearby tests to determine expected casing, matching rules, and whether only this IPC callback (not inferred/local statuses) should be changed. - Assistant
The shared detector already defines Cursor’s native, spinner, idle, and permission title behavior, so the new resolver should delegate classification to that API while adding only profile ownership and state-to-synthetic-title reconciliation. I’ll inspect its exports and profile metadata, plus the snapshot/push ingestion path to ensure the resolver is applied before every IPC-backed status snapshot is stored.
- Assistant
There are two IPC ingestion locations: the global
useIpcEventssnapshot/push path and the PTY transport callback. The evaluation contract specifically says to apply reconciliation before storing agent-status snapshot titles, so I’ll inspect both flows and main’s synthetic title profile definitions, then implement the pure function at the specified path and call it at all hook-reported storage boundaries where a current title is captured. - Assistant
Cursor is currently the only profile implicated by the contract, although main has other synthetic profiles. The resolver must not rewrite those other agents, so I’ll keep renderer profile support deliberately scoped to Cursor. I’ll inspect title selection in
applyAgentStatusand imports, then create a temporary focused test script/test invocation to demonstrate that adoneCursor payload currently stores a stale spinner title unchanged. - Assistant
The bug is reproducible from the current code path:
applyAgentStatuspassestitleunchanged, andsetAgentStatusassigns it directly asterminalTitle; thus{agentType:'cursor', state:'done'}plus⠋ Cursor Agentremains working-looking. Before coding, I’ll confirm agent type normalization and title classifier edge cases (whitespace/case, descriptive titles containing “Cursor”) so the resolver preserves descriptive completed titles exactly as required. - Assistant
The matching rules are now clear:
blocked/waitingfor Cursor always resolve toCursor - action required.doneresolves toCursor readyonly for a classified working title, classified permission title, or exact bare nativeCursor Agent.- Undefined titles and descriptive idle/completed titles remain unchanged.
- Any non-Cursor agent remains unchanged.
I’ll implement this pure resolver at the required path and wire it into both renderer hook-status storage boundaries. I’ll avoid modifying tests per the environment constraint, and use existing tests plus a temporary script if needed for direct verification.
- Assistant
The new resolver file was created, but the environment lacks
python3, so the integration edits did not run. I’ll apply the same two exact source transformations with Node, then inspect the diff before testing. - Assistant
The diff now applies reconciliation immediately before both
setAgentStatuscalls. I’ll verify the pure function directly across the contract’s edge cases using the repository’s TypeScript runner (without adding a test file), then run targeted existing agent-status/IPC/PTY tests and typechecking. - Assistant
The verification command hit Corepack’s interactive download prompt (which this environment cannot answer) before tests ran. I’ll bypass
pnpmand invoke installed local binaries directly. I’ll also inspect whether a TS execution binary is available; if not, Vitest’s existing transform pipeline can validate compilation while a temporary test outside the repository validates the resolver and is removed immediately afterward. - Assistant
All 256 targeted tests passed, and web typechecking completed without errors. To directly verify the resolver’s contract, I’ll use Node’s available TypeScript support if present; otherwise I’ll compile a temporary script plus the resolver/shared detector into
/tmpwithtsc, run it, and delete the output. Then I’ll run lint on the changed files or the repository lint binary as supported. - Assistant
Lint passes. The direct Node run failed only because native ESM resolution does not append
.tsfor the resolver’s extensionless project import; it did not indicate a code failure. I’ll perform the direct check by compiling the resolver and its shared dependencies to a temporary CommonJS directory, execute the same cases against compiled output, then remove all temporary artifacts. - Assistant
Direct contract verification now passes all 10 cases, including stale spinner/native/permission replacement, blocked/waiting mapping, descriptive-title preservation, and non-profile preservation. The targeted tests, typecheck, lint, and whitespace checks are clean. I’ll do one final format check and inspect the complete untracked resolver content and repository status before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.