Skip to content

fix(lastcode): align background-wait guidance and flag results lost on restart - #884

Merged
lastobelus merged 4 commits into
lastcode/mainfrom
lastcode/action-retirement-review-fixes
Nov 29, 2026
Merged

lastobelus merged 4 commits into
lastcode/mainfrom
lastcode/action-retirement-review-fixes

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Agent-launched Project Actions are being retired in favor of ./scripts/lc-run and background waits. The retirement changes left conflicting instructions, and some completed commands could lose the wake that delivers their result.

Refs #824.

🧭 A. Agent guidance and docs

  • Give Claude the wrapper exception, and tell agents when to end a turn, register a wait, or collect the result. Cover literal absolute wrapper paths (including for older checkouts) and simple command chains.
  • Describe the setting-off fallback and the handoff after a delegated child is refused an Action. Point agents with launch disabled to the shell command, and keep instructions for users who run saved Actions.
  • Keep the existing tool visibility policy, which hides the agent's discard tool when Action launch is disabled. The interrupted-run hint now says to use resume_interrupted_action to continue, or ask the user to choose Resume agent or Discard in the composer.
  • Update recovery alerts, packaging commands, and legacy docs in place.

⚙️ B. Wrapper and session behavior

  • The wrapper now exits nonzero when a step exits zero but reports attention or blocked.
  • Fallbacks use the shipped setting default.
  • Refresh only the Project Action instruction when a resumed Cursor conversation needs it, and remove unused ACP fields.
  • Document the shared-session inheritance. New Codex or OpenCode v2 threads that attach to a running shared session use that session's lastcodeBackgroundWaitEnabled setting until it closes. Active sessions can continue without reopening.

🧪 C. Evals and context budget

Both eval harnesses now use the shipped default and allow per-case overrides. Registered-wake cases take their wording from the wrapper. Context is measured against the default configuration. Compared with base 85bc79cb3ca, the Claude append is 265 bytes smaller, Codex context is 35 bytes smaller, and the MCP tool list is 4,960 bytes smaller.

Codex Luna subscription eval Passed
Old-checkout fallback 3/3 (2/3 on the baseline)
Refused-child handoff 3/3
Ordinary-work control 3/3
Ending the turn after the current wrapper message 3/3
Discard 2/3
Setting-off launch 2/3
PR-watch handoff with source-only capability 3/3
Accepted watch 3/3
Refused watch handoff 2/2 completed, one transport error
Unwatch before handback 2/3
  • All three source-only samples left the watch to the parent. All three owning-child handback samples unwatched, and one omitted the PR URL. In the final wrapper case, all three samples ended the turn without relaunching the command.
  • In the restart case, all three baseline samples tried to repeat a publication. All three samples of the revised note checked the recorded outcome and avoided rerunning it.
  • Claude not evaluated. The harness rendered Claude requests and verified the wrapper exception. The orchestration and adapter tests replay provider events.

📬 D. Background result delivery

  • Reproduced the pending-work gaps for owed Codex results and auto-registered Claude wrapper results. Those results now stay pending through delivery or release, with Codex replays for Stop, archive, and native unload.
  • Reproduced an owed result being lost on startup and shutdown when its provider thread was idle. Recovery now records the lost delivery. With Continue threads after restarts on (the default), it queues a wake for the latest settled run. If a task is listed as both pending and owed, the note uses its recorded label. The note asks the agent to verify the outcome before repeating work.
  • Replays check for one parent result after a normal completion wake on Codex and Claude, and after a restart on Codex.

Deferred follow-ups

  • Automatic wake delivery for an owed result on provider exit.
  • Automatic wake recovery after a later failed run.
  • The ordinary unawaited Codex late wake, which predates the retirement. The Codex replay reproduced it but stopped short of a two-result delivery replay.
  • Claude's manual-wait probe behavior, which also predates the retirement.

Every captured Claude Bash start carried a tool-use ID, so the claimed gap for a missing ID remains unproven.

🔎 E. Checkpoint drift check

The drift check now accepts null GitHub comment bodies. If it can't complete, it logs a prominent warning and the checkpoint continues.

↔️ Divergence from the upstream import

Upstream PR 37572 remains pinned at bfcb55dc7fc10958e4386473a16a16b6a03f6ca2. Codex now retains the owning native turn while a LastCode result is owed, counts it in pending-work checks, and retires it on Stop, archive, or native unload. These changes apply to LastCode's owed-result lifecycle and preserve the upstream wire protocol. Convergence remains tracked in #823.

Local review: 3 rounds with GPT-6.1 Terra and Gemini 4 Neon (xhigh) at e7dc699, not clean. The final round requested changes. A follow-up design review narrowed the recovery scope to the tested server-restart path. The GitHub review follow-up removed the provider-exit cleanup so a stored owed result can reach server recovery.

Implemented with GPT-6.2 Sol in T3 Code with the Codex harness.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 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-29T01:14:44.475711Z 6c2443d 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: e7dc699f92

ℹ️ 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 changed the title fix(lastcode): preserve background waits through completion and recovery fix(lastcode): align background-wait guidance and flag results lost on restart Nov 28, 2026
@lastobelus
lastobelus force-pushed the lastcode/action-retirement-review-fixes branch from e7dc699 to d21ef72 Compare November 28, 2026 04:35
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: d21ef72bfa

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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 84b5232188

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

Make lc-run report failed steps as failures and align agent instructions with the wait and Action tools each session has. Exercise the shipped default and current wrapper wording in the evals.

Retain owed results until delivery or release. Recover undelivered results on server restart and ask agents to verify the recorded outcome before repeating work. Report incomplete upstream drift checks in checkpoint output.

Carry-Group: incubator
Carry-Fix: #824
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/37572 at bfcb55d
Carry-Observation: The wrapper, background-wait port and checkpoint drift hook already replay together in Incubator.
Implemented-with: GPT-6.2 Sol in T3 Code with the Codex harness
Keep provider release handling on its existing path so an owed result remains available to server recovery. Replay the captured Claude sessions with wrapper-registered waits disabled to match their recorded query options.

Carry-Group: incubator
Carry-Fix: #824
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/37572 at bfcb55d
Carry-Observation: The changes cover the existing Incubator background-wait behavior and its replay fixtures.
Implemented-with: GPT-6.2 Sol in T3 Code with the Codex harness
Keep the shared PR-watch instructions that Muse replays expect. Refresh the default context budget with that wording in place.

Carry-Group: incubator
Carry-Fix: #824
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/37572 at bfcb55d
Carry-Observation: This preserves the shared watch instructions used by the existing Incubator providers.
Implemented-with: GPT-6.2 Sol in T3 Code with the Codex harness
Shorten repeated PR-watch instructions and put the registered-wake exception first. All three default context measurements are below the current CI base.

Carry-Group: incubator
Carry-Fix: #824
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/37572 at bfcb55d
Carry-Observation: Keep the watch ownership checks and trim their repeated wording.
Implemented-with: GPT-6.2 Sol in T3 Code with the Codex harness
@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: 6c2443d001

ℹ️ 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 96e9647 into lastcode/main Nov 29, 2026
25 checks passed
@lastobelus
lastobelus deleted the lastcode/action-retirement-review-fixes branch November 29, 2026 01:26
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.

1 participant