Repository navigation
🤖 refactor: share the task launch blocks between the reserved launch and task creation - #7752
Conversation
…and task creation startReservedAgentTaskLeased and the createUnderTaskTreeLifecycleLock steps repeated five launch blocks. Each block is now one function that both paths call, with the same calls in the same order and no new or removed await: - registerTaskBackgroundInit: the abort controller and the registered runBackgroundInit (announceAndInitTask, and the reserved launch after its pre-init rechecks). Sync. - taskForkOptions: the orchestrateFork options. The reserved launch (materializeReservedTaskWorkspace) and buildTaskForkOptions pass their own source runtime and create-fallback trunk branch. Sync. - readTaskBaseCommits: the old readTaskBaseCommitShaByProjectPath, now taking the plan and the checkout and also returning the parent project's SHA, so neither caller repeats the eight fields or the lookup. Still one await at each call site. - launchAdmissionRefusalMessage, launchSendErrorMessage: the refusal and send failure messages. Not shared: the secrets read (one expression), the sanitize block (an awaited helper would run the reclaim or failTaskLaunch a microtask later), and the six row keys (a spread would reorder the keys of the row createUnder persists). --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
|
@codex review |
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: Didn't find any major issues. Keep them coming! 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 (28% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 18s · 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 · 19.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.3s · 2 targets (web, phone) · run artifacts |
|
@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. |
Summary
The reserved task launch (
startReservedAgentTaskLeased) and the task creation steps undercreateUnderTaskTreeLifecycleLockrepeat five blocks. This PR moves each into one shared function that both call, with no behaviour change. It is the shared-helper PR of stack 10, as decided in the "TaskService recovery and launch path plan" (one helper PR before the split).startReservedAgentTaskLeasedgoes from CC 65 to 60. Changed lines: 291.The shared functions
registerTaskBackgroundInitAbortControllerandregisterExternalBackgroundInit(runBackgroundInit(...))announceAndInitTasktaskForkOptionsorchestrateForkoptions; callers pass the source runtime and the preferred trunk branchmaterializeReservedTaskWorkspacebuildTaskForkOptions(keeps its trunk-branch rule)readTaskBaseCommitsmaterializeTaskCheckoutlaunchAdmissionRefusalMessagesendTaskLaunchPromptlaunchSendErrorMessagesendTaskLaunchPromptNot shared, on purpose
config.jsonis written in.Validation
readTaskBaseCommitsis the old reader, reshaped, not wrapped. A wrapper would add an await. Task creation now builds thebaseobject once, beforeeditConfig, instead of inside its callback. The callback only reads it.make dry-checkfinds no new duplicates.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$342.36