Repository navigation
Conversation
Move streamEndDecisionsByTaskId, deferredTaskStreamEnds and the methods that own them (runStreamEndHandler, deferChildStreamEnd, registerStreamEndDecision, findStreamEndDecision, findPendingStreamEndDecision, resolveStreamEndDecision, pruneStreamEndDecisions, reconcileDeferredTaskStreamEnd, resolveDecisionOfReportedAttempt) from TaskService into a new StreamEndLedger. TaskService builds it with call-time closures and calls small accessors for the turn loops of recordWorkspaceTurnSettled / Superseded and for the deferral reads in handleStreamEnd, clearTaskRecovery and the queue-change listener. The stream-end listener keeps its same-tick order. No behaviour change. Signed-off-by: Thomas Kosiewski <tk@coder.com>
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 (24% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 19s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 24.2s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 7.1s · 2 targets (web, phone) · run artifacts |
Summary
Moves the stream-end decisions out of
TaskServiceinto a new plain class,StreamEndLedger(src/node/services/streamEndLedger.ts). The move is move-only.taskService.tsdrops from 20,307 to 20,023 lines. PR 10, the last PR of the TaskService stop-and-attempt split, on top of #7678.Across this stack (#7674, #7675, #7677, #7678 and this PR),
taskService.tsgoes from 21,742 to 20,023 lines. The stop and attempt state now lives in three owner classes:TaskStopLatch,AttemptLedgerandStreamEndLedger.Implementation
streamEndDecisionsByTaskId(readonly, because tests read it) anddeferredTaskStreamEnds. The inline value type ofdeferredTaskStreamEndsis now the named interfaceTaskStreamEndDeferral, with the same fields and comments.runStreamEndHandler,deferChildStreamEnd,registerStreamEndDecision,findStreamEndDecision,findPendingStreamEndDecision,resolveStreamEndDecision,pruneStreamEndDecisions,reconcileDeferredTaskStreamEndandresolveDecisionOfReportedAttempt.recordWorkspaceTurnSettledandrecordWorkspaceTurnSupersededstay on TaskService. Their decision loops become onesettleTurn/rebindTurncall each, at the same position, so the order across the three owners does not change.handleStreamEnd,inspectAttemptOutcomeandreawakenInterruptedTask. A later plan covers these long methods.AttemptLedgerandTaskStopLatchclosuresfindStreamEndDecision,pruneStreamEndDecisionsanddiscardStreamEndDecisionsnow point atstreamEndLedgerthrough TaskService. The three classes never call each other directly.Validation
streamEndLedger.test.tshas 21 tests on fake deps. They cover:reconcileDeferredTaskStreamEndreconcileDeferredTaskStreamEndat CC 13 with 100 % line coverage.Risks
Medium-low. The stream-end decision says whether a child's last stream ended in a report. A wiring mistake would hold or drop a report, or hold a stop latch. The report-decision, settlement-receipt and child-goal suites pass, and they changed only their cast targets.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$68.74