You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Archived threads cannot resume in the original chat #1710
A user accidentally archived a thread that contained substantial work. The thread then showed Environment archived, and the user could not continue the original chat.
The current state gives the user no direct recovery path in that conversation.
Expected result
The user can unarchive or otherwise recover the thread and continue the conversation without losing its context.
Root cause (short): Archiving the last live thread of a managed worktree retires the environment and, after the 5-minute grace window (PR feat(environments): add a lossless archive grace period #1016), the daemon runs git worktree remove --force and the environment becomes the terminal destroyed state; from there the app hides Unarchive/composer/handoff, unarchive only clears archivedAt (thread becomes live-but-unwritable, send -> 409 thread_environment_unavailable), fork is rejected, and no route/CLI can attach a new workspace to the thread — the deferred "continue from destroyed environment" path was never built.
Proposed fix: Server: add POST /threads/:id/restore-environment for threads whose managed-worktree environment is destroyed — create a new managed-worktree environment on the same host with baseBranch = old environment's branchName (the logic resolveForkEnvironment already has), updateThread({environmentId}) (DB layer supports it, emits environment-changed), let normal provisioning build the worktree, verify/fallback provider session resume with the new cwd. App/CLI/SDK: in the environment-gone banner add "Restore workspace from branch " and "Continue in new thread" (handoff without reuseEnvironmentId)…
Caveats: This is a design gap rather than a crash: the behavior is deliberate ("Decision B*") and codified in tests; the unit repro test passes on main and documents the dead end. The Discord report itself was not accessible; the reporter may have been on <= v0.36.0 where destroy was immediate (no grace window) — the end state is identical. Committed work survives on the branch; only uncommitted changes an…
The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).
Activity
SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1710.html
git worktree remove --forceand the environment becomes the terminaldestroyedstate; from there the app hides Unarchive/composer/handoff, unarchive only clears archivedAt (thread becomes live-but-unwritable, send -> 409 thread_environment_unavailable), fork is rejected, and no route/CLI can attach a new workspace to the thread — the deferred "continue from destroyed environment" path was never built.destroyed— create a new managed-worktree environment on the same host with baseBranch = old environment's branchName (the logic resolveForkEnvironment already has), updateThread({environmentId}) (DB layer supports it, emits environment-changed), let normal provisioning build the worktree, verify/fallback provider session resume with the new cwd. App/CLI/SDK: in the environment-gone banner add "Restore workspace from branch " and "Continue in new thread" (handoff without reuseEnvironmentId)…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).Let a thread rebuild the workspace its archiving destroyed
Restore a destroyed thread workspace on request, through the environm…