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, package scripts, and existing agent-status/title handling. Then I’ll identify the snapshot integration point and relevant test conventions before implementing the resolver and running targeted tests.
- Assistant
rgis unavailable, so I’ll usegrep/find. I’ll also read the repository-specific instructions and locate the payload type, title profiles, status listeners, and nearby unit tests. - Assistant
The requested resolver file does not yet exist. The main process already defines synthetic title profiles, so I’ll inspect those classifications and the renderer’s IPC status callback/store methods to mirror established semantics without introducing divergent rules.
- Assistant
The bug occurs because IPC stores the currently observed terminal title verbatim; a
donehook can therefore snapshot Cursor’s stale native/working title before the synthesized idle OSC frame arrives. I’ll inspect the precise title detector and IPC listener ordering, plus the status state union, to design a pure resolver that handles whitespace/case and preserves descriptive completed titles. - Assistant
The integration requirement is specifically the
useIpcEventspath immediately beforesetAgentStatus. I’ll now inspect howtitleandidentityTitleare selected, then implement the requested pure function. Given the contract’s explicit Cursor behavior, I’ll scope the profile to Cursor so other agents—including existing synthetic-title agents whose reconciliation behavior is not specified—remain unchanged. - Assistant
I’ll add the new module with a small synthetic profile table and explicit stale-title classification. For
done, only titles attributable to Cursor’s active/permission UI (braille spinner, working keywords, exact native label, or permission keywords) are replaced; arbitrary titles such as a completed task description remain intact.waiting/blockedalways use the profile permission label, whileworking, undefined titles, and non-profile agents are preserved. Then I’ll wire the resolved title into the IPC snapshot write. - Assistant
The module was created and formatted, but this environment lacks Python, so the integration edit did not apply. I’ll use Node for the two precise edits, verify the diff, and then run a temporary direct behavioral check plus type checking (without adding repository tests, per instruction).
- Assistant
The integration now resolves the terminal title after agent identity resolution and immediately before storage, satisfying the required ordering. I’ll inspect the final module, check whether a TypeScript runner is available for an out-of-tree reproduction script, and run the renderer typecheck plus existing agent-status and IPC tests.
- Assistant
The combined command timed out because Corepack attempted an interactive pnpm download, so no validation ran. Before retrying non-interactively via local binaries, I noticed the repository’s canonical detector already defines “classified as working or permission.” I’ll reuse that detector rather than maintain parallel regexes, while retaining Cursor-profile attribution so an unrelated stale agent title cannot be rewritten.
- Assistant
Type checking and all 170 targeted tests pass. I’ll now run a temporary (then removed) Vitest reproduction covering the reported stale Cursor states, descriptive-title preservation, waiting/blocked behavior, working behavior, undefined titles, and non-profile agents. I’ll also inspect the integration test setup to determine whether adding the resolver altered any expected call; existing IPC tests already passed.
- Assistant
The reproduction passes and confirms the stale loading title becomes
Cursor readywhile edge cases are preserved. I’ll perform a final diff review, lint only the changed files (if supported), and run the repository’s full typecheck to catch cross-project import issues. I’ll also verify no temporary artifacts or test modifications remain. - Assistant
Final review shows only the intended source changes, with changed-file lint, full typecheck, 170 existing targeted tests, and the temporary regression reproduction all passing. I’ll add a brief “why” comment at the integration point per repository guidance, run the final whitespace/lint check, and then submit.
Checklist:
- Reproduced the reported error: Yes. The temporary regression scenario modeled a
doneCursor hook arriving while the title remained⠋ Cursor Agent,Cursor Agent, or a permission title—the stale snapshot condition causing the loading UI. - Confirmed the fix resolves it: Yes. Each stale completion title resolved to
Cursor ready; the temporary test passed and was removed. - Considered edge cases: Yes. Waiting/blocked become action-required; descriptive completed titles, undefined titles, working-state titles, case-normalized Cursor types, and agents without a profile remain appropriate.
- Ran affected existing tests: Yes. 170 renderer agent-status/store/IPC tests passed, along with full node/CLI/web typechecking and changed-file lint.
- Reproduced the reported error: Yes. The temporary regression scenario modeled a
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.