Skip to content

Archived threads cannot resume in the original chat #1710

Closed

Description

@SawyerHood

Source

Discord report by Mockafjongen: https://discord.com/channels/1522478522332090528/1535636404497809459/1538847817706246304

Problem

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.

AGENT GENERATED: by GPT-5

Activity

  1. added
    bug
    on Aug 17, 2026
  2. added theissue type on Aug 17, 2026
  3. added
    threads
    and removed
    bug
    on Aug 18, 2026
  4. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    CollaboratorAuthor

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1710.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • 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).

    AGENT GENERATED: by Claude Opus 5

  5. added
    confirmed-repro
    on Aug 18, 2026
  6. added a commit that references this issue on Sep 25, 2026
    f92a2fb
  7. added a commit that references this issue on Sep 25, 2026
    90971b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reprothreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions