Repository navigation
Conversation
- Remove useUpdateEnvironment, which was built but never mutated, and its always-false isPending read in ThreadDetailView. - Remove isGitDiffFixedPanelTab, EMPTY_ORDERED_MENTION_SUGGESTIONS, the echoed useCommandSuggestions().triggers field, and ComposerBox's never-passed maxHeight prop. - Use apps/app's cached composerDraftFromPromptDraft in ComposerBox and drop the uncached client-core copy. - Drop nine unused @tiptap/* dependencies from @bb/app; @tiptap/core and @tiptap/pm stay as devDependencies for PromptBoxInternal.test.tsx. - Replace host-workspace's porcelain v1 quoted-path parser with a check of the two status letters, which is all the conflict check reads. - Reuse locks.ts's checkout admission lock and transcript.ts's throwIfProvisionAborted instead of host-workspace copies; drop a dead withGitRefMutationLock re-export and file-internal exports. - Correct stale docs and comments (protocol 255, ComposerBox owns submit, host ultracode decoration, bundle-budget note). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Implement checkout-ref, dirty and in-progress-operation inspection once in createGitQueries, so the daemon's host.inspect_git_source and the project-checkout plugin share it while each keeps its own git priority. Both callers already confirm a work tree first, so dropping the extra ensureGitRepo probe leaves results unchanged. getAbsoluteGitDir and pathExists move there too. - In the Git plugin's workspace reads, make the HEAD-to-empty-tree fallback generic over the result type so the record-limited diff reuses it, share one rangeGitRunner, one lstat helper and sumNumstatLines, and drop local copies of contract types and unused exports. - Build Ladle's makeWorkspaceStatus on the Git plugin's testing builders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymichael
deleted the
bb/delete-composer-and-git-move-leftovers-steps-1-a-thr_wtka9cryqd
branch
November 3, 2026 21:31
ymichael
added a commit
that referenced
this pull request
Nov 3, 2026
…es (#6948) ## Human comments ## What was wrong #6937 replaced the checkout inspection in `environment-project-checkout` (current ref, uncommitted changes, in-progress operation, conflicts) with the shared implementation in `bb-environment-provider-host/workspace-git`. Before the plugin runs `git switch` in a user's real checkout, the host's `assertSwitchable` uses that inspection to refuse a switch on a detached HEAD, during a merge or rebase, with conflicts, or with uncommitted changes. Only the uncommitted-changes refusal had a host test against a real repository. The server-side `validate` refusals are tested with mocked `inspectCheckout` results, so no plugin test ran the shared inspection on real detached, merge, conflict or rebase states. ## What changed Test-only. `plugins/environment-project-checkout/host.test.ts` gains four host tests. Each builds a real repository state, checks what `inspectCheckout` reports, attaches with an existing-branch switch, asserts the exact refusal message, and checks that HEAD did not move: - detached HEAD → `checkout: detached`; refused as detached - `merge --no-commit` in progress → `merge`, no conflicts; refused as merge in progress - conflicted merge → `merge`, with conflicts; refused for unresolved conflicts - conflicted rebase → `rebase`, with conflicts, `checkout: detached`. git detaches HEAD during a rebase, so the detached check refuses it first. That was also true before #6937; the test records it. No production, protocol, SDK or CLI change. ## How you verified - Removed each refusal in `host/checkout.ts` in turn: - Without the detached refusal, the detached and rebase tests fail. - Without the conflicts refusal, the conflicted-merge test fails. - Without the in-progress refusal, the merge-in-progress test fails. - Without the dirty refusal, the existing uncommitted-changes test fails. - `pnpm exec turbo run test typecheck lint --filter=bb-plugin-environment-project-checkout` passes. - Ran it live on a fresh `pnpm start:worktree` instance (new data dir) with scratch repos, using `bb thread spawn --environment-provider project-checkout --environment-inputs '{"branch":{"kind":"existing","name":"release"}}'`: - Server `validate` returned HTTP 409 with: `Checkout blocked while HEAD is detached` (detached), `…by uncommitted changes` (dirty), `…by an in-progress merge` (merge), `…by unresolved conflicts` (conflicted merge), `…while HEAD is detached` (rebase). - Host `attach`: threads were spawned deferred while the repos were clean, each repo was then broken, and the threads were dispatched. Provisioning failed with: `Cannot checkout branch while the workspace is on a detached HEAD` (detached and rebase), `…has uncommitted changes`, `…merge is in progress`, `…merge has unresolved conflicts`. - Every refused repo was unchanged: same HEAD and the same `git status`. - A clean checkout switched to `release`. Provisioning logged "Switched to branch release" and the environment was `ready` with `branchName: release`. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <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
Moving the composer (#6122) and git (#6165, #6157, #6388, #6410) into plugins left dead code and duplicate implementations in core and in neighbouring plugins. An audit of those moves (thread thr_7hk642w2es) found code that could be deleted with no protocol bump, no plugin SDK change and no change in behaviour. This PR implements the audit's steps 1 (pure deletions) and 2 (consolidations). Every item was re-checked against the current code before it was deleted; the items that turned out to change behaviour are left out and listed below.
What changed
Two commits. Together they remove 643 lines net. No
HOST_DAEMON_PROTOCOL_VERSIONchange, no plugin SDK change, and no CLI or config change.Step 1: deletions (+42 / −423, net −381)
useUpdateEnvironment(built but never mutated) and its always-falseisPendingread inThreadDetailView.isGitDiffFixedPanelTab,EMPTY_ORDERED_MENTION_SUGGESTIONS, theuseCommandSuggestions().triggersfield that only echoed its input, and themaxHeightprop onComposerBox, which no caller passes (the max height comes fromComposerMaxHeightContext).composerDraftFromPromptDraft.ComposerBoxnow uses the cached apps/app copy. The history object is rebuilt on every render and drafts are compared by value, so the result is the same.@tiptap/*dependencies of@bb/app.@tiptap/coreand@tiptap/pmbecome devDependencies because onlyPromptBoxInternal.test.tsxuses them.locks.ts) and its copy ofthrowIfProvisionAborted. Also awithGitRefMutationLockre-export nothing imports, andexporton helpers only used inside their own file.vcs-process-admission.mdnow cites protocol 255.api_to_audit.mdnow saysComposerBoxownssubmit. Theapp.csscomment and thebundle-budget.jsonnote no longer describe the pre-plugin composer.Step 2: consolidations (+299 / −561, net −262)
host.inspect_git_source) andplugins/environment-project-checkout/host/git.ts. Both now use one implementation increateGitQueries(bb-environment-provider-host/workspace-git), and the plugin's file is deleted. Because it goes through each side's runner, the daemon keeps its default git priority and the plugin keepsbackground. Every caller already confirms a work tree before calling, so the result is identical; the daemon just runs two fewergit rev-parsechecks per inspection.plugins/git/host/workspace-reads.ts(−85):rangeGitRunner, one lstat/ENOENT helper andsumNumstatLinesreplace the inline copies.makeWorkspaceStatusis now built onbb-plugin-bb--git/testing, keeping the same defaults.Planned items left out
EnvironmentDiffViewedResponseandEnvironmentActionApiError, which the SDK andpublic-api.tsuse.ComposerPluginActionswrapper: it discards any props a plugin passes at runtime. PassingComposerActionsSlotdirectly would start honouring them.diff.toggle, Info section ids): these would change behaviour.PUT /ui-preferencesandbb settings).PUTstores any command id and returns the overrides read back through the read-time migration.ChangedFilesSegmentView(deferred list mount, merge-base action, file buttons). A fake would drop that coverage unless the tests move into the plugin, which is relocation rather than deletion.commit-errors.ts, overflow-mode, label-class and debounce constants) into shared-ui: each new shared-ui entry needs a 5-lineexportsblock, and the copies are 1–3-line constants or helpers with a different shape, so this would add lines.How you verified
pnpm exec turbo run typecheck lintfor@bb/app,@bb/client-core,@bb/host-workspace,bb-environment-provider-host,@bb/host-daemon,bb-plugin-bb--git,bb-plugin-bb--composer,bb-plugin-environment-git-worktreeandbb-plugin-environment-project-checkout: all pass.pnpm exec turbo run testwith the same filters: every package passes after the rebase. Two@bb/apptests failed under a local load average of about 50 and are not caused by this PR:PluginSettings.test.tsxpasses when run on its own.lazy-plugin-renderers.cold-load.test.tsxfails the same way on the base commit.pnpm exec turbo run build --filter=@bb/apppluscheck-bundle-budget.mjs: budget OK.pnpm exec turbo run prepare:bundledfor the git, git-worktree and project-checkout plugins: the host bundles build with the shared helpers.getCheckoutRefandgetWorkspaceGitOperationtests (bare repo, detached, unborn, merge and rebase conflicts) now run against the shared implementation and pass.