Repository navigation
Fix project and plugin startup races - #3183
Merged
SawyerHood merged 3 commits intoSep 9, 2026
Merged
Conversation
Contributor
|
Thanks @MacHatter1 for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
SawyerHood
force-pushed
the
fix/startup-projects-and-plugins
branch
from
September 9, 2026 17:14
b1a11fa to
7ed3b03
Compare
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
Project reads called thread-creation default resolution, which requires an available provider. The server accepts requests before plugin initialization finishes, so project lists, sidebar bootstrap, and execution-default reads could return HTTP 409 during startup. Separately, a browser could cache the initial “not loaded” plugin snapshot and miss the transient
plugins-changedevent before its WebSocket connected, leaving plugin frontends unavailable until manually reloaded.What changed
Project read routes now return persisted execution defaults without requiring provider registration. Thread-creation validation remains in place. Every WebSocket connection invokes the existing plugin-change handler to refresh plugin queries and reconcile frontends, covering both initial connections and reconnects. Plugins now report a neutral
startingstatus through the existing API, SDK, and CLI while initialization is pending. The sidebar shows loading placeholders on first launch and retains remembered panel labels until server startup and frontend reconciliation finish. The plugin SDK is bumped to0.4.51so the changed generated status type reaches npm consumers. No server/daemon wire changes.How you verified
Reproduced on a fresh worktree from
origin/mainat6cdb4babefore applying the fixes: the project-startup regression failed with HTTP 409, initial-connection and reconnect frontend regressions failed, and the manual-reload control passed. After applying the fixes:pnpm exec turbo run test --filter=@bb/server -- test/public/public-project-startup.test.ts test/public/public-threads.defaults.test.ts test/threads/thread-default-policy.test.ts.pnpm exec turbo run test --filter=@bb/app -- src/hooks/plugin-startup-recovery.test.ts src/hooks/realtime-cache-effects.test.ts src/hooks/system-cache-effects.test.ts src/lib/plugin-frontend-reload.test.ts src/lib/plugin-frontend-lazy.test.ts.pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/server, formatting, andgit diff --checkpassed.Live coverage is the source web app, not the packaged desktop app. The controlled proxy produced an unrelated daemon-status CORS error; direct-app panel checks had no page exceptions. The verification inventory also reports a pre-existing unmapped
browserCLI family on the unchanged base.Independent review of
b1a11fa: restoring the pre-fix project route and connection handler reproduced HTTP 409 on sidebar bootstrap and failed frontend recovery on initial connection and reconnection; the reload-notification control passed. The final implementation passed 77 selected server tests, 189 selected app tests, and app/server typechecks. These independent reproductions used server and simulated-browser test harnesses.Close-out validation after rebasing and the SDK version bump: SDK build and npm publication guard passed; app/server typechecks passed; 46 selected app tests and 35 selected server tests passed. The working tree and commit-range private-name scan was clean.