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 start by exploring the repository structure to understand the codebase and locate the relevant files mentioned in the issue.
Assistant
Let me look for the file mentioned in the issue description.
Assistant
Let me explore the existing agent-status related files to understand the codebase structure:
Assistant
Now let me look at the renderer-side agent-status.ts file:
Assistant
Now let me check the agent-detection module mentioned in the re-exports:
Assistant
Now let me look for the store slice related to agent-status, which is likely where the title resolution happens:
Assistant
Now I need to look for where the terminal title is stored and where the IPC integration calls the resolver. Let me search for the relevant files:
Assistant
So the function
resolveAgentStatusTerminalTitledoesn't exist yet. According to the issue description, I need to create this function. Let me search for related IPC handling:Assistant
Let me look at the
useIpcEvents.tsfile where the title is stored:Assistant
Let me see more context around where the
titlevariable is set:Assistant
Let me find where the
titlevariable is defined:Assistant
Now let me look for any existing tests related to agent-status-terminal-title:
Assistant
-->
Assistant
Let me look at the synthetic title related files to understand the existing patterns:
Assistant
Let me look at the main
orca-runtime.tsto understand where agent status terminal titles are handled:Assistant
Let me search for where agent status snapshots are stored:
Assistant
Let me search for where the "agent-status" snapshots are stored or where the title is stored:
Assistant
Let me look for where the title gets stored in the IPC payload:
Assistant
Let me look at the IPC handling for agent status to understand where title is stored:
Assistant
Now let me look at the hook server where the status and title are collected and sent over IPC:
Assistant
I need to find where the terminal title is stored in the IPC payload. Let me look at the main process hook server.
Assistant
Now let me look at the hook server to understand how the title is stored:
Assistant
Let me search for where the title is stored in the IPC payload:
Assistant
Let me look for where the IPC payload gets constructed with the title:
Assistant
I found the file structure. Now I need to:
- Create the
agent-status-terminal-title.tsfile with theresolveAgentStatusTerminalTitlefunction - Wire it into the IPC status integration before storing the title
- Write tests for the function
Let me start by looking at where the title gets passed to
setAgentStatusin the IPC handler.- Create the
Assistant
Let me look at the existing tests to understand the testing patterns used in this codebase:
Assistant
Now I understand the codebase structure. According to the issue description, I need to:
- Create a new file
src/renderer/src/lib/agent-status-terminal-title.tswith a functionresolveAgentStatusTerminalTitle - This function should reconcile hook-reported state with synthetic terminal-title profiles for Cursor
- Wire this resolver into the IPC status integration (in
useIpcEvents.ts) before storing the title
Let me understand the exact requirements from the issue:
- For Cursor agent:
donestate: replaces spinner/working titles, bareCursor Agenttitle, and stale permission titles withCursor readywaitingorblockedstate: usesCursor - action required- Preserve descriptive completed titles that are NOT classified as working or permission
- Do NOT rewrite agents without a synthetic-title profile
Let me create the new file:
- Create a new file
Assistant
Now I need to wire the resolver into the IPC status integration. Let me look at where the title is stored in
useIpcEvents.ts:Assistant
I see the line where the title is passed to
setAgentStatus. I need to resolve the title before passing it. Let me look at the full context around that line and see what imports already exist:Assistant
Now let me add the import for the new function and use it before storing the title. Let me find the exact location to add the import:
Assistant
Now I need to add the import for the new resolver. Let me add it after the existing agent-status imports:
Assistant
Now I'll add the import and modify the code to use the resolver before storing the title:
Assistant
I'll use the edit command with the
--fileoption:Assistant
Good, the import was added. Now I need to find the exact line where
store.setAgentStatusis called and modify the title before passing it:Assistant
Let me see the context around that line:
Assistant
Now I need to resolve the terminal title before passing it to
setAgentStatus. I'll modify the line to use the resolver:Assistant
Good, the changes look correct. Now let me create a test file for the new function:
Assistant
Now let me run the tests to make sure my implementation is correct:
Assistant
The test timed out. Let me try running it with a shorter timeout and a more specific test pattern:
Assistant
All 22 tests pass. Now let me verify the TypeScript compilation by checking for any type errors:
Assistant
No type errors. Now let me also check the useIpcEvents.ts file compiles correctly:
Assistant
The errors are from dependencies (node_modules), not from my code. Let me run a more targeted check using the project's tsconfig:
Assistant
No errors in my files. Let me also run the existing tests related to agent-status to make sure I haven't broken anything:
Assistant
Let me run a few more related tests to make sure everything is working:
Assistant
Now let me verify my changes are correct by reviewing the files I created/modified:
Assistant
Now let me check my changes in the useIpcEvents.ts file:
Assistant
Let me also run some more comprehensive tests related to agent status to make sure nothing is broken:
Assistant
Let me verify the changes I made are correct and check the git diff to see what will be submitted.
Assistant
Let me verify my changes by viewing the git diff for the modified file and confirming the new files exist:
Assistant
Now let me verify that all tests pass one more time and check for any linting issues:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.