GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — refactor(server): one completion decision for both cohort owners by tannerpolley · Pull Request #471 · tannerpolley/t3code Conversation
|
| Case | Test |
|---|---|
| Concurrent siblings | restart recovery adds a second worker to a queued {run,thread}-owned delivery and settles both: a second worker joins the queued wake without a new message ID or generation |
| Restart at pending / claimed / delivered | Same test: the second worker is finished-but-unpublished at restart; the first is reserved with no dispatched wake (one offer, same ID and generation); the delivery run ended before the listener attached; a further restart offers nothing and leaves exactly one delegated message |
| Explicit result read | a {observed,late} result read of a {run,thread}-owned task settles its queued wake only when seen. An observed read acknowledges and cancels the wake. A late read leaves the result claimed in the queued wake. |
| Stopped, archived or deleted parent | a {run,thread}-owned worker that finishes after its parent was {archived,deleted,stopped}. Archived and deleted give disposed with no offer. A stopped run cohort gives disposed. |
| Old-format fixture | The same test's thread-owned stopped case is the pre-#418 whole-mailbox stop. It reopens, and the result is reserved and offered with one message ID and generation. All fixtures are committed events, recovered by recoverDelegatedTasks. |
| Failed workspace preparation | a {run,thread}-owned worker whose workspace preparation fails wakes its parent with the failure: real defer_start then prepared-run.fail; waits on the persisted subagent.updated event |
| Untagged descendant wake | Owner-independent child-side logic, already covered: DelegatedCompletionDelivery.test.ts "holds a follow-up open while the child's own subagent still runs" |
| Background task (#350) | Already covered: "finalizes a child whose run ended before a background command / nested subagent settled", "... keeps while an unawaited background command runs" |
No sleeps: tests use committed events, recoverDelegatedTasks, and persisted-event streams.
Failing first. Before the fix, a late result read of a thread-owned task … failed with expected 'acknowledged' to equal 'claimed'. The run-owned variant passed. After the fix, all 35 tests in the file pass.
One changed expectation. ThreadLaunchService.repositoryHandoff.fork.test.ts sent an unobserved acknowledgement to an idle root, which has no run, and expected the result to leave the root's wake. That encoded the defect. It now expects the result to stay in the wake.
Runs (agent-heavy, Node from vite-plus fallback-bin):
IssueCommentEffects files gave 81/81. Files:
.fork copy;.fork copy;vp run check:changed: format, lint, both knip runs and GraphQL pass. Tests: 118 passed across 7 files.
scripts and evals pass. apps/server fails only on McpHttpServer.test.ts(1711) (TS2375/TS377004), in a file this PR does not touch. Restoring origin/main's versions of all six changed files reproduces the same two errors.df594d7fcb (PR fix(server): tool-hiding test provides the issue services it needs #473).Footprint: whole-file Orchestrator.ts numstat. These are fork totals, not issue-only counts.
| Upstream base | Before (main) +/− | After +/− |
|---|---|---|
7d32075e37 (plan pin) |
1690 / 775 | 1671 / 771 |
b387e3a179 (newest sync, #469) |
1497 / 687 | 1478 / 683 |
ForkDelegatedCompletion.ts: +16 / −90. The other five shared files are unchanged.
What remains, and which step owns it:
Orchestrator.ts keeps the cohort-owner accessor (completionCohort/completionCohortEvent) and the null-parentRunId branches the persisted thread cohort requires.recoverDeletedChildren still reads all of a recovering parent's subagents at startup. It was not in the two reads flagged in Server event loop stalls for up to 11 s every few minutes, and every request in flight stalls with it #367, so it is left as is.Door: two-way. No migration and no persisted-format change. Rolling back restores the old late-read behavior.
Blast radius: delegated result hand-back for run-less managed workers. A late, unobserved read no longer acknowledges a result, so the parent sees it through its wake instead. Live userdata was not read or copied, and no dev server was started.
Implemented with Claude Opus 5.5 through the Claude Code harness in T3 Code.
🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Issue closeout moves from ForkDelegatedCompletion into IssueCommentEffects. The "result still owed work" decision behind task_status, wait and the parent wake now has one owner (ForkDelegatedCompletion.taskResultPending). Finalize reuses delegatedCompletionPlanEvents instead of an inline copy. Fix: a late, unobserved result read of a thread-owned (run-less managed) task acknowledged it and dropped it from the queued wake. It now follows upstream's late-read rule for both owners. Narrows reads: run-less admission reads only the parent thread row, reuseManagedChild reads only the current owner's task, and the closed-child pending check reads only this task. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
#418 step 3: Unify managed completion and restart recovery with upstream delegation
There was an error while loading. Please reload this page.