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 first inspect the repository structure and search for the agent-status title handling, synthetic title profiles, and IPC snapshot integration. Then I’ll reproduce the current behavior with the relevant tests or a temporary script before implementing the resolver.
- Assistant
The requested resolver file does not yet exist. I’ll inspect the shared status types, the synthetic-title generation/classification code, and the exact status-receive path in
pty-connection.tsso the implementation reuses existing conventions rather than duplicating mismatched rules. - Assistant
The existing synthetic profile confirms Cursor’s labels (
Cursor Agent,Cursor - action required,Cursor ready). The likely race is that IPC stores the current spinner title when adonehook arrives, while title synthesis arrives separately or is overwritten. I’ll now inspect profile matching and the centralized IPC helper to identify the precise pre-storage insertion point and available classifiers. - Assistant
The integration is centralized in
applyAgentStatusIpcPayload, and it currently passes the raw resolved pane/tab title tosetAgentStatus. I’ll inspect that helper in full plus imports and test setup, then add the requested library function and invoke it after agent-type attribution but before storage. I’ll also determine whether tests are expected through hidden evaluation or whether an existing nearby test can demonstrate the race without modifying tests. - Assistant
The contract’s distinctions can be implemented narrowly: only
agentType === 'cursor';waiting/blockedalways return the action-required synthetic title;donerewrites the exact native label and titles classified asworkingorpermission, while preservingundefined, already-idle, and descriptive unclassified completed titles. ReusingdetectAgentStatusFromTitlealso covers every spinner frame and future working/permission variants consistently. Before editing, I’ll verify classifier behavior for ordinary descriptive titles and inspect path-alias/test conventions. - Assistant
I’ve reproduced the faulty logic at the function level: a Cursor
donepayload paired with the current title⠋ Cursor Agentis stored unchanged because no reconciliation occurs. I’ll now create the requested resolver and wire it into the IPC path. The resolver will leaveworkingunchanged because the spinner driver owns that state, and it will preserve all agents without a synthetic profile (currently represented here by the Cursor-only rule). - Assistant
The new source file was created, but this environment lacks
python3, so the scripted integration edit did not run. I’ll apply the same two exact edits with Node and inspect the resulting diff. - Assistant
Reviewing the store semantics exposed an important edge case:
setAgentStatuspreserves an existing title when its title argument isundefined. Therefore, if pane metadata is temporarily absent during snapshot replay, resolving only that absent title would still retain an old Cursor spinner from the existing status entry. I’ll pass the effective current title (pane title ?? existing stored title) into the resolver, then run typechecking and focused tests. - Assistant
The edit completed, but
pnpmattempted an interactive Corepack download, which this environment cannot accept, so formatting/tests did not start. The repository already has dependencies installed; I’ll invoke the local binaries directly instead and first confirm the edit and available executables. - Assistant
The effective-title edit is present and local binaries are available. I’ll format both changed files, run the renderer typecheck, then run the existing title-classifier suite and the IPC-heavy
pty-connectionsuite separately to avoid a combined command timeout. - Assistant
Formatting and renderer typechecking pass with no whitespace errors. I’ll run the focused existing tests now. Afterward, I’ll use a temporary out-of-repository TypeScript compile/run harness to explicitly exercise every contract case (spinner, native, permission, descriptive completion, waiting/blocked, and non-profile agents), removing any temporary output afterward.
- Assistant
Both focused suites pass (221 tests total). To explicitly verify the new resolver without adding repository tests, I’ll check for the local Vite TypeScript runner and execute a temporary assertion script from
/tmp; this will reproduce the old spinner result expectation and confirm the fixed mapping plus edge cases. - Assistant
No TypeScript runner binary is installed. I’ll bundle a temporary assertion script with the installed
esbuildAPI (writing only under/tmp), execute it, and delete it. This directly calls the production resolver without creating or modifying repository tests. - Assistant
The production resolver passes all contract assertions, including preservation of descriptive completions and non-profile agents. I’ll now inspect the final diff and run lint on the two changed files (using Oxlint’s direct file arguments), plus the existing IPC agent-status test if it exercises
useIpcEvents. Then I’ll run the full renderer typecheck once more and submit if clean. - Assistant
Lint passes with zero warnings/errors, and the final diff is minimal and matches the requested interface. The repository has a dedicated
useIpcEventsagent-status snapshot integration suite, so I’ll run that entire test file to validate that applying the resolver before storage does not regress replay, attribution, or stale-event behavior.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.