Repository navigation
Description
Provider-neutral adoption scope
This is the parent tracker for adopting an external native session through the UI, SDK, and CLI. It covers Codex, Claude Code, and capable ACP providers. #1028 retains the detailed ACP import implementation and its original prototype discussion.
| Provider path | Required native behavior | BB history and workspace contract |
|---|---|---|
| Codex / Claude Code | Resume the supplied native session; support native forks where the provider exposes them. | Native context continuity is mandatory. BB may begin the visible timeline at adoption only when prior events are unavailable; disclose that limitation. |
| ACP (#1028) | Gate on load-session capability; use the supplied session and persist first-load historical updates without running live turn logic. | Preserve the provider-supplied historical timeline; bind to a matching workspace and reject a mismatch. ACP fork support is outside this child issue. |
- Import an existing ACP provider session as a thread (session/load with history persist) #1028 — ACP session import with historical replay persisted to BB, preserving original provider identity and context.
- Codex and Claude native adoption and supported native forks, including invalid-session/account/environment failures.
- Shared entry points, capability discovery, identity persistence, and failure cleanup; no partially adopted thread or leaked environment ownership on failure.
Historical replay into BB's timeline is allowed and required when available under the provider contract. Replaying a transcript as a new prompt into a replacement provider session is not adoption. Workspace choice must respect provider compatibility; it does not override ACP's matching-workspace requirement.
Problem
bb can resume and fork a provider session natively once it already owns a bb thread that records the provider thread identity. Its Codex bridge calls the App Server's native thread/resume and thread/fork; its Claude Code bridge similarly resumes/forks the provider session.
That does not help someone who already has a durable native session created outside bb: for example through Herdr/cmux, a terminal, another IDE, or an automation. Those tools can retain the official Codex/Claude session ID and resume it after restarts, but there is no supported way to turn that ID into a bb thread.
Opening a terminal in bb and running codex resume <id> is only an unmanaged terminal process. bb does not acquire the thread, show its native session as a bb thread, manage lifecycle/restart, or make native fork available from bb.
This blocks incremental adoption. A user must abandon ongoing work or keep using the other harness instead of moving the work into bb.
Requested capability
Add a first-class adopt external provider session flow. It must create a bb thread backed by an existing native provider session, without replaying or synthesizing the transcript as input to a new provider session. Historical events supplied by a provider can populate the BB timeline.
Suggested UI: New thread → Resume/adopt existing session, with provider selection and a session-ID entry/picker.
Suggested CLI/SDK shape:
bb thread adopt \
--provider codex \
--provider-thread-id <codex-thread-id> \
--environment <existing-or-new-environment>Equivalent SDK request: sdk.threads.adopt({ providerId, providerThreadId, environmentId, ... }).
Required behavior
- Validate the selected provider and native session ID using the provider's native resume mechanism.
- Create and persist the bb thread ↔ provider-thread identity mapping only after the native resume succeeds.
- Preserve native session identity and history. Do not copy/replay it into a freshly created provider session.
- Route future bb sends, resumes, and supported forks through the normal native provider bridge exactly as if the thread had begun in bb.
- Allow choosing or creating a managed worktree/environment before the resumed agent receives a prompt.
- Fail loudly and leave no partially adopted bb thread when the session is unavailable, belongs to a different provider/account, is not restorable, or cannot run in the selected environment.
- Make clear that bb’s rendered timeline may begin at adoption unless the provider API supplies prior events; native context continuity is the required part.
Priority / motivating workflow
Herdr persists official Codex and Claude session references and restores them with codex resume <id> / claude --resume <id>. Users with active work in Herdr, cmux, terminals, or another harness need to resume that work in bb without throwing away its context. This is a critical migration path, and should be a core bb primitive rather than something plugins or orchestration layers recreate.
Suggested acceptance coverage
- Create a Codex session outside bb, capture its ID, adopt it into bb, send a follow-up, and prove the Codex bridge issued native
thread/resumefor the supplied ID. - Repeat for Claude Code.
- Fork each adopted thread and prove the bridge uses the provider-native fork operation and receives a distinct provider session ID.
- Verify an invalid/unavailable ID fails without creating a durable bb thread or environment ownership leak.
- Verify UI, CLI, and SDK reach the same adoption path.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 8, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Type Feature · Priority Medium · Effort High
Labels:
providers,threads,provider-codex,provider-claude-codeNo reproduction report or pull request was created because the issue requests new functionality rather than reporting unexpected behavior.
[-]Adopt an existing native provider session as a bb thread[/-][+]Adopt existing Codex, Claude Code, and ACP sessions as BB threads[/+]feat: session-import icons, reader cost in show, gap node for native …