Repository navigation
🤖 refactor: split startReservedAgentTaskLeased, part 3: persist, refresh and sanitize - #7758
Conversation
…esh and sanitize The checkout persist, the row refresh after it and the sanitize step move into two steps that the method calls once, after the parent's runtime update. No behaviour change. - persistLaunchCheckout: the multi-project env resolver, the base commits read, the row write (status and attempt guard, the six fields, the shared flag cleared when a shared task had to fork), the metadata emit and the abort check, then the sanitize step. - sanitizeLaunchCheckout: the row refresh (gone: cleanup; no longer this starting attempt: end the init log), then the sanitize of a forked checkout. A sanitize error marks the checkout unsanitized and runs the reclaim try/finally as one block, then throws. The readLaunchRowBeforeSanitize closure becomes a method that takes the checkout record: it still marks a forked checkout unsanitized and ends the init log before it rethrows. The destructured checkout fields are gone: the steps read the readonly record built after the materialize step. The base commits read moves with the persist, not with the materialize step: the row write consumes it, and a returned value would add a microtask before that write. startReservedAgentTaskLeased: CC 46 -> 32. New: CC 7, 7, 3. --- _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. Another round soon, please! 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.3k tokens (27% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 14s · 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 · 20.3s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.4s · 2 targets (web, phone) · run artifacts |
Summary
Part 3 of 5. It moves the checkout persist with its base-commit read into
persistLaunchCheckout, and the row refresh, the sanitize and the reclaim try/finally intosanitizeLaunchCheckout. ThereadLaunchRowBeforeSanitizeclosure became a sync method. CC 46 → 32. Changed lines: 85.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 base-commit read stays in the persist step because the row write uses it: a step that returned it would add a microtask before the write. The sanitize still runs before the init and any send, and
readLaunchRowBeforeSanitizestill marks the checkout unsanitized before it rethrows.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$351.07