Continue a thread on another provider from the follow-up composer - #3434
Open
brsbl wants to merge 5 commits into
Open
Continue a thread on another provider from the follow-up composer#3434brsbl wants to merge 5 commits into
brsbl wants to merge 5 commits into
Conversation
… is selected The follow-up composer locked its model picker to the thread's provider, so handing work to a different model meant leaving the thread through the "Handoff to new thread" footer action and re-typing the prompt in root compose. The bottom follow-up composer now exposes the same provider tabs as the new-thread picker. Selecting a provider other than the thread's own provider shows a toast explaining that submitting will create a new thread, retitles the submit control to "Create new thread", and on submit creates a thread on the selected provider and model that reuses the source environment and starts with "Continue from @thread:<source>" followed by the typed follow-up, then navigates to it. Same-provider model changes still send follow-ups to the current thread. Queued-message inline editors, sent-message edits, and side chats keep the provider-locked picker; beginning a sent-message edit reverts a pending cross-provider selection so that edit stays on the thread's provider. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…read Selecting another provider in the follow-up composer now creates and opens the new thread directly, so the "Handoff to new thread" footer action in the model picker duplicated that flow with a worse one: it left the thread and seeded root compose with a draft that dropped anything already typed. Remove the footer action and everything that existed only to serve it: the model picker's footer action slot and its menu action button, the ExecutionControls prop that forwarded it, root compose's handoff seed handling, and client-core's handoff location-state helpers. The ThreadHandoffCreateSeed type and the "Continue from" draft builder stay because the inline handoff still uses them. Also fix the CI failures from the previous commit: the provider-switch test queried a test id that the nested inline editor duplicated, the create-thread test fixture omitted a required runtime field, and the keystrokes test's mutation mock lacked useCreateThread. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… submit Submitting a cross-provider follow-up silently prepended "Continue from @thread:<source>" to whatever the user typed, so the message that started the new thread was never the message they saw in the composer. Selecting another provider now inserts that reference into the draft itself, followed by a blank line, and focuses the composer so the user can edit or delete it before submitting. Switching back to the thread's provider removes the reference again, but only while it is still exactly as inserted. The create-thread request sends the draft as typed, and the toast now says the reference was added and can be edited. client-core gains stripThreadHandoffPrefix as the counterpart of buildThreadHandoffFollowUpDraft, which also leaves a draft alone when the reference is already present so re-entering handoff mode never duplicates it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…line The composer editor stores the seeded "Continue from @thread:<source>" line followed by a single newline once the user types below it, so the exact two-newline match never fired: switching back to the thread's provider left the reference in place and re-entering handoff mode inserted a second copy. Detect the reference by its intact mention and its own line instead, and treat any run of newlines after it as the separator when stripping it or deciding not to insert it again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Resolves the conflict in PluginNewThreadComposer.test.tsx by keeping the upstream tests and dropping the root-compose handoff test again, since the location-state helpers it used were removed on this branch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
What changed
apps/app/src/views/thread-detail/ThreadDetailPromptArea.tsx: the bottom follow-up composer now passesprovider.onChange, so the existingModelReasoningPickershows the same provider tabs as the new-thread picker.appToast.messagesays the reference was added and that submitting will create a new thread. The submit control reads "Create new thread (Enter)". The submit mode isreadyonce the selected provider's model resolves, and blocked while it loads or if that catalog fails.project-defaultwhen the thread has none), then navigates to the new thread. Scheduled submits passsendAt.EmbeddedThreadChatand are untouched.packages/client-core/src/prompt/thread-handoff-request.ts:buildThreadHandoffFollowUpDraftinserts the reference and shifts the draft's mention offsets,stripThreadHandoffPrefixreverses it, andbuildThreadHandoffCreateRequestbuilds theAppCreateThreadRequestwith an explicit provider source and provider-gatedserviceTier.ExecutionControlsprop that forwarded it, root compose's handoff-seed location-state handling, and client-core's location-state helpers.ThreadHandoffCreateSeedand the "Continue from" draft builder remain for the inline flow.bb thread spawn --provider --model --promptandsdk.threads.spawnalready expose.How you verified
ac67895ab(merge ofmaininto5db1451da): passed. Lint/typecheck, both package smoke jobs, and the app, packages, server, and integration test shards are green; the iOS simulator and Node compatibility jobs were skipped by their own path filters. An earlier head's integration shard failed once on a provisioning-timing smoke test unrelated to this change and passed on rerun.packages/client-core/test/thread-handoff-request.test.ts: inserting the reference keeps later mentions anchored and does not duplicate an existing reference; stripping removes it and re-anchors mentions, tolerates a collapsed blank line, and refuses once the reference was edited; the request is built from the draft as typed with environment reuse, explicit sources,project-defaultfallback, service-tier gating, andsendAt; null for an empty draft or an unresolved model.apps/app/src/views/thread-detail/ThreadDetailPromptArea.test.tsx: only the bottom composer is provider-switchable while the inline queued editor stays locked; selecting another provider seeds the reference, fires the toast once, retitles submit, and reportsready; switching back restores the typed draft; submitting creates the thread from the draft as typed with the reused environment and navigates without sending or queueing on the current thread. Tests for the removed footer action in this file,ExecutionControls.test.tsx,RootComposeView.test.ts, andPluginNewThreadComposer.test.tsxwere deleted.scripts/bb-dev-app currentfrom an isolated worktree, on the thread detail follow-up composer of an idle Codex thread.GET /api/v1/threads/<new>showsproviderId: claude-code, the sourceenvironmentId, modelclaude-sonnet-5, and a first message identical to the composer contents including the thread mention.(max-width: 767px)breakpoint): the picker opens as a drawer with the provider tabs; switching to Claude Code seeds the reference and shows the toast; the collapsed composer reads "Create new thread (Enter)".Before: merge base
459e9f1d9. After:5db1451da, the last code commit on this branch; the laterac67895abonly mergesmain(resolving a test-file conflict) and changes no product code. Same thread, route, fixture data, and picker state.BB-Thread-ID: thr_rmmwartzsr
🤖 Generated with Claude Code