Skip to content

Allow branch checkout after workspace threads are archived - #2069

Merged
ymichael merged 2 commits into
get-bb:mainfrom
hemaaanth:fix/archived-thread-checkout
Aug 25, 2026
Merged

ymichael merged 2 commits into
get-bb:mainfrom
hemaaanth:fix/archived-thread-checkout

Conversation

@hemaaanth

@hemaaanth hemaaanth commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

The physical-workspace checkout guard treated every non-deleted idle thread as a live workspace user, even after the thread was archived. Because archiving preserves idle status, a project could archive all of its threads and still be unable to create a new branch-backed thread in that workspace.

What changed

The host-path query now applies the existing live-thread predicate, which excludes archived and deleted rows, while retaining the starting, idle, and active status check that protects workspaces used by unarchived threads. The guard remains host/path-wide across projects and applies only when the request checks out a branch.

Focused in-memory SQLite coverage now verifies archived and deleted release, unarchive reclaim, all protected statuses, hidden threads, cross-project physical paths, and branch-checkout-only behavior.

How you verified

  • The deterministic in-memory harness reproduced the archived-idle refusal before the fix and returned no refusal afterward.
  • pnpm exec turbo run test --filter=@bb/server -- test/threads/workspace-path-claims.test.ts — 1 file, 7 tests passed.
  • pnpm exec turbo run typecheck --filter=@bb/db --filter=@bb/server — 5 Turbo tasks succeeded.
  • Actual web workflow in a disposable unmanaged Git project:
    • archived-only holder: branch-backed creation changed from HTTP 409 to HTTP 201;
    • unarchived idle holder: branch-backed creation still returned HTTP 409.

Fixes #2068

AGENT GENERATED

@ymichael
ymichael merged commit 3658617 into get-bb:main Aug 25, 2026
13 checks passed
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.

Archived idle threads block branch checkout after the workspace is released

2 participants