Skip to content

fix(server): thread.turn.start bootstrap parity between websocket and http dispatch - #7996

Open
pablospe wants to merge 6 commits into
pingdotgg:mainfrom
pablospe:orc/http-bootstrap-parity
Open

fix(server): thread.turn.start bootstrap parity between websocket and http dispatch#7996
pablospe wants to merge 6 commits into
pingdotgg:mainfrom
pablospe:orc/http-bootstrap-parity

fix(server): http bootstrap failures report the rolled-back thread

a4ec449
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Correctness Check succeeded Aug 23, 2026 in 1m 19s

No issues identified (3 code objects reviewed).

• Merge Base: b1670ac
• Head: a4ec449

Details

File Path Comments Posted Reason
apps/server/src/orchestration/TurnStartBootstrap.ts 0
apps/server/src/server.test.ts Excluded by default ignore patterns
packages/contracts/src/environmentHttp.ts 0
apps/server/src/orchestration/http.ts 0
apps/server/src/ws.ts No code objects identified

Filtered Issues Details

apps/server/src/orchestration/TurnStartBootstrap.ts
  • line 366: The interrupt-only branch returns immediately without calling cleanupCreatedThread. If the request/fiber is interrupted after thread.create succeeds (for example an HTTP client disconnects while Git/setup work is running), the newly created thread—and possibly its worktree—remains even though no turn was started. The non-interruption path already makes cleanup uninterruptible, so this branch should perform the same rollback rather than bypass it. [ Previously rejected ]
  • line 369: cleanupCreatedThread only dispatches thread.delete; it never removes a worktree successfully created earlier in the bootstrap. If thread.meta.update, setup activity recording, or the final thread.turn.start fails after createWorktree succeeds, line 369 reports rollback while leaving the physical Git worktree and its branch behind. Retrying can then fail on the existing branch/worktree and repeated HTTP attempts leak directories; cleanup should track the created worktree and call gitWorkflow.removeWorktree as part of rollback. [ Previously rejected ]