Skip to content

fix(actions): agents can recover interrupted continuations - #779

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/action-continuation-recovery-tools
Nov 21, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/action-continuation-recovery-tools

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Problem

When an Action's process is lost (for example, an environment restart), its retained follow-up stays open and every saved Action in that thread is blocked. The composer has Resume agent and Discard buttons for this, but agents had no tool for it. An agent in that state could only report that it was stuck. Refs #681.

What changed

  • Two caller-only MCP tools: resume_interrupted_action and discard_interrupted_action. Both take no arguments and call the existing ActionResume service methods (resumeInterrupted, discardInterrupted).
    • Resume queues the retained result and follow-up, like Resume agent. It does not rerun the command. Resume now refuses when ended ownership disposes the retained follow-up instead of reporting false success. Delivery and rollback stay under the existing lock.
    • Discard drops the follow-up so new Actions can launch, like Discard. It does not record that the command succeeded.
  • Where each tool acts: only on the calling thread's own Action. A mediated Action is recovered in the parent's thread and a child-owned one in the child's.
  • Blocked messages point to recovery: the blocked list_project_actions reason and the action_already_running launch refusal now name the composer Resume agent / Discard and both tools. The list_project_actions tool description mentions both tools too.
  • Runbook: a short section in docs/internals/resumable-project-actions-setup.md, "An interrupted Action blocks new launches", linked from the existing disabled-listing troubleshooting entry.
  • Evals: three cases in evals/mcp-tool-use/cases/action-resume.ndjson: resume, discard then start a different Action, and an ordinary-work control.

What stays the same

  • Availability: recovery still works only while result delivery is available. It cannot clear a follow-up that is already running or pending.
  • Guards: owner obligations and permission guards are unchanged.
  • Evidence: inspect_action_run still shows the retained output and the lost outcome (process_lost).

Not covered

Context budget

The two recovery tools previously measured a 1505-byte catalog increase. CI now measures the proposed merge against its exact base; the agent-context-increase label is on the PR. This PR leaves the tracked budget snapshot unchanged for checkpoint regeneration.

Validation

  • Regression tests: the missing-tool regressions failed on base.

  • ActionResume suite: 65 passed on the fix, including an owner-ended recovery case that failed before the review fix.

  • vp run check:changed origin/lastcode/main: passed format, lint, knip, GraphQL and typecheck of 3 packages, plus 75 tests in 3 files.

  • Focused model evals (3 cases × 3 samples, gpt-6.1-sol at xhigh; tool replies are simulated):

    Case Before After
    Interrupted-recovery cases 0/6 6/6
    Ordinary-work control 3/3 3/3
  • Full MCP model eval: completed on 23ecb669431114b7001ff40d10db8f0223727280 with GPT-6.1 Sol at high effort and GPT-6.1 Terra as shell simulator. All 328 cases ran in 82 shards: 669 samples, 616 passed, 53 failed, 0 errored; 306 cases passed and 22 failed by majority. The three added recovery/control cases passed 6/6, and no other case called either recovery tool. The failures concern existing workflow, preview, native-agent and routing expectations. The closest Action ownership and background-wait failures also fail by majority on base with the same checks; the ordinary Action-launch control passes 2/2 on both. No full-suite pass is claimed.

  • Local review: finished with no blocker or should-level findings in the final round. Opus approved; Terra's two pre-existing persistence nits were moved to follow-ups.

  • Checkpoint replay: exact same-base compiled tree passed at 25120a5c9afdb03061fc62768188e3085ce6155a..c35619135a6763d5630a84c3e66fcd3342ad6bf5. The source commit stays in Incubator because its child-ownership lifecycle and eval fixtures arrive there.

  • Local Quick CI: two optional attempts were blocked by base advancement; no local Quick CI pass is claimed. Exact-head GitHub CI and Codex review remain required.

Local review: 3 rounds with GPT-6.1 Terra (xhigh) and Claude Opus 5.5 (high), approved.

The six reviewed source, test, doc and eval files are byte-for-byte unchanged after replaying only this PR's two commits onto checkpoint base 79923ec1bac55be01b61588a09424021b093771e. The budget snapshot matches the base, following #784. The scoped pre-push check passed on this head with 75 tests.

Nonblocking follow-ups from local review:

  • F1: keep the conservative destructive hint for queued agent work; no permission change.
  • F2: replay actual blocked-result wording in model eval fixtures.
  • F3: make ended-owner refusal copy more specific.
  • F4: pre-existing initial metadata-publication failure can leave delivery pending.
  • F5: pre-existing accepted-dispatch/failed-save path can offer discard after queueing.
  • F6: add direct failed-delivery rollback coverage beyond the busy/read-unavailable guard.

Implemented with GPT-6.1 Sol (xhigh) through the Codex harness; recovery wording by Claude Opus 5.5.

@lastobelus lastobelus added the agent-context-increase Intentional agent context growth approved by a maintainer label Nov 20, 2026
@lastobelus lastobelus changed the title fix(actions): let agents recover interrupted continuations fix(actions): agents can recover interrupted continuations Nov 20, 2026
@lastobelus
lastobelus force-pushed the lastcode/action-continuation-recovery-tools branch from 4184e0a to ae186c0 Compare November 20, 2026 07:15
lastobelus added a commit that referenced this pull request Nov 20, 2026
Inspect delivery in memory before releasing the Action mutex so an extra retained-state read cannot prevent rollback. Cover unavailable reads during a busy resume in the existing recovery table.

