Repository navigation
Description
What I want
Import an existing agent session as a bb thread, with the full history in the timeline and the original session as the live provider session. Nothing summarized, nothing re-ingested, nothing lost.
I run long-lived omp sessions over SSH. Some of them are weeks of accumulated context (a repo-understanding session that later turns treat as memory). I added the project to bb and want those sessions to continue as bb threads. Today the only path is to export the transcript and attach it to a fresh thread's first prompt. That costs a full re-ingest, loses tool calls and turn structure in the timeline, and the result is a copy, not the session.
What already exists
Most of the plumbing is in place on both sides.
bb side:
- The ACP bridge probes
agentCapabilities.loadSessionat initialize (packages/agent-runtime/src/acp/bridge/bridge.ts:1525). - On
resumeof a bb-known thread it already callssession/loadwith the storedproviderThreadId, and falls back tosession/newwith a warning (bridge.ts:1532-1552). - During load, every replayed
session/updateis dropped behind thesession.loadinggate (bridge.ts:1717). Correct for resume: bb already has that timeline.
Agent side (omp as the working example):
omp acpdeclaresloadSession: true(packages/coding-agent/src/modes/acp/acp-agent.ts:520).- Its
loadSessionhandler loads the managed session and replays the full history, tool calls with ids and arguments included (acp-agent.ts:563,#replaySessionHistoryatacp-agent.ts:2041). - The loaded session is the same session file that
omp --resumeuses. Continuation appends to it. Compaction state and context carry over exactly.
The gap
There is no way to hand bb an external provider session id. session/load is only reachable for sessions that bb created itself. And the one code path that could ingest history discards it by design.
So the feature is narrow:
- An import entry point that creates a thread with a caller-supplied
providerThreadId, for providers whose agent advertisesloadSession. - A persist mode for that first load: translate the replayed
session/updatestream through the normal event path instead of dropping it, marked as historical so it does not run turn logic. - A workspace check: the imported session has a cwd; bind the thread to a matching project source or environment, and refuse a mismatch.
Proposed shape
bb thread import --project proj_x --provider acp-omp \
--provider-session 019fb4b0-32f0-7000-b43c-69ac16a18236
Result: a thread whose timeline shows the replayed history and whose next prompt continues the original session. omp --resume on the same id still works from the terminal, because it is the same session.
A capability flag (supportsSessionImport, derived from loadSession at initialize) would let the UI offer this only where it works.
Use cases
- Migrate a long-lived session into bb when adopting bb on an existing project, instead of starting the context from zero.
- Mid-task handoff: start work in the agent's own TUI over SSH, then import and continue from bb on another device.
- Review: import a finished session so its full history is browsable in the bb timeline next to the project's other threads, without paying a re-ingest.
Open questions
- Agent-specific meta entries in the replay (omp emits things like rule-injection markers) have no bb event type. Rendering them generically, or only under
showUnhandledProviderEvents, both seem fine for a first version. - Whether import should provision a managed environment or require an existing project source whose path matches the session cwd.
- Fork of imported threads: out of scope; ACP fork is unsupported today anyway.
Happy to prototype this in a fork once the direction has sign-off.
Activity
SawyerHood commentedon Aug 5, 2026
This seems great to me! I'm actively working on onboarding and importing threads from other providers was on my list. Would love if you could prototype the import. I can commandeer the PR and do in-depth testing against all of the providers
Clone source history into thread forks and honor sourceSeqEnd (#2142)
SawyerHood commentedon Sep 9, 2026
Tracked as a sub-issue of #3260. The parent now covers the shared scope and links this implementation. This issue retains its distinct evidence and acceptance criteria and remains open until that work is complete.
ymichael commentedon Oct 8, 2026
Closing as a duplicate of #3260, which tracks adopting existing Codex, Claude Code and ACP sessions as threads.