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
Now let's look at where
setAgentStatusis called from the IPC layer (the "IPC status integration" the interface mentions).Assistant
Now let's create the shared profile module.
Assistant
Now update main/index.ts to import from shared module instead of defining locally.
Assistant
Let's use the
replacespecial command on the open file instead.Assistant
Now add the import for the shared type/const, and remove the now-unused local type since we deleted the const definition but kept type usage at line 781. Let's fix that reference and add import.
Assistant
Now let's verify the file compiles (typecheck) and no duplicate declarations remain.
Assistant
Good. Now let's create the renderer resolver file.
Assistant
Now integrate into useIpcEvents.ts where
store.setAgentStatus(data.paneKey, statusPayload, title, ...)is invoked.Assistant
Let's add the import and use it right before
store.setAgentStatus.Assistant
Now let's update the call site around line ~2295 (line numbers shifted by +1).
Assistant
All passes. Now clean up temp test file and run the broader relevant test suites.
Assistant
Let's find and run agent-status related test files broadly, and check that main/index.ts still compiles (no direct test file for it likely, but check tsc).
Assistant
Now let's typecheck the whole project (or at least the renderer/main relevant parts) to catch any TS errors from our refactor.
Assistant
No errors from the node/main typecheck. Now the web (renderer) typecheck.
Assistant
Both typecheck clean. Let's also run cli typecheck for completeness (shared module used elsewhere possibly by CLI).
Assistant
All clean. Now let's run lint to check style conventions (oxlint) on changed files.
Assistant
Now let's run the full main test suite related to index.ts's synthetic title spinner to make sure nothing broke there.
Assistant
Now let's look for a main/index.test.ts to check if there's any test covering
SYNTHETIC_TITLE_PROFILESdirectly that could break due to refactor (unlikely, already confirmed no references elsewhere). Let's also check pty-dispatcher-pi-routing.test.ts, since it references cursor titles.Assistant
All good. Now let's run the broader test suite for the whole repo to be safe (might take long, but let's try with a reasonable timeout).
Assistant
Good, now it's running detached. Let's wait and poll periodically.
Assistant
Confirmed — these were just resource-contention timeouts from running the entire suite in parallel, not real failures caused by our change. All targeted tests pass individually. Let's double check the full list of failed files to make sure none relate to agent-status/cursor/synthetic-title.
Assistant
Let's view the full diff to review everything once more.
Assistant
This looks correct. Let's view the two new files once more for final review.
Assistant
This is solid. Let's do a final check: confirm
git diff --statand run the specific test suites once more to be safe, then finalize.Assistant
All good. Now let's go through the checklist.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.