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
Let me start by exploring the repository structure to understand the codebase
Assistant
Let me explore the src directory and look for the file mentioned in the issue
Assistant
Let me look at the existing agent-status.ts file to understand the structure
Assistant
Let me look at how the agent-status payload is processed in the renderer and search for the IPC integration
Assistant
Let me search for existing patterns about Cursor agent status and the agent detection
Assistant
Now let me look at the smart-attention.ts and IPC integration code
Assistant
Now let me look at the existing title handling area:
Assistant
Now let me look at the test file for
agent-status.test.tsto understand how tests are structured:Assistant
Now let me look at the related "synthetic-title" and "Cursor ready" / "Cursor - action required" used in the codebase:
Assistant
let me see how the title is currently handled when setAgentStatus is called:
Assistant
Now I have enough understanding. Let me check the existing agent-status count test file to understand how tests are set up:
Assistant
Let me look at the package.json and check the test runner setup:
Assistant
Now let me look at the existing test files for the agent-status to understand the typical pattern of testing for this kind of resolver:
Assistant
me check the synthetic title profiles and verify the implementation structure:
Assistant
me also check how the title flows from the IPC events into setAgentStatus:
Assistant
Now I have a good understanding. Let me check what is in the agent-detection.ts for the bare "Cursor Agent" title and verify the path I should take:
Assistant
Let me check for all the places where
setAgentStatusis called with a title:Assistant
Let me look at how the OSC 9999 path differs from the IPC path:
Assistant
Let me check the other call sites that pass titles:
Assistant
Now I have a good understanding. Let me plan the implementation:
Assistant
Now let me check what files exist in
src/renderer/src/lib/:Assistant
Let me check the tsconfig setup:
Assistant
Good - I can see the test structure. Now let me create the resolver file:
Assistant
me first verify my understanding by writing the reproduction script:
Assistant
Now I'll create the resolver function:
Assistant
Now let me write tests for this resolver:
Assistant
Wait, I need to re-examine my test case for
donewithundefinedtitle. Let me look at my implementation again:Assistant
Let me reconsider the approach. Looking at the store code more carefully:
Assistant
Now let me apply the resolver inside the store. First let me check the current import:
Assistant
Now I'll update the store to apply the resolver:
Assistant
Now let me modify the
effectiveTitlecomputation in setAgentStatus to use the resolver:Assistant
let me modify the
effectiveTitlecomputation. I need to first rename it tobaseTitle(for clarity) and then apply the resolver:Assistant
created a duplicate comment. Let me fix that and add the resolver:
Assistant
Now let me add the resolver call after the identity computation and add a comment explaining why we use the resolved identity:
Assistant
see a duplicate in the identity block. Let me fix that:
Assistant
Now let me run the tests to verify the implementation works:
Assistant
update the tests to match the implementation behavior. For Hermes, the workingLabel is just "Hermes":
Assistant
edit broke the file. Let me look at the file structure and fix it:
Assistant
delete and rewrite the test file cleanly:
Assistant
All 20 tests pass. Now let me verify the store changes don't break the existing agent-status tests:
Assistant
a failing test. Let me investigate:
Assistant
Assistant
Let me check what
normalizedKnownAgentTypereturns:Assistant
me run the failing test in isolation to see the full output:
Assistant
Let me first verify if this test was failing before my changes:
Assistant
test passes without my changes. Let me restore them and investigate:
Assistant
see the issue! When I made my edit, I accidentally removed the
stateHistory: history,line from the entry. Let me fix that:Assistant
Yes, the
stateHistoryline is missing. Let me add it back:Assistant
Now let me run the failing test again:
Assistant
Now let me run all the tests in the agent-status test suite:
Assistant
All 24 tests pass. Now let me also run all the related test files:
Assistant
All 169 tests pass. Now let me also run the tests in the hooks directory and IPC events directory to make sure nothing else broke:
Assistant
All tests pass. Let me also run the tests related to the store cascade:
Assistant
All 73 tests pass. Let me also write a reproduction script to verify the bug fix in practice:
Assistant
Let me fix the script to use the absolute path:
Assistant
All scenarios work as expected. Now let me clean up the temp script:
Assistant
check the rules - the issue says not to add new tests, so let me follow that:
Assistant
delete the test file as the instructions say not to add new tests:
Assistant
Let me verify the implementation works by running a more thorough temporary test:
Assistant
All 21 verification tests pass. Let me clean up the temporary script:
Assistant
verify all related tests still pass:
Assistant
All 135 tests pass. Let me also run the broader test suite for the renderer to ensure nothing else broke:
Assistant
All 150 tests pass. Let me also check the broader agent-related tests:
Assistant
All tests pass. Let me also do a final check to confirm my changes:
Assistant
Let me do a final verification of the implementation:
Assistant
re-read the file to make sure it's complete:
Assistant
Let me verify the TypeScript compiles correctly:
Assistant
fix the TypeScript exhaustiveness check:
Assistant
have a duplicate. Let me look at the full file and fix it:
Assistant
There's still extra lines. Let me delete the file and rewrite cleanly:
Assistant
Those errors are unrelated to my changes (they're from
agent-detection.tsdue to my standalonetscinvocation not using the project's tsconfig). Let me run with the proper project config:Assistant
The remaining errors are pre-existing project configuration issues unrelated to my changes. Let me run the relevant tests one more time to verify everything works:
Assistant
All tests pass. Let me also run my verification script to confirm the implementation still works correctly:
Assistant
All 14 verification tests pass. Let me clean up the temporary script:
Assistant
me verify the final state of my changes:
Assistant
me also check the agent-detection module to ensure it works correctly:
Assistant
me verify the final implementation:
Assistant
Let me do a final comprehensive test run:
Assistant
All 181 tests pass. Let me also check the final state of my implementation:
Assistant
Assistant
Assistant
All 9 integration scenarios pass. The bug is fixed. Let me clean up the temporary script:
Assistant
me do a final check on the implementation files:
Assistant
Let me submit now. I've thoroughly verified my implementation:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.