Repository navigation
feat(lastcode): wait for wrapped commands in the background - #831
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d58c41747
ℹ️ 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".
|
Hold for merge: a live pass on this head found that the Codex hold is not engaging. The cause is not in this PR. It is a regression already on |
Run finite LastCode scripts through one shell entry point and keep the owning Codex or Claude thread waiting when a command outlives the turn. Give opted-in Claude sessions the two-hour background default. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: Wrapped LastCode commands reuse the providers' native background result holds.
Register the shell-launched script with Knip, include its shared parser in the scripts typecheck, and follow the Node import conventions. Type the Claude launch settings with the SDK contract. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: The standalone wrapper is loaded by its shell launcher before workspace dependencies exist.
Exercise Codex auto-marking through roster updates and retained result admission or release. Verify Claude keeps an explicit release across a later roster snapshot. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: Wrapped commands must preserve the merged provider hold lifecycle.
Clarify that the main LastCode conversation owns the automatic wake and native subagents must collect their results. Recognize direct shell launches of the wrapper and preserve configured Claude defaults. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: An eligible wrapper must agree with the adapter's ownership rules and respect Claude configuration.
Only promise an automatic wake for standalone wrapper launches in the main LastCode thread. Tell agents to collect results from compound commands and native subagent launches. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: The instruction must match the shell shapes eligible for an automatic hold.
State that automatic wake advice covers a literal cd path without options or expansions. Exercise the excluded forms raised in review. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: Agent advice describes a subset of literal shell syntax accepted by the wrapper matcher.
Move the wrapped-command cases out of the upstream adapter suites. Reuse a recorded Codex turn and assert its terminal event arrives while the command remains awaited, then check result admission and release. Preserve Claude roster, release, and timeout coverage in the same fork-owned suite. Implemented with GPT-6.2 Sol in Codex. Carry-Group: incubator Carry-Fix: #824 Carry-Observation: Wrapper coverage belongs to the fork and verifies the provider boundary after the launching turn settles.
6d58c41 to
5887528
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Hold lifted. The regression on The failed |
Codex could drop the result of a command a thread was waiting on. If the command exited just before the marking turn ended, the result landed in the command item, and the thread and its delegated parent could finish before Codex saw it. ## What changed - **Owed results** stay pending until the turn's completion is saved, then go out through the existing continuation path. - **Automatic wraps** use Codex's token-usage notification to tell when the launch tool has returned and the shell is still running. Codex sends that notification after the batch's tools finish. - **Explicit marks** confirm on their own when `t3_background_wait` matches the command. - **Foreground commands** still get their result in the launch response. - **Unsuccessful turns**, including interruptions, clear the owed result. - **Instructions** now ask Codex for manual registration unless `lc-run` reports a registered wake. The `lc-run` launch line says LastCode already registered the wake and to end the turn without calling a tool. The standing instruction is 23 bytes shorter, and the wrapper prints the 316-byte launch line from the eval. The setting remains opt-in. ## Proof - **Adapter replay** failed before the fix on mark → command exit → turn completion. It now covers that order, automatic marking, duplicate completion events, a foreground exit, interrupted turns, and withdrawing the wait. - **Luna tool-use eval** passed 15 of 15 samples. The new wrapped case went from 0 of 3 passing to 3 of 3. - **Changed-file checks** passed across 6 files, including 273 tests. - **Recorded sessions** showed no token-usage update between launch and exit in all three foreground prepares. All three early exits from the eval had at least one update in that interval. - **Real-session acceptance** against the pushed head is pending. An automatically marked wrapper can still miss its wake if it yields and exits before the other tools in the same batch finish. Track that case in the #824 soak. Follow-up to #791, #831 and #832. Tracks #824 and convergence under #823. The same settled-turn condition is present in [upstream pingdotgg#37572](https://redirect.github.com/pingdotgg/t3code/pull/37572) at `5e048c23d68396b46e7a2e387755da157dd04bee`. Local review: 3 rounds with GPT-6.1 Terra (xhigh) at 02b382a, approved. Implemented with GPT-6.2 Sol in Codex. PR copy reviewed with Claude Sonnet 5.5 in Claude Code. Carry-Source-Ref: refs/lastcode/carry-sources/pr-833/02b382ae1173d8cc78425b824595e1d931f9592f Carry-Source-Base: 4e02407 Carry-Source-Head: 02b382a
Problem
Agents can keep a turn open by polling a long LastCode command. In the stand-in runs below, the same command used nine model requests unwrapped and three wrapped. Marking the result as awaited lets the agent end its turn and wake when the command finishes.
What changes
./scripts/lc-runwraps dependency preparation, checkpoint dependency preparation, Quick or Full CI, the checkpoint waiter, and local package builds from the agent's checkout.lastcodeBackgroundWaitEnabledgates automatic marking, the wrapper's wait instruction, and Claude's two-hour fallback timeout.Known limits
wait-checkpointobserves whichever supervisor run is active at the time.Validation
Local, on the rebased head
6d58c41747c3vp run check:changed origin/lastcode/mainpassed. It covered 825 tests and 43 package typechecks.Live evidence from
461b471f9a2, before the rebase./scripts/lc-run prepareran live. Full stand-in and live resultsLive verification still needs to cover the other four real operations and the rebased head, including the revised opening line for supported launches in the main LastCode conversation.
Provenance
Part of #824. Builds on #791 and the upstream Codex background-wait port at
5e048c23d68396b46e7a2e387755da157dd04bee.Local review: 3 rounds with GPT-6.1 Terra (xhigh) at 6d58c41, not clean.
Terra's last finding was addressed by narrowing the advertised directory prefix and testing the excluded forms. The subsequent Claude Fable convergence review confirmed that the fix closes the finding.
Implemented with GPT-6.2 Sol in Codex.