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, existing agent-status/title logic, and test setup first. Then I’ll reproduce the stale-title behavior through the relevant test or a temporary script, implement the resolver and IPC integration, and run focused plus broader tests.
- Assistant
The requested resolver file does not yet exist. I’ll now inspect status payload types, synthetic title profiles, terminal title classification, and the renderer IPC update path to identify the narrowest integration point and align with existing conventions.
- Assistant
Ripgrep is unavailable in this environment, so I’ll use
grep. The store currently preserves an omitted title and writes a supplied title verbatim; that is likely where stale Cursor spinner/permission titles survive a final status. I need to find the IPC callback and existing shared synthetic-title definitions before deciding whether reconciliation belongs at the callback or store boundary. - Assistant
The main process already defines Cursor’s synthetic labels, but the renderer snapshot path can pair a final hook state with a stale runtime pane title. The contract specifically requires a renderer library function and application before storing IPC snapshot titles, so I’ll inspect those exact code paths and title-detection rules to ensure “working” and “permission” classification is consistent without accidentally replacing descriptive completed titles.
- Assistant
The IPC handler passes
title, derived from current runtime terminal state, into the status snapshot. Because main sends the status event before injecting its final synthetic OSC title, the renderer can store the previous spinner title. I’ll inspect title normalization/detection and handler setup/imports, then create the specified resolver with Cursor-only behavior and wire it immediately beforesetAgentStatus. - Assistant
The key edge cases are clear: for a Cursor
done, only stale activity titles (detected working/permission) and the exact bare native title should becomeCursor ready; an unrelated or descriptive title must remain untouched, includingundefined. Cursorwaiting/blockedshould always become the action-required synthetic title. Other agents should remain unchanged unless represented by a synthetic profile; to avoid profile drift, I’ll check whether profiles can be shared rather than duplicating main-process constants. - Assistant
I’ll implement a small data-driven resolver using the same four synthetic profiles currently defined in main (Cursor, OpenCode, Droid, Hermes), while preserving all other agent types. It will only rewrite
donetitles when they are exact native labels or classify as working/permission;waiting/blockedwill use the profile’s action-required label. Then I’ll call it in the IPC handler after agent-type resolution and before the snapshot is stored. - Assistant
The new resolver file was created, but this environment lacks Python, so the scripted integration edit did not run. I’ll apply the two import/call-site changes with Node instead, then inspect the diff.
- Assistant
Before testing, I noticed an arbitrary-agent edge case: indexing a plain object with an agent type such as
__proto__could falsely appear to find a profile. Since payload agent types intentionally allow arbitrary strings, I’ll use aMapso agents without exact profile keys are always preserved. Then I’ll format and exercise the resolver directly with representative stale, descriptive, missing, and non-profile titles. - Assistant
The source edit completed, but invoking
pnpmtriggered Corepack’s unsupported interactive download prompt and timed out. I’ll use the already-installed local binaries directly, avoiding interactive package-manager setup, and verify the file is syntactically correct before running tests. - Assistant
The resolver now formats cleanly. I’ll reproduce the original stale snapshot case by loading the actual TypeScript module through Vite’s SSR loader and asserting Cursor spinner/native/permission completion behavior, action-required behavior, descriptive preservation, and arbitrary-agent preservation. After that I’ll run focused existing status/IPC tests and web typechecking.
- Assistant
The direct reproduction assertions all passed; Vite emitted a shutdown-time dependency-scan warning after the assertions, unrelated to module behavior. I’ll now run the existing
useIpcEvents, agent-status library/store tests, and web typecheck using local binaries. This should catch integration typing, import-resolution, and behavior regressions. - Assistant
All 197 focused tests passed, and the chained web typecheck completed successfully with no diagnostics. I’ll perform a final lint check on the changed files, inspect the complete diff for unintended changes, and verify profile behavior against the issue contract before submission.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.