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
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /orca, current file: none) bash-$
- Assistant
I'll start by exploring the repository structure and locating the agent-status terminal title logic described in the issue.
- Assistant
The target file isn't present yet — I'll inspect related agent-status code and how terminal titles are handled.
- Assistant
Let me look at agent-status store, agent-title-decoration, and related code more carefully.
- Assistant
Let me search more specifically for Cursor-related title handling and agent status payload handling.
- Assistant
Hmm, seems like the second rg failed. Let me try grep instead.
- Assistant
There's synthetic title handling in the main process. Let me inspect the agent status IPC path and synthetic title profiles next.
- Assistant
I'll inspect where agent-status snapshots store terminal titles and how IPC events flow into that path.
- Assistant
Let me read more of the useIpcEvents around agent status handling, and also check documentation and any ADRs.
- Assistant
Next I'll inspect title-detection helpers and how synthetic profiles classify working vs permission titles.
- Assistant
Let me look at the synthetic title spinner and how main applies titles, and check git log or any related PR discussions. Also look at agent-detection for Cursor.
- Assistant
Let me read the section of main/index.ts that handles synthetic titles when hooks report status.
- Assistant
I'll inspect how
setAgentStatuscaptures the title and where snapshot titles are stored. - Assistant
I'll search for related tests, stubs, and any prior implementation of this resolver.
- Assistant
There's a recent related commit: checking what it changed.
- Assistant
Let me look at how agent status entries use terminalTitle for display, and understand what causes the loading state.
- Assistant
I'll inspect how explicit agent status interacts with title detection in worktree-status and pty-connection.
- Assistant
I'll look for shared synthetic title profiles and mirror patterns for reconciling titles.
- Assistant
Checking AGENTS.md and similar lib modules for coding style guidance.
- Assistant
I'll check how activity status is chosen when both explicit status and title signals are present.
- Assistant
I'll inspect how freshHookLeafIds interacts with done state in the activity summary.
- Assistant
So for done states, freshHookLeafIds includes the leaf, which should suppress title heuristics. But the bug description says loading persists after task completes. Perhaps there's another path - UI fo...I need to implement the
resolveAgentStatusTerminalTitlefunction as specified in the evaluation contract. Let me start by examining the current code structure to understand where this function should fit in.First, let me check the file structure to find where agent status handling is implemented. I'll use the shell to explore the codebase 1. Let me list the files in the src/renderer/src/lib directory to find relevant files. 2. Let me check if there's already an agent-status-terminal-title.ts file. 3. Let me search for existing agent status related code. 4. Let me check the shared types to understand the ParsedAgentStatus 5. Let me check the useIpcEvents implementation to see where the resolver should be called. 6. Let me check the agent status types to understand the state values. 7. Let me check the terminal title detection logic. 8. Let me check the setAgentStatus function to see how titles are 9. Let me check the layout title handling to understand how titles are passed to the resolver. 10. Let me check the agent detection logic to understand the shouldReplaceTitleOnDone logic. 11. Let me check the synthetic title profiles to see what agents are supported. 12.
- Assistant
There's also a path in pty-connection that sets agent status from titles. Checking that next.
- Assistant
Implementing the resolver and wiring it into the IPC agent-status path.
- Assistant
Let me write the full file content.
- Assistant
Now wiring the resolver into the IPC agent-status path.
- Assistant
I'll add the import and update the setAgentStatus call.
- Assistant
Updating the setAgentStatus call to use the resolver.
- Assistant
Need to navigate to that line first.
- Assistant
Now I can replace.
- Assistant
Verifying the resolver with a temporary script against the intended cases:
- Assistant
Need to put the test in the right place.
- Assistant
pnpm is trying to download. Trying npx tsx from the project path instead.
- Assistant
Let me use vitest or node with a simple compilation. Or use node'sproximity with path mapping - might be hard. Let me just run a pink ac vitest inline test... Actually the instructions say not to add ...
- Assistant
Let me write to a temp file instead of blob.
- Assistant
All cases passed. Cleaning up temp files and checking related agent-status path integrations once more.
- Assistant
Tightening the IPC comment wording, then running related agent-status unit tests.
- Assistant
Let me also apply the resolver in setAgentStatus as a defensive second layer, ensuring any path that stores titles gets reconciliation. The contract says IPC must call before storing - which we've don...
- Assistant
Trying vitest directly of the ensure step.
- Assistant
Tests passed. Checking the diff and doing a quick typecheck on the new module.
- Assistant
The new file is untracked — checking git status.
- Assistant
Checking how
submithandles new files — untracked files may not appear ingit diff. - Assistant
Staging the new file so
submit(viagit diff) will include it.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →