Repository navigation
Conversation
PeerSendParking owns the peer messages parked behind a root's delegated workspace turn (#4997), their per-target flush locks and the delegated-turn registration epochs (#5271). Move-only: the bodies of parkPeerSend, scheduleParkedPeerSendFlush, flushParkedPeerSends and onWorkspaceTurnRegistered are unchanged. TaskService keeps onWorkspaceTurnRegistered (TaskHost) and a private flushParkedPeerSends facade, because tests spy on it; the scheduled flush and the drain's sendTreeMessage call back through TaskService closures so spies see every call. sendTreeMessage, the broker's queue-cap count and the user-Stop drop use small accessors.
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. 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.2k tokens (28% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 9s · 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 · 23.2s · 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 |
Summary
Moves peer sends that wait for a delegated turn (
parkedPeerSendsByTarget,parkedPeerSendFlushLocks) and the turn registration epochs (workspaceTurnRegistrationEpochs) into a newPeerSendParkingclass (peerSendParking.ts).taskService.tsloses 99 lines in this layer.Background
PR 2 to 5 of the TaskService split stack (#7665 is PR 1). Each layer moves one group of TaskService state and the methods that own it into a plain class that TaskService builds in its constructor. The rules are the same in every layer: public methods stay on TaskService as one-line facades, methods that tests spy on or patch stay reachable on TaskService and the new class calls them through call-time closures, and tests that cast a moved field change only the cast target. No behaviour changes.
Implementation
parkPeerSend,scheduleParkedPeerSendFlush,flushParkedPeerSends,onWorkspaceTurnRegisteredand theParkedPeerSendtype.flushParkedPeerSendsstays on TaskService as a private facade, because six test sites spy on it, mock it or bind it. The class's scheduled flush calls it back throughdeps.flush, so the spies see every flush.sendTreeMessage(also spied) is a closure too.onWorkspaceTurnRegisteredstays public on TaskService (TaskHost needs it).countParked(the peer-message broker's queue cap),hasParkedandremoveRetry(sendTreeMessage),registrationEpoch(the 🤖 Delegated-turn peer delivery: drain drops the rest on a replacement turn; fix stale task_send_message sentence #5271 retry gate),dropParked(markParentWorkspaceInterrupted).TreeMessageSpecandPeerDelegatedTurnWaitare now exported types fromtaskService.ts. The new file imports them asimport type.taskService.peerLimitsRepro.test.tschanges its cast target. The newpeerSendParking.test.ts(11 tests) covers park order, holds while a registration or stop is live, the stop baseline, dropped retries,dropParkedduring a drain, and a send parked during a drain.Validation
make static-check,make lint-eslint: pass.make crap-check:flushParkedPeerSendsis CC 11. The new test covers all 78 lines of the file, so its CI CRAP score is 11 (limit 15).make dry-check:onWorkspaceTurnRegisteredmatches two existing per-key counters. Adry-duplicate-ok:marker says why they stay apart.??→||survivors, marked.Risks
Low. Park first, then schedule, and one flush at a time per target, as before.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$53.33