Skip to content

fix(agents): let paused child Action waits reach quiet and scope task cancellation - #568

Merged
lastobelus merged 7 commits into
lastcode/mainfrom
lastcode/paused-child-action-quiet
Nov 2, 2026
Merged

lastobelus merged 7 commits into
lastcode/mainfrom
lastcode/paused-child-action-quiet

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Two Phase 3 acceptance defects in child tasks that wait on resumable Actions:

What changed

  • Pause (fix(agents): paused child Action keeps its parent counted as active #563): the quiet check now follows known local child activity through nested waits. Real provider turns, input requests, running commands, user queues, and unknown, native, foreign or cyclic children still block quiet.
  • Cancellation (fix(agents): cancel delegated tasks during owned Action waits #567): cancel targets the exact task, its owned Action continuation and their descendants, under participant locks. A task that already finished returns its recorded status and no longer stops another round in its reused child. Background descendant cancellation retains the caller’s runtime and interaction limits and checks them again during execution. Owned provider runs with native/background work are interrupted even after their foreground turn has ended; unrelated queued rounds remain untouched.
  • Limit: cancelling a task revokes its continuation. It does not kill an external command that is already running; that command finishes on its own.

Verification

  • Tests: each repair has a regression test that failed before the fix. check:changed passed 406 tests in 17 files, plus affected typechecks, lint, formatting and unused-code checks.
  • Quick CI: passed for 56357cc15237221a39b9eeecc4fbb4a7acff97ad against base 8fdf46d754062fbd72d9e6c3a366f8bb0831df8e.
  • Local review: the initial repairs cleared local source review. The cancellation corrections have three lifecycle regressions, two permission-race cases and two waiting-background cases that failed before the fixes and now pass; exact-head Codex review passed with no major issues and zero unresolved threads.
  • Development QA (pause): Pause reached quiet, and a normal Resume used the same Action continuation.
  • Development QA (cancellation): a stable, non-watching development backend passed 22 checks:
    • cancelling the original task, and the command's eventual result being disposed
    • repeating the old cancellation, which left a newer task untouched
    • one automatic continuation and parent completion for the new round, with no command rerun
  • Checkpoint reconstruction: passed and reproduces the exact source tree.
  • GitHub: exact-head/base CI run 41380926658 passed. Codex review is clean with zero unresolved threads. Merged as 9e43355a289d736fdae027fa9848e6e256ca74a9; the merged tree matches the reviewed head.

Not covered

  • Installed 4016 reproduced both defects. Neither the development QA above nor this PR counts as installed-package acceptance.
  • Installed-package verification, matching native and remote checks, and the rest of the Phase 3 acceptance matrix remain open.
  • Phase 4 child PR watches are out of scope.

Fixes #563. Fixes #567. Part of #482, which stays open until installed acceptance is complete.

Implemented with GPT-6.1 Sol through the Codex harness; local source reviews used Codex Sol high. Description edited in a Claude Sonnet 5.5 writing pass (Claude Code).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-02T03:05:40.003398Z 56357cc 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

@lastobelus lastobelus changed the title fix(agents): recover paused and cancelled child Action waits fix(agents): let paused child Action waits reach quiet and scope task cancellation Nov 2, 2026
lastobelus and others added 4 commits November 1, 2026 18:45
Use the known local child activity when deciding whether a waiting parent still has active background work. Keep native, unknown, unrelated and cyclic children conservative, and preserve real input, command and user-queue blockers.

Carry-Group: incubator
Carry-Fix: #563
Carry-Observation: Requires the Environment Pause and delegated ownership integration in Incubator; those files do not exist in Resumable Actions. A paused child continuation keeps its logical task unfinished without constituting active execution.
Co-Authored-By: OpenAI Codex <[email protected]>
Recognize an ended provider turn with an outstanding owned Action as cancellable. Under participant locks, dispose that exact task obligation and cancel or interrupt its transferred continuation without stopping unrelated rounds.

Carry-Group: incubator
Carry-Fix: #567
Carry-Observation: Requires the Phase 3 task-owned Action ledger and continuation fences introduced in Incubator, so it must replay after that ownership core.
Co-Authored-By: OpenAI Codex <[email protected]>
Use the task-specific cancellation path even when Action intake transferred ownership before the MCP projection read. Cover queued and startup-admitted continuations beside unrelated active work.

Carry-Group: incubator
Carry-Fix: #567
Carry-Observation: Cancellation must use the same exact task fence before, during and after Action intake.
Co-Authored-By: OpenAI Codex <[email protected]>
Return the terminal app-owned task status instead of stopping another round in its reused child. Exercise repeated task_cancel with the same request ID beside unrelated active work.

Carry-Group: incubator
Carry-Fix: #567
Carry-Observation: A terminal task no longer grants cancellation authority over later child work.
Co-Authored-By: OpenAI Codex <[email protected]>

@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: 78eb289f72

ℹ️ 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".

Schedule the existing delegated-task cancellation worker for unfinished descendants owned by the cancelled task's source and continuation runs. Leave unrelated rounds and their descendants untouched, including when the owned continuation has already ended.

Carry-Group: incubator
Carry-Fix: #567
Carry-Evidence: #568 (comment)
Carry-Observation: Requires the Incubator task-owned Action ledger and exact run ownership. Three regressions fail without the scoped stop effect and preserve unrelated rounds.
Co-Authored-By: OpenAI Codex <[email protected]>
@lastobelus
lastobelus force-pushed the lastcode/paused-child-action-quiet branch from 78eb289 to 75e36a6 Compare November 2, 2026 02:07
@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: 75e36a6315

ℹ️ 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".

Persist the runtime and interaction ceiling on the owned Action descendant-stop effect and restore it in the worker before locked dispatch. Leave descendants running when their user raises either mode after cancellation was admitted.

Carry-Group: incubator
Carry-Fix: #567
Carry-Evidence: #568 (comment)
Carry-Observation: The task-owned Action cancellation path crosses the durable outbox; only serializable mode ceilings cross with it, never the caller's in-memory refusal reference. Worker regressions reproduce both runtime and interaction escalation races.
Co-Authored-By: OpenAI Codex <[email protected]>
@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: bbcdb6320a

ℹ️ 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".

Cancel queued or active runs of the exact logical task, and interrupt its ended or waiting runs when native/background work remains. Restrict background items to each owned run and do not attribute a reused provider roster to an older unrelated run. Preserve unrelated queued rounds.

Carry-Group: incubator
Carry-Fix: #567
Carry-Evidence: #568 (comment)
Carry-Observation: Waiting provider turns are not live runs, but their owned commands and native subagents can still need the existing scoped interrupt path. Both new regressions reproduce running work after cancellation without this fix.
Co-Authored-By: OpenAI Codex <[email protected]>
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 56357cc152

ℹ️ 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 9e43355 into lastcode/main Nov 2, 2026
25 of 38 checks passed
@lastobelus
lastobelus deleted the lastcode/paused-child-action-quiet branch November 2, 2026 03:24
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.

fix(agents): cancel delegated tasks during owned Action waits fix(agents): paused child Action keeps its parent counted as active

1 participant