Skip to content
TheChatArchiveThe Chat Archive
GLMz-ai/glm-5.2· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION [Bug]: Cursor CLI agent stays in loading state after task completes…

  1. 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

    1. Start a Cursor CLI agent session in Orca.
    2. Give the agent a task and wait for it to complete (agent finishes and produces final output).
    3. 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, done replaces spinner/working titles, the bare Cursor Agent title, and stale permission titles with Cursor ready; waiting or blocked uses Cursor - 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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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-$

  2. GLM Assistant

    Let me start by exploring the repository structure to understand the codebase.

  3. GLM Assistant

    The file doesn't exist yet. Let me explore the repository structure to understand the codebase and find related files.

  4. GLM Assistant

    I need to make single tool calls. Let me explore the structure first.

  5. GLM Assistant

    Let me look at the IPC status integration and how terminalTitle is stored.

  6. GLM Assistant

    Now let me look at the store slice where terminalTitle is stored, to understand the full flow.

  7. GLM Assistant

    Let me look at how the terminalTitle flows from IPC to the store, and look for any existing synthetic title profiles.

  8. GLM Assistant

    Now let me understand where the agent-status snapshot title is stored. The issue says: "The IPC status integration must call this resolver before storing the title." Let me find where the terminalTitle is set in the IPC status integration (the main process or renderer side).

    Let me look at the main process server.ts and where status is stored/sent.

  9. GLM Assistant

    Let me understand the full flow. The terminalTitle on the AgentStatusEntry comes from the renderer side, in the store slice. Let me trace where the renderer gets the terminalTitle and stores it.

    The store's setAgentStatus takes a terminalTitle param. Let me find the call site in useIpcEvents.ts where the agentStatus:set IPC is handled.

  10. GLM Assistant

    Now let me look at where title is determined in this function. Let me see the broader context of this handler.

  11. GLM Assistant

    Let me look at the agent-detection.ts to understand how titles are classified.

  12. GLM Assistant

    Let me check whether SYNTHETIC_TITLE_PROFILES is shared/exported and look at related test files for the existing patterns.

  13. GLM Assistant

    Let me check if there's already a test file for this function and look at how other agent-status lib files are tested.

  14. GLM Assistant

    Let me look at the agent-detection.ts exports and helper functions.

  15. GLM Assistant

    Now let me look at the containsBrailleSpinner and containsAny helper functions to understand how to classify titles.

  16. GLM Assistant

    Now I have a good understanding. Let me look at the rest of the detectAgentStatusFromTitle function to fully understand the classification, especially the cursor-specific handling.

  17. GLM Assistant

    Now I have a clear understanding. Let me look at the imports in useIpcEvents.ts to understand what's already imported.

  18. GLM Assistant

    Let me check the test setup and run a sample test to understand the runner.

  19. GLM Assistant

    Now let me create the agent-status-terminal-title.ts file.

  20. GLM Assistant

    Now let me wire the resolver into the IPC status integration. Let me look at the exact lines again.

  21. GLM Assistant

    Now let me add the import and modify the setAgentStatus call to use the resolver.

  22. GLM Assistant

    The replace tool needs the lines visible. Let me use sed for precise editing.

  23. GLM Assistant

    Now let me modify the setAgentStatus call to reconcile the title.

  24. GLM Assistant

    Now let me create a temporary test to verify the function's behavior.

  25. GLM Assistant

    All 16 tests pass. Now let me remove the temporary test file and verify the existing tests still pass.

  26. GLM Assistant

    Now let me run the existing tests related to agent-status and useIpcEvents to ensure I didn't break anything.

  27. GLM Assistant

    Let me check for tests related to useIpcEvents and the store slice.

  28. GLM Assistant

    Now let me run the store agent-status tests and related snapshot tests to ensure nothing breaks.

  29. GLM Assistant

    Let me run a broader set of tests that involve terminalTitle to make sure nothing breaks.

  30. GLM Assistant

    All pass. Now let me verify the type-checking of the new file to ensure imports are correct. Let me run a tsc check on the renderer.

  31. GLM Assistant

    Typecheck passes. Let me run the linter on the new/modified files.

  32. GLM Assistant

    Let me review the final diff.

  33. GLM Assistant

    Let me check if there are other callers of setAgentStatus that store a terminalTitle and should also use the resolver.

  34. GLM Assistant

    Let me examine the pty-connection.ts callers to understand whether they're part of the IPC integration or a separate OSC fallback path.

  35. GLM Assistant

    These pty-connection.ts callers are specific to command-code and initial agent status seeding — not the synthetic-title agents (cursor/opencode/droid/hermes). The line 1154 is the OSC-fallback path. Let me look at it.

  36. GLM Assistant

    The onAgentStatus at line 1154 is the OSC 9999 in-PTY path, which synthetic-title agents (Cursor/OpenCode/Droid/Hermes) don't use — they report via the HTTP hook server → agentStatus:set IPC channel that I've already handled. The contract specifically targets "the IPC status integration," so my change is correctly placed.

    Let me do a final review of the new file and run the orca-runtime Cursor title test (main process, untouched) plus a broader hook test to confirm nothing is affected.

  37. GLM Assistant

    Let me run a final broader test to confirm everything is consistent, including the agent-hook-completion-notifications and pty-connection tests.

  38. GLM Assistant

    All tests pass. Let me verify the final state of changes and confirm no temp files remain.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.