AwaitShell misses completed background shell and blocks Luna subagent for full timeout

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

AwaitShell continued displaying “Waiting up to 1h 50m…” despite the tracked shell command having already completed with exit_code 1 and a full completion footer in the terminal artifact. The shell started at 2026-08-26 14:33:57 UTC, completed at 14:34:10 UTC (elapsed_ms: 12962), and left approximately 690 lines of output with a completion footer. AwaitShell did not recognize the completion and waited for the full 119-minute timeout.

Steps to Reproduce

  1. Luna subagent started a shell command with block_until_ms: 1000, which sent the shell to the background
  2. Luna then called AwaitShell(shell_id=883310, block_until_ms=7140000) without a pattern
  3. The command started at 2026-08-26 14:33:57 UTC
  4. The command completed at 14:34:10 UTC with exit_code: 1 and elapsed_ms: 12962
  5. The terminal artifact contained the complete completion footer plus approximately 690 lines of Java stack trace
  6. Despite this, AwaitShell continued displaying “Waiting up to 1h 50m…” and did not return for the full 119-minute timeout

Expected Behavior

AwaitShell should return immediately when the tracked shell already has a completion footer in the terminal artifact, regardless of output size or exit code.

Operating System

Windows 10/11

Version Information

Windows 10, build 10.0.26200, PowerShell, current installed Cursor build, Luna subagent (/subagent-low)

For AI issues: which model did you use?

Luna subagent (/subagent-low)

Additional Information

Actual behavior:
AwaitShell missed the completion and waited for the full 119-minute timeout.

Important distinctions:

  • This is not merely the usual 10–30 second Windows terminal completion delay.
  • The completion footer was present; it was not missing.
  • No active process was still running.
  • --last was not a valid workaround because the npm fallback does not write the same run artifact.

Workaround:
Interrupt AwaitShell/the subagent and read the terminal artifact directly. During recovery, do not use unrelated “latest” result artifacts.

Related threads:

The exact combination of AwaitShell, a completed footer, and Luna /subagent-low was not found in the related threads.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Lukas_Sedlacek
What you’re describing isn’t intended behavior; once a shell finishes and its footer is written, the wait should return right away. We’ve let the team know and it’s an issue we’re tracking.

Your workaround is the right call - interrupt and read the terminal file directly. Waiting in shorter slices with a quick read in between also keeps a missed completion from eating the whole window.

If you still have that file: is there anything after the closing --- of the footer (even a blank line or stray output), and does the Java output contain any odd/non-UTF-8 characters? Either one tells us which path tripped it.

Unfortunatelly I have not. But it seems to be a bit related to Luna agent, who has problem. Composer has no issue.

Hey @Lukas_Sedlacek,

Good news, this has been addressed on our side and should already be rolled out. The shell wait was not picking up completions that had already been written, which matches what you hit with the Luna subagent.

Could you give it another try and let me know if a finished command still leaves the wait hanging? If it does, fresh details here, including a request ID, would really help!

I had returned Luna to my subagent portfolio, so I will let you know.