You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8fe907f
Browse filesBrowse the repository at this point in the historyBrowse files
🤖 refactor: split createUnderTaskTreeLifecycleLock, part 3: sanitize, announce and send (#7704)
## Summary
Part 3 of 5: splits sanitize, announce and the launch send out of
`TaskService.createUnderTaskTreeLifecycleLock` in place, with no
behaviour change. The method drops from CC 88 to CC 78. On top of part
2. 94 changed lines. The moved code keeps its indentation, so git sees
few changes.
## Steps in this part
- `sanitizeTaskLaunchCheckout` still runs before the metadata emit.
- `announceAndInitTask` emits the metadata, reads the secrets, then
calls `registerExternalBackgroundInit`.
- `sendTaskLaunchPrompt` makes the send admission with no await before
it, in the same continuation as `registerExternalBackgroundInit`.
## Rules every part keeps
- The method keeps `await using _lock = await this.mutex.acquire()`.
Inside that scope, a bare `return promise` releases the global mutex
before the promise settles. So every call from the method to a step is
`await` or `return await`, and no step acquires the mutex, which is not
reentrant.
- The steps form a chain: each step calls the next one directly after
its own last await. So no collaborator call runs a microtask later than
in the inline code. Only the result of the method resolves later, at
approximately 2 microtasks per chain level. The mutex therefore releases
that much later, at the same logical point.
- `make crap-check` against the parent commit reports 0 violations, with
and without coverage. Every new function scores CC 8 or less.
- `bun test` on the taskService, ledger, workspaceTurnManager,
workflows, tools and workspaceService suites: 4,968 pass, 0 fail. These
suites include the 27 tests from #7701.
---
_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$182.90`_
<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=182.90 -->
0 commit comments