[Bug]: Grok unpolled early completion publishes an empty continuation instead of the final answer#22865

opened7d agoby33xcalibur-tech

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Summary

Follow-up to #22341, split as requested in its closure comment. This report covers only unpolled background commands that finish before the root prompt settles. Fresh live tests on a nightly containing #22709 reproduced missing final-answer delivery in 3/3 trials (two successful commands and one intentionally failing command).

The child completes and the parent is notified, but the published result says “Child task completed without an assistant result.” The child's actual answer remains in its root transcript and is repeated in a later run.

Steps to reproduce

From an active parent thread, call delegate_task with mode: "async", isolation: "shared", full access, target grok / grok-4.7, and options: { "reasoningEffort": "low" }. Use this task:

Use only your native terminal tools. Do not inspect or modify repository files or delegate.

  1. Run sleep 5; echo EARLY_BG_DONE as a background command.
  2. Then run sleep 15; echo FOREGROUND_DONE as a foreground command and wait for it.
  3. Do not poll, read, or kill the background task, even after its completion notification.
  4. Reply exactly EARLY_SUCCESS_DONE and end your turn.

Wait for the automatic parent notification, then compare task_status with the completed child transcript.

The live probes used unique T3_3473_… markers instead of the neutral markers above. Grok followed the steps: exactly the two requested shell tools, no poll/kill, and the background completion occurred during the foreground wait. One additional trial used sleep 5; echo EXPECTED_BG_FAILURE; exit 7; the command correctly projected as failed, but the delegated answer was lost in the same way.

Expected behavior

The parent notification and published task_status.summary retain the child's final answer. A later background continuation with no assistant message should not make the task report that no answer was supplied.

Actual behavior

All three trials produced the same sequence:

  1. Run 1 completes with the requested final assistant answer.
  2. A background continuation, run 2, is already queued before run 1 completes its checkpoint. Run 2 later completes with reasoning but no assistant message.
  3. The subagent_result transfer points to run 2, with no turnItemId. The parent receives the empty-result placeholder.
  4. Run 3 repeats the requested final answer, but the published summary stays the placeholder. At the final read, latestTerminalSummary exposes the run-3 answer.

Example final response, after all child runs settled:

json
1{
2 "status": "completed",
3 "workState": "result_available",
4 "hasPendingChildRuns": false,
5 "summary": "Child task completed without an assistant result.",
6 "latestTerminalStatus": "completed",
7 "latestTerminalSummary": "T3_3473_EARLY_SUCCESS_1_DONE"
8}

The original automatic notification contained only the placeholder. No Stop, task_cancel, follow-up steering, or server restart was needed or used. This is result loss, not a stuck-running task.

Impact

Major degradation or frequent failure

A parent consuming the automatic completion or stable published summary loses the child's answer even though the work finished successfully. The later answer can be recovered through latestTerminalSummary in these probes, but that does not repair the original notification or published result.

Version or commit

Installed desktop 0.1.2-nightly.20261021.3473, embedded commit 1688f965682d331da16a8c39f049592361f69c8d.

Verified that #22709's merge commit 163bdeaa119f32bf92f25d2841048b808df542a5 is an ancestor of this build. These are real runs on the updated installed server.

Environment

October 21, 2026, macOS desktop, Grok CLI 1.0.62 (1474f9cbdd91) [stable]. Parent: codex / gpt-6.1-sol. Children: grok / grok-4.7, reasoning low, full access, shared checkout, async delegation.

Logs or stack traces

One successful-background trial, UTC on October 21, 2026:

text
112:04:09.495 Grok task_backgrounded
212:04:11.755 T3 foreground command started
312:04:14.574 Grok task_completed, exit_code=0, will_wake=true
412:04:26.842 T3 foreground command completed
512:04:29.926 Grok root turn_completed, end_turn
612:04:29.930 T3 run 2 queued
712:04:30.010 T3 run 1 completed; T3_3473_EARLY_SUCCESS_1_DONE present
812:04:30.878 T3 run 2 started
912:04:37.649 T3 run 2 completed; reasoning, no assistant message
1012:04:38.048 subagent_result published from run 2, without turnItemId;
11 parent receives the placeholder
1212:04:40.425 T3 run 3 queued
1312:04:40.831 Grok task-completed-<id> native wake turn_completed
1412:04:43.744 T3 run 3 completed; T3_3473_EARLY_SUCCESS_1_DONE present

The other two trials also selected empty run 2: transfer published at 12:04:40.463 and 12:04:44.557 UTC. Both later completed run 3 with the requested answer. Every run and command was terminal, and there were zero pending/running timeline items at the final check.

Evidence combines native Grok lifecycle timestamps, read-only T3 projections, actual task_status responses, and the automatic parent notifications. No synthetic projection writes were used.

Scope and related work

#22709 explicitly left the missing Grok result text out. Its fixed cases were separately verified on this same build: killed-background commands delivered the correct answer 3/3, already_exited 1/1, and auto-backgrounded call-… command plus output poll 1/1. Full results are reported on #22341. Those fixed triggers are outside this report.

The remaining behavior matches the source path described in #22341: a queued non-monitor continuation delays original task publication, latest terminal run selection picks its empty result, and the published task result remains stable when a later run supplies the answer.

Workaround

For these probes, read task_status.latestTerminalSummary after the later wake finishes, or use t3_thread_read to recover the root final answer. Reading the stable summary again continues to return the placeholder.