Grok Bot Local Execution: background Shell exits but agent chat often not woken (silent miss)

Where does the bug appear (feature/product)?

Grok Bot

Describe the Bug

Grok Bot (Local Execution / background Shell wake). Same wake/resume failure class as Cursor Agent background Shell/Task.

We hang long-running commands with Grok Bot Local Execution Shell using block_until_ms: 0 (correct usage; no nohup/disown). The Shell often exits 0 and writes full output, but the owning agent chat is frequently NOT woken. There is no toast and no automatic continue—silent miss. We only discover it via a reconcile that compares terminal ended_at vs agent wake.

This matches the known rough edge where background completion should wake the parent chat but sometimes doesn’t (toast “couldn’t resume”, or worse: UI shows Finished with no agent resume).

Steps to Reproduce

  1. In a Grok Bot agent chat, start a Local Execution background Shell (block_until_ms: 0) that blocks until an external job finishes (ours: codexui wait <session> --from <offset>, often 1–20+ minutes).
  2. End the agent turn; leave the chat idle (often with several parallel background waits on busy bots).
  3. When the Shell exits 0, observe whether the agent is woken with the completion.
  4. Frequently: process/tee already finished, but no wake within 5+ minutes (silent). Sometimes a late follow-up appears many minutes later.

Expected Behavior

When a Local Execution background Shell exits, the owning Grok Bot agent chat should reliably wake and continue (same contract as documented background Shell completion), including when the chat has been idle and when multiple background shells are outstanding.

Operating System

MacOS

Version Information

macOS (Apple Silicon Mac mini), Grok Bot Local Execution against that machine.
Exact Grok Bot About version was not captured for this report.

Additional Information

Additional Information / data (2026-10-29 Asia/Shanghai, one workday)

  • ~111 ended waits sampled that day: reconcile ok≈61 / miss≈44 / miss_or_late≈5 (miss = ended >5 min with no timely wake).
  • Many “ok” are only proxies (same-thread follow-up wait within 5 min, or inherited prior reconcile)—true immediate wake rate is worse than ~55%.
  • miss_or_late observed delays ~6–16 minutes.
  • Short waits (median ~1–2 min) also miss; not only hour-long jobs.
  • Misses cluster on bots with many parallel long waits, but usage is the supported Local Execution path.
  • Workaround we use: 15-minute reconcile + manual re-notify. Detached nohup is explicitly unsupported for wakes.

Related (please track together)

Staff on those threads already call this a known tracked wake/reattach issue. We are reporting the Grok Bot Local Execution surface with quantitative miss rates.

Does this stop you from using Cursor / Grok Bot?

Sometimes — product usable, but background Shell completion is unreliable enough that we cannot depend on it without an external reconcile.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Following up on my report above, and I want the severity to be explicit.

I just subscribed to the top-tier X Subscription Ultra. I planned to use Grok Bot as my main orchestrator for local long-running work on my Mac mini (Local Execution Shell, block_until_ms=0).

Cloud Agent wake works. Local Execution background Shell often exits 0, but the owning agent chat is not woken. It is a silent miss: no toast, and the turn does not continue. That blocks me from continuing after a local Codex run, cursor-agent, or any other tool I waited on.

This is the same class of failure as Error resuming chat after long background Shell finishes (Request ID 57b6008d-8c6b-4cce-86ac-59caf380ce4c) and Error resuming chat after background Task finishes (Multitask / subagents) — Request ID 826cd8d6-4508-47b6-b438-11dfa6395d63. It has been known since about 2026-07-22. The Shell path is still broken about three months later.

On a busy day of parallel waits I measured about 40%+ silent misses. Late wakes showed up 6–16 minutes later. Short waits miss too, not only long ones. The hang itself is correct: I am not using nohup or disown.

Please treat Local Execution completion → wake as P0 orchestration breakage, not a cosmetic rough edge. I need a reliable wake, or an official completion webhook like Cloud Agent.

Hey @jjhbest001, thanks for the detailed numbers.

For now, don’t count on a Local Execution background command to wake the bot after its turn ends:

  1. Short jobs: have the bot wait in the same turn, with a block_until_ms that covers the job or an explicit wait on the command (worth adding to its instructions).
  2. Long jobs: keep your reconcile, or message the bot when a job finishes and it’ll pick up the result.

Your setup is fine. This is an issue we’re tracking, and we’ve let the team know about your completion hook idea. I’ll post here when there’s an update.

Quick update on my workaround — would love a sanity check from the team.

I tightened the reconcile so empty wakes don’t burn tokens anymore:

  1. Each Local wait writes a tiny completion stamp on disk when it ends.
  2. A LaunchAgent watches the stamp folder → near-real-time reconcile → only if to_push do I Bearer-POST the owning bot’s webhook routine (direct to that principal, not a shared Grok poller).
  3. Dedup via: “already pushed” ledger + flock across realtime/backup paths + handled stamps when work is done without rehang + ~5 min rehang window counted as ok.
  4. Backup path: system timer ~every 30 min, only stamps ended ≥ ~5 min (aligned with my miss threshold). My Grok cron pollers are paused — steady-state miss recovery costs ~0 Grok tokens.
  5. A daily low-frequency review of the ledger (exception-only brief to me).

Why this helps until native wake is fixed:

  • Correct hang path stays (block_until_ms: 0, no nohup).
  • Misses get recovered without chatting the bot every few minutes.
  • Empty stamp floods no longer wake a Grok routine “for nothing.”
  • Day-to-day ops for this path are effectively token-free; I’m not paying Ultra quota just to babysit silent misses anymore.
  • Still second-best vs a reliable Local Execution completion → wake (or an official completion hook like Cloud Agent).

If this pattern looks sound, a cheeky ask: before this design landed, I burned a painful amount of Ultra quota on inefficient polling — staring at whether waits had gone silent — not mainly on building the system (that’s a smaller slice). In a bit over a day that alone chewed through ~70% of my weekly allowance, which hurts. Any chance of a one-time usage reset as a “community bug-tax rebate”? Totally fine if not; the real fix is still reliable wake. Happy to share more detail if useful.

Follow-up: I open-sourced a small on-box helper for this class of problem — when an agent coordinator hangs a long local command and never gets woken after the shell exits.

agent-wait-guardian writes completion stamps and runs on-box reconcile + webhook wake. Works with Codex, cursor-agent, or any CLI behind a coordinator.

Sharing in case it helps others while the product-side wake path is being tracked.