Skip to content

Add cross-provider thread takeover - #1600

Open
davekilleen wants to merge 13 commits into
get-bb:mainfrom
davekilleen:codex/model-takeover-quick-review
Open

Add cross-provider thread takeover#1600
davekilleen wants to merge 13 commits into
get-bb:mainfrom
davekilleen:codex/model-takeover-quick-review

Conversation

@davekilleen

@davekilleen davekilleen commented Aug 14, 2026

Copy link
Copy Markdown

Summary

BB threads are stuck on one provider. This change lets a user or agent move an existing thread to another provider/model in one action.

Take over creates a replacement thread in the same workspace, opens it immediately, and archives the old thread only after the new one has actually started. If startup fails, the original thread stays live.

The same server operation powers the app, SDK, and CLI.

How to try it

  1. Open an existing thread.
  2. In the model picker footer, choose Bring in another model.
  3. Choose Take over this thread, pick the new provider/model, then Continue with {model}.
  4. Confirm the new thread starts and the old one becomes archived and restorable.

Agent surface:

bb thread handoff <source-id> --provider <id> --model <id>

Not in this PR

  • Review this work (Quick Review) is shown but disabled. That is a separate plan.
  • Multi-model debates are out of scope.
  • Source threads are archived, never deleted.

Verification

Re-run on the rebased tip (c3097ad0a):

  • Typecheck green: db, server-contract, server, sdk, cli, app, templates.
  • SDK 91, CLI 442, db 396, server-contract 45 passed.
  • Server suite: 1542 passed; one unrelated timeline timeout under load (timeline-in-turn-window), then 21/21 passed isolated. No timeline files in this diff. Protocol version unchanged at 119.
  • App suite found a real cache-owner boundary break in the takeover mutation; fixed in c3097ad0a. Focused takeover + cache-owner tests: 9/9. Earlier focused drawer/banner/query set: 34/34.
  • Host daemon wire unchanged.

Still outstanding before merge:

  • Two live canaries against a running build of this branch: Codex → Claude Code and Claude Code → Codex. These cannot be run against the currently installed BB.
  • Reviewer approval. This should not ship in a BB release without that.

Test plan

  • Take over a disposable Codex thread with Claude Code and confirm the replacement sees the source mention, starts, and archives the source only afterward.
  • Reverse the same path: Claude Code → Codex.
  • Fail the target provider and confirm the source stays live.
  • Restore the archived source from the replacement banner.
  • bb thread handoff --self --provider … --model … --json from an agent thread.

AGENT GENERATED: by Grok 4.6

Add SDK handoff adapters and `bb thread handoff` so agents can move a
thread to another provider or model through the same server-owned
takeover path.
Replace the old compose shortcut with a Bring in another model drawer that
creates a replacement thread through the server-owned handoff path and
shows truthful takeover status on the new thread.
The new mutation wrote query cache directly and imported query keys,
which the app cache-owner boundary tests reject. Seed replacement
status through a dedicated owner instead.
@davekilleen

Copy link
Copy Markdown
Author

Post-rebase verification update.

The takeover mutation was writing React Query cache directly. The full app suite caught that (cache-owner-registry 2 failures). Fixed in c3097ad by seeding replacement status through a dedicated cache owner.

Fresh evidence on this tip:

  • Typecheck: db, server-contract, server, sdk, cli, app, templates green
  • SDK 91, CLI 442, db 396, server-contract 45 passed
  • Focused takeover + cache-owner tests 9/9 after the fix
  • App drawer/banner/query set 34/34
  • Server 1542 passed; one unrelated timeline timeout under load, 21/21 isolated. No timeline files in this diff. Host protocol still 119.

Still needed before merge: reviewer approval, plus two live canaries on a running build of this branch (Codex → Claude Code and back).

AGENT GENERATED: by Grok 4.6

@davekilleen
davekilleen marked this pull request as ready for review August 14, 2026 09:21
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.

1 participant