Skip to content

Translate duplicate environment path finalization into a stable error - #3234

Open
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3233
Open

Translate duplicate environment path finalization into a stable error#3234
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3233

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

Concurrent unmanaged workspace starts can create distinct environment rows whose paths remain null until host provisioning completes. When both successful results later resolve to the same project, host, and path tuple, the second metadata update crosses the database uniqueness index. The settlement exception was then persisted verbatim as the thread provisioning failure detail. The verified investigation is in the reproduction and root-cause report.

What changed

Environment provisioning settlement now recognizes only the named project/host/path uniqueness conflict and translates it into a stable server-domain error. The existing failure path still marks the losing environment and thread as failed; no lifecycle ownership, database schema, wire protocol, CLI, or public API changes were made.

The regression test creates two pathless unmanaged environments, settles both host commands to one path, and verifies that the losing thread receives the stable detail rather than database implementation text.

How you verified

  • Before the fix, the focused test failed with the raw three-column SQLite constraint detail.
  • After the fix, pnpm exec turbo run test --filter=@bb/server -- test/environments/environment-provisioning.test.ts passed all 12 tests.
  • pnpm exec turbo run typecheck --filter=@bb/server passed.
  • The complete server suite passed 2,251 of 2,252 tests. Its unrelated desktop-artifact assertion expected EISDIR but received ENOTSUP; the same failure reproduces on the clean base checkout.
  • git diff --check passed.
  • Changed-line count against origin/main: 131 total text lines (117 additions, 14 deletions) across two files.

Fixes #3233

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 reconnect retry can race environment finalization and surface raw UNIQUE constraint error

1 participant