Skip to content

Community plugins rebuild on every bb launch instead of once per update #5729

Closed

Description

@brsbl

Community plugins get rebuilt from source every time bb starts, which slows down startup. They should only need rebuilding once, after a bb update.

Why it happens

  1. bb only reuses a plugin's prebuilt server code if it was built for the exact same plugin SDK version (isPrebuiltServerSdkCompatible in apps/server/src/services/plugins/plugin-runtime.ts). The SDK version changes almost every release, so most community plugins don't match and fall back to building from source. This part is intentional while the SDK is pre-1.0.
  2. The cache for those source builds is looked up by a hash of the finished build (apps/server/src/services/plugins/plugin-server-cache.ts). So bb has to run the whole build before it can check the cache, which means a cache hit saves nothing. This part is the bug.

Fix

Look up the cache using things known before building: the plugin's source, the SDK version, the bb version and the build options. Check the cache first and only build on a miss.

Done when

With a community plugin built for an older SDK, starting bb twice builds it once. The second start loads it from the cache, and a test covers this.

Activity

  1. changed the title [-]Community plugins rebuild from source on every launch, not once per SDK change[/-] [+]Community plugins rebuild on every bb launch instead of once per update[/+] on Oct 18, 2026
  2. added theissue type on Oct 18, 2026
  3. added
    plugins
    confirmed-repro
    on Oct 18, 2026
  4. bb-slop-cop commented on Oct 18, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Medium · Labels: plugins, perf.
    • Report: Reproduction and root-cause analysis.
    • Verdict: REPRODUCED · Confidence: high · Reproduction label: confirmed-repro.
    • Root cause: buildCachedPluginServer compiles and hashes the output before checking the artifact cache. Fresh processes therefore compile again even when they return the same cached path and digest.
    • Verification: The focused regression fails for the intended reason in two clean trusted-main checkouts at f9eae1c44; all 8 adjacent existing tests pass. This exercises the source-cache boundary across fresh processes, not full application startup timing.
    • No PR: Safe invalidation needs dependency/resolution tracking across the compiler and runtime, exceeding the rule’s one-subsystem/no-design-decision simple-fix gate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproperfplugins

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions