Skip to content

fix(agents): deliver awaited background results to their owning tasks - #590

Merged
lastobelus merged 7 commits into
lastcode/mainfrom
lastcode/awaited-action-background-result
Nov 3, 2026
Merged

lastobelus merged 7 commits into
lastcode/mainfrom
lastcode/awaited-action-background-result

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

A remote child agent can finish its foreground turn while it is still waiting on a native background command. When that command left the native roster, the server settled the child's delegated task with the child's earlier "waiting" prose. The parent got that placeholder as the task result, and the command's real answer arrived later with no owner to receive it.

Fix

The delegated task now stays open until the command's actual answer is admitted as a continuation owned by that task. Each owner that is owed a result gets the full native answer, and a newer run is never adopted in place of the owed one.

This holds for:

  • stopped commands
  • mixed, late, and same-origin reports
  • canceled queued result turns
  • fresh and reused native task IDs
  • partially released wait batches

A result claim that a client forges or that cannot be attributed to an owner is rejected.

Fixes #579. Part of #482.

Review fixes

The Codex review findings are covered by regressions and repaired:

  • A retained independent thread should accept a fresh ordinary background wake, while results owed to a former delegation stay refused.
  • A background report from an old task A that arrives during a later ordinary turn B should still reach A's owner after B completes.
  • Releasing one wait from an offered batch preserves the remaining results. Releasing every claimed wait still drains buffered native output without keeping stale ownership.

Validation

  • Pinned source, before the checkpoint rebase: 610 tests across 16 changed files, 35 affected package typechecks, and Quick CI passed. This predates the review fixes above.
  • Final source d8577a392a5e, base 2a6026d96caa: all 617 tests across 16 changed files, 35 affected package typechecks, format/lint/dependency/GraphQL checks, Quick CI, and exact same-base checkpoint assembly passed.
  • Source runtime, single result (31 checks): one Action, one Action continuation, one native final answer, and one parent result, notification, and ACK, with no actor polling or relay. A forged claim over a real WebSocket connection was refused.
  • Terra xhigh source review: the earlier product review and fresh confirmations of the GitHub fixes are clean. Source review does not establish runtime acceptance.
  • Not passed: runtime acceptance for overlapping results. In the retained attempt, two owners were gated but the callback did not resume the parent before the SDK's background time limits. Both runs ended stopped, with owned and truthful outcomes, and no success marker was claimed.
  • Final GitHub gates: CI run 41592306528 passed on the exact head and base. Codex explicitly reported no major issues for d8577a392a5e; all review threads are resolved.

Carry

The topic commits are carried in the Incubator group because the delegated-ownership foundation they build on first appears there. The product code is unchanged by this grouping, and a local compile of the exact tree on the same base passes.

Boundaries

This source repair does not establish installed Phase 3 acceptance. Ordinary child-owned Actions stay gated, and Phase 4 has not started.

Implemented with GPT-6.1 Sol through Codex at xhigh effort, with implementation by Codex Sol at high effort; local source review by GPT-6.1 Terra at xhigh.

Co-Authored-By: OpenAI Codex [email protected]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T06:53:42.058612Z d8577a3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8c2ea95f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus force-pushed the lastcode/awaited-action-background-result branch from b8c2ea9 to da9f2d0 Compare November 3, 2026 06:22
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da9f2d0af5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Keep the exact originating task open across native roster removal and transfer its ownership when the matching result continuation is admitted.

Carry-Group: incubator
Carry-Fix: #579
Carry-Observation: Awaited native background results retain their originating task until the exact result wake is admitted.
Carry-Observation: This repair depends on the delegated ownership and native wake foundation assembled by Incubator.
Reject forged and unattributed claims, route mixed native results to each origin, and keep cancelled result continuations from restoring waiting prose as success.

Carry-Group: incubator
Carry-Fix: #579
… changes

Keep stopped-command result fences, transfer full native answers to mixed owners after completion, and distinguish fresh native task generations from stale frames.

Carry-Group: incubator
Carry-Fix: #579
Collect all reported owners through native completion, including notifications arriving after the initial wake offer or during its drain.

Carry-Group: incubator
Carry-Fix: #579
Keep late results from one originating run in its existing native answer, without prompting that owner again or releasing unrelated waits.

Carry-Group: incubator
Carry-Fix: #579
Allow fresh ordinary result wakes in independent threads while rejecting former delegation ownership. Capture owed native reports received during a later ordinary turn and deliver each exact owner after the real native terminal.

Carry-Group: incubator

Carry-Fix: #579
Reconcile pending native-result requests with their still-owed tasks instead of dropping a whole batch. Drain the buffered wake when all claimed tasks are released, and keep superseded requests from issuing duplicate continuations.

Carry-Group: incubator

Carry-Fix: #579
@lastobelus
lastobelus force-pushed the lastcode/awaited-action-background-result branch from da9f2d0 to d8577a3 Compare November 3, 2026 06:49
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: d8577a392a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit a3d55a7 into lastcode/main Nov 3, 2026
38 checks passed
@lastobelus
lastobelus deleted the lastcode/awaited-action-background-result branch November 3, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote Action tasks finish before their awaited background result

1 participant