Repository navigation
🤖 refactor: split startReservedAgentTaskLeased, part 2: background init - #7757
Conversation
The init block of the reserved launch moves into two steps that the method calls once, after the sanitize step. No behaviour change. - initReservedLaunchWorkspace: a shared parent checkout logs the skipped init and goes on to the admission. A forked checkout reads the secrets, rechecks the abort signal, then hands over to the next step. - registerReservedLaunchInit: the other three rechecks after the secrets await (the strict row read, the status and attempt, the pendingRemoval mark with its cleanup and throw), then registerTaskBackgroundInit and the admission step. The shared branch now returns after its own call to the admission step, instead of an if/else that falls through to that call: the same statements run in the same order. registerTaskBackgroundInit gets the readonly checkout record; it reads only the four fields the old literal held. Each step calls the next one right after its own last await, so the four rechecks, the registration and the admission still run in the tick of the secrets await. startReservedAgentTaskLeased: CC 54 -> 46. New steps: CC 4, 6. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Codex Review SummaryThis 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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 46.2k tokens (28% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 16s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.0k tokens (32% cached) All 3 tests in 3 files
e2e 0.20.0 · 21.7s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.9s · 2 targets (web, phone) · run artifacts |
Summary
Part 2 of 5. It moves the init branch into
initReservedLaunchWorkspace(a shared checkout skips the init; a forked one reads the secrets and checks for a cancel) andregisterReservedLaunchInit(the strict row read, the status and superseded check,pendingRemoval, thenregisterTaskBackgroundInit). CC 54 → 46. Changed lines: 123.No behaviour change: same calls to other methods, same awaits, same order. A script inlines every step and compares the call, await, write, return and throw sequence with the parent commit: identical at every part (it caught
voidforawait, a moved statement and a dropped await in its self-test). Each new step has CC 7 or less, with 100 % line coverage.startReservedAgentTaskandmaterializeReservedTaskWorkspaceare still method calls, so the tests that spy on them still apply. The steps form a chain: each step calls the next right after its own last await, so no write, admission or send moves a microtask later.Implementation
The four rechecks still run after the secrets await and right before the init registration.
registerTaskBackgroundInitnow gets the checkout record and reads the same four fields.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$351.07