Carry-Group: incubator

Carry-Fix: #779
@lastobelus
lastobelus marked this pull request as ready for review November 20, 2026 07:30
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T21:10:15.631154Z 23ecb66 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

Copy link
Copy Markdown

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

Reviewed commit: c35619135a

ℹ️ 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/action-continuation-recovery-tools branch from c356191 to 7941d62 Compare November 20, 2026 07:39
lastobelus added a commit that referenced this pull request Nov 20, 2026
Inspect delivery in memory before releasing the Action mutex so an extra retained-state read cannot prevent rollback. Cover unavailable reads during a busy resume in the existing recovery table.

Carry-Group: incubator

Carry-Fix: #779
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 7941d629bd

ℹ️ 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/action-continuation-recovery-tools branch from 7941d62 to ac93d32 Compare November 20, 2026 08:11
lastobelus added a commit that referenced this pull request Nov 20, 2026
Inspect delivery in memory before releasing the Action mutex so an extra retained-state read cannot prevent rollback. Cover unavailable reads during a busy resume in the existing recovery table.

Carry-Group: incubator

Carry-Fix: #779
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ac93d32220

ℹ️ 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/action-continuation-recovery-tools branch from ac93d32 to 37b4a6f Compare November 20, 2026 08:26
lastobelus added a commit that referenced this pull request Nov 20, 2026
Inspect delivery in memory before releasing the Action mutex so an extra retained-state read cannot prevent rollback. Cover unavailable reads during a busy resume in the existing recovery table.

Carry-Group: incubator

Carry-Fix: #779
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 37b4a6f5ac

ℹ️ 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 added a commit that referenced this pull request Nov 20, 2026
Inspect delivery in memory before releasing the Action mutex so an extra retained-state read cannot prevent rollback. Cover unavailable reads during a busy resume in the existing recovery table.

Carry-Group: incubator

Carry-Fix: #779
@lastobelus
lastobelus force-pushed the lastcode/action-continuation-recovery-tools branch from 37b4a6f to 157ebb9 Compare November 20, 2026 11:07
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 157ebb9081

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

Expose caller-scoped resume and discard tools over the existing Action service, explain recovery in blocked-launch messages, and refuse resume when ownership disposal prevents delivery.

Carry-Group: incubator

Carry-Fix: #681

Carry-Observation: Recovery depends on the current child Action ownership lifecycle and model-eval fixtures added by Incubator. Keep this coupled behavior and its proof in Incubator so replay follows those implementations.
Inspect delivery in memory before releasing the Action mutex so an extra retained-state read cannot prevent rollback. Cover unavailable reads during a busy resume in the existing recovery table.

Carry-Group: incubator

Carry-Fix: #779
@lastobelus
lastobelus force-pushed the lastcode/action-continuation-recovery-tools branch from 157ebb9 to 23ecb66 Compare November 20, 2026 21:08
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 23ecb66943

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

Copy link
Copy Markdown
Owner Author

Full MCP model-eval coverage is complete for 23ecb669431114b7001ff40d10db8f0223727280.

  • GPT-6.1 Sol, high effort; GPT-6.1 Terra shell simulator; default 2–3 adaptive samples; two four-case shards in flight, four samples per shard.
  • 328 cases / 669 samples: 616 sample passes, 53 graded failures, 0 errors. 306 cases passed; 22 failed by majority.
  • New cases: interrupted resume 2/2; interrupted discard 2/2; ordinary work 2/2. Both recovery tools were called only in their intended cases.
  • Existing Action ownership failure: shell probing/unfinished handoff. Existing background-wait failure: omitted t3_background_wait. Neither involved a recovery call.

Same-model, same-effort baseline comparison on 79923ec1bac55be01b61588a09424021b093771e:

Existing case Base Fix
Direct Action launch 2/2 2/2
Ambiguous child ownership handoff 0/2 0/2
OpenCode background validation wait 1/3 0/2

The two failing controls fail by majority on both revisions, with the same failed checks. The full run's other failures concern pre-existing preview, native-agent, file-link, snippet, secret and thread-routing expectations. Their relevant source and fixtures are outside this PR's changes. They do not block the recovery fix.

The focused xhigh before/after proof remains recovery 0/6 → 6/6, ordinary-work control 3/3 → 3/3. Backend and authorization proof is separate: all 65 ActionResume tests and the 75-test scoped pre-push gate passed.

The full eval uses authored fake threads and simulated tool replies; it does not establish installed-app or device acceptance. No local Full CI, simulator QA or real-data validation was run. Refs #681; automatic lost-process notification remains open.

@lastobelus

Copy link
Copy Markdown
Owner Author

Local-review follow-ups filed: F2 → #801, F3 → #802, F4 → #803, F5 → #804, F6 → #805.

Not filed: F1 (keep the conservative Tool.Destructive hint on resume_interrupted_action, matching run_project_action_and_resume; no permission change). It records a decision with no work attached, so it stays here only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-context-increase Intentional agent context growth approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant