Skip to content

Speed up new thread submission - #2360

Merged
ymichael merged 1 commit into
mainfrom
bb/speed-up-new-thread-creation-thr_tufakqqt4b
Aug 24, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/speed-up-new-thread-creation-thr_tufakqqt4b

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

What was wrong

The new-thread composer kept the submitted draft visible until thread creation completed. At the same time, #2152 made the server inspect every named worktree base before provisioning. The root composer already submits its smart default as an authoritative remote-qualified name such as origin/main, so that path incurred a redundant host.list_branches RPC even though provisioning fetches the exact remote branch. The added creation latency made the delayed prompt clear especially noticeable.

What changed

  • Clear the matching submitted draft before awaiting thread creation. If creation fails, restore it only when the optimistic clear succeeded and the user has not started a newer draft.
  • Treat origin/... managed-worktree bases as authoritative and pass them directly to provisioning, while preserving the existing inspection and local-vs-origin policy for defaults and plain names such as main.
  • Preserve the smart named-default behavior introduced by Always seed new worktrees from the fresh remote default #153.
  • No wire, CLI, guide, or documentation changes; HOST_DAEMON_PROTOCOL_VERSION remains 164.

How you verified

  • Added app regression coverage for clearing while submission is pending, restoring after failure, and preserving a newer draft after failure.
  • Added route-level server coverage proving origin/main reaches provisioning without a host.list_branches RPC.
  • pnpm exec turbo run test --filter=@bb/app -- src/components/plugin/PluginNewThreadComposer.test.tsx src/views/root-compose-thread-environment.test.ts — 28 tests passed.
  • pnpm exec turbo run test --filter=@bb/server -- test/public/public-threads.named-base-branch.test.ts — 5 tests passed.
  • pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/server — 5 tasks passed.
  • pnpm exec turbo run lint --filter=@bb/app --filter=@bb/server — 0 errors.
  • pnpm exec oxfmt --check on all five changed files.

Fixes the performance regression introduced by #2152.

AGENT GENERATED

@ymichael
ymichael merged commit d6ac0ae into main Aug 24, 2026
15 checks passed
@ymichael
ymichael deleted the bb/speed-up-new-thread-creation-thr_tufakqqt4b branch August 24, 2026 23:00
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