Repository navigation
Remove dead code and dedupe shared logic across the monorepo - #3583
Merged
SawyerHood merged 1 commit intoSep 12, 2026
Merged
SawyerHood merged 1 commit into
SawyerHood merged 1 commit into
Conversation
Delete unused files, declarations, props, branches, dependencies, and production code kept alive only by its own tests, and consolidate duplicated helpers into existing shared packages. Candidates came from knip and jscpd plus per-slice audits, and every change survived an adversarial review before it was applied. - apps/mobile: native-era query, cache, toast, and UI leftovers from before the WebView shell; icon maps pruned to the icons in use; stale READMEs - apps/app, apps/server, apps/desktop, apps/web, host packages, plugins: never-passed props, unreachable branches, test-only helpers, duplicated lock, path, scheduler, manifest, and validator implementations - provider-claude-code: unreachable readonly permission mode - Unused dependencies from 13 manifests, with pnpm-lock.yaml refreshed - @get-bb/plugin-sdk bumped to 0.4.87 for the changed published content Wire protocols, persisted data, public plugin SDK exports, and deprecated SDK aliases still in their removal window are unchanged. Lost coverage for still-live behavior was restored. Net: +17.3K / -39.4K lines. jscpd clones 279 -> 111; knip unused exports 412 -> 238 and unused dependencies 96 -> 60. Co-Authored-By: Claude Code <[email protected]>
SawyerHood
deleted the
bb/can-you-scan-this-code-for-any-unused-code-and-l-thr_ekk8rv4cd5
branch
September 12, 2026 08:37
ratulsarna
added a commit
to ratulsarna/bb
that referenced
this pull request
Sep 13, 2026
Upstream's dead-code sweep (get-bb#3583) hoisted the file-local sessionOptions into FULL_ACCESS_SESSION_OPTIONS in fake-codex-app-server-harness.ts and updated its own call sites. The fork's added tests kept the old name, so the merge typechecked as five undefined references. Same values, so this is a rename only.
ymichael
added a commit
that referenced
this pull request
Nov 3, 2026
## Human comments ## What was wrong The phone app icon never showed a count. The mobile shell advertises the `badge` capability and, when the app goes to the background, writes the last count it received. But nothing in the web app has sent that message since `shellSetBadge` was removed in #3583, so the shell wrote its default of 0 and cleared any badge. ## What changed - `apps/app/src/lib/native-shell/native-shell.ts`: adds `shellSetBadge(count)`, which posts the existing `{ type: "badge", count }` bridge message when the shell supports it. - `apps/app/src/components/layout/AppLayout.tsx`: posts the pending-thread count from `desktopAttentionThreads` whenever it changes. This is the number the desktop Dock badge shows. There are no mobile, push-payload, plugin SDK or daemon protocol changes. The badge updates only while the WebView runs. Pushes do not carry a badge count, so a question that arrives while the app is suspended doesn't change the badge until the app is opened. A thread that is only unread gets a dot on the Dock but no number on the phone. ## How you verified - New `AppLayout.test.tsx` case: it checks that the page posts 2 for two pending threads and one unread thread, then 0 once none are pending. It fails without the AppLayout change. - `pnpm exec turbo run typecheck lint --filter=@bb/app` passes, as do the AppLayout and native-shell tests. - iOS 26.5 simulator against `pnpm start:worktree`, with two threads waiting on a question: - Before the fix: a simulated push set the badge to 7, which shows the app has badge permission. Opening the app and going home then cleared it. - After the fix: the badge showed 2. When one question was resolved, it showed 1. > AGENT GENERATED Co-authored-by: Claude Opus 5.5 <[email protected]>
2 tasks done
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
The monorepo had accumulated dead and duplicated code: files and exports nothing imports, props and options no caller passes, branches no input can reach, production helpers that only their own tests call, dependencies nothing resolves, and several helpers implemented two to four times across packages. A knip scan flagged 412 unused exports, 597 unused types and 96 unused dependencies. jscpd found 279 copy-paste clones (4,777 duplicated lines).
What changed
One commit deletes the dead code and consolidates the duplicates. Net change: +17.3K / −39.4K lines across 1,317 files (63 files deleted).
Every change went through the same pipeline:
Largest areas (net lines):
apps/mobile(about −6.1K): leftovers from before the WebView shell: query-key catalogue, realtime invalidation, diff-patch cache, mutation-error toasts, and 15 unused UI primitives. The icon maps are pruned to the 22 icons in use, and stale READMEs are rewritten.apps/app(about −4.7K): never-passed props, always-true flags, pass-through wrappers, and repeated components (branch picker, settings rows, sidebar chrome, loading rows).apps/server(about −2.4K): a test-only timeline build path and execution-option helper, dead ownership modes, and plugin registration and configure validators that were copied into the SDK fake plugin host. The validators now have one home in@get-bb/plugin-sdkinternals.plugins/provider-claude-code(about −1.2K): the unreachable readonly permission mode and leftovers from the idle-release feature.apps/desktop: duplicated lock implementations merged intobb-environment-provider-host; path-containment, debounce and child-process-exit helpers moved into existing shared packages.apps/web: about 470 lines of app-shell CSS the site never used.apps/appafter the kit moved to@bb/shared-ui, plus unused dependencies in 12 other manifests.pnpm-lock.yamlis refreshed.Contracts:
HOST_DAEMON_PROTOCOL_VERSIONis unchanged.@get-bb/plugin-sdkis bumped to 0.4.87 because published SDK content changed.Deliberately not included; each needs an owner decision:
host.file_metadatadaemon RPC has no sender. Removing it requires a protocol version bump.closeclient message has no sender. Same protocol question.audit_logtable is never read or written. Dropping it needs a migration.How you verified
pnpm exec turbo run typecheck: all 95 packages pass on the rebased branch.pnpm exec turbo run lint: passes.pnpm install --frozen-lockfile: succeeds.oxfmt --checkpasses on every changed file that was formatted at baseline.pnpm exec turbo run test: 34 failing tests under full-suite load; unmodified main had 137 under similar load. 25 of the 34 were already failing on unmodified main. The other 9 all pass when re-run alone: @bb/serverinstall-machine-script,timeline-in-turn-window,git-plugin-dependenciesandplugin-install(4 files, 124 tests), and @bb/templatesplugin-scaffold-external(2 tests).