Skip to content

Serialize complete host runtime ensure operations - #5355

Merged
SawyerHood merged 1 commit into
mainfrom
slopcop/issue-5354
Oct 11, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
slopcop/issue-5354

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

Host runtime replacement removes the resident environment entry before awaiting shutdown, while only creation is tracked as pending. An overlapping ensure can create a replacement that the original caller overwrites, leaving a live runtime outside manager ownership. The locally authored reproduction confirms both catalog and shell-generation replacement paths on trusted main in two clean checkouts.

Report: https://get-bb.github.io/reports/issues/5354.html

What changed

  • Track the complete ensure operation per environment, including skill resolution, compatibility checks, shutdown, and creation.
  • Wait for in-flight work and re-evaluate compatibility afterward; preserve shared provisioning cancellation instead of retrying cancelled setup.
  • Add a table-driven ownership regression checking runtime identity, creation count, and shutdown coverage.
  • Change only two existing host-daemon files: 90 changed text lines (90 additions, 0 deletions). No wire, API, schema, stored-data, dependency, packaging, or release changes.

How you verified

  • Before the fix at 3912f4aaefb7dff55c7e0cb5003b26b5cf1457dc, both new cases fail in two clean checkouts: three runtime creations instead of two, different returned runtime objects, and an untracked runtime never shut down.
  • pnpm exec turbo run test --filter=@bb/host-daemon -- --run src/runtime-manager.test.ts src/serial-lane.test.ts test/command: 157 tests pass across 11 files, including both regressions and existing provisioning cancellation.
  • pnpm exec turbo run typecheck build --filter=@bb/host-daemon: passes.
  • Formatting and git diff --check: pass; numstat confirms 90 text lines and no binary changes.
  • Broader host-daemon run: 759 passed, 4 skipped, 2 unrelated server-move failures. Both failures also reproduce on unchanged production code in the second checkout (32 tests: 30 passed, 2 failed); they are outside this fix.

Fixes #5354

AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host daemon: a second ensureEnvironment during a runtime swap orphans a runtime, so one thread runs two root turns at once

1 participant