Skip to content

fix: restore Advisor loading and model discovery on bb 0.40+ - #3

Merged
salemsayed merged 3 commits into
salemsayed:mainfrom
jonolee-kr:fix/sdk-0.4.16-presentation-labels
Sep 14, 2026
Merged

salemsayed merged 3 commits into
salemsayed:mainfrom
jonolee-kr:fix/sdk-0.4.16-presentation-labels

Conversation

@jonolee-kr

@jonolee-kr jonolee-kr commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Advisor fails to load on bb 0.40+ because the host rejects experimental_statusLabels. After loading, model discovery also fails because the plugin reads the removed supportedPermissionModes capability field.

This moves tool labels to presentation.label, reads capabilities.permissionModes, migrates from vendored declarations to @get-bb/plugin-sdk 0.4.21, and replaces reviewer sessions using the removed readonly mode. The reviewer uses accept-edits and remains instructed to perform read-only review. Installation now requires bb 0.40 / SDK 0.4.21; the README and package metadata agree.

Validation: typecheck, all 86 tests, build, and package dry-run pass on Node 22.19.0 with the repository's bb 0.36.0 builder. Regression coverage checks registration labels, current provider catalogs, and reviewer session reuse/respawn. Earlier independent runtime verification is recorded in the PR comments for bb 0.40 and 0.41.

The SDK pin remains 0.4.21. Refreshing all dependencies to the latest host SDK is separate maintenance work.

jonolee-kr and others added 2 commits August 26, 2026 03:07
SDK 0.4.16 folded `experimental_statusLabels` into `presentation`
(labels). A host on that SDK or later rejects the old field, so the
plugin fails to load with:

  registerTool: "experimental_statusLabels" was folded into
  "presentation" (labels) in SDK 0.4.16 (tool "advisor_review")

Move the two labels to `presentation.label` and keep their text
unchanged. Teach the vendored declarations the new contract, and keep
`PluginAgentToolExperimentalStatusLabels` as a deprecated alias so the
SDK's bundled testing declarations still resolve.

Raise `engines.bbPluginSdk` to `>=0.4.16`, because `presentation` does
not exist before that release.

Add a regression test that reads the raw registration and asserts the
new shape.

Regenerate dist/. The app bundle diff is a minification artifact of the
newer builder, not a code change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bb 0.40 renamed provider.capabilities.supportedPermissionModes to
permissionModes and removed the readonly value. server.ts still read the
old name, so narrowestReviewMode called .find on undefined. Every
connected machine reported 'Could not load models: TypeError: Cannot read
properties of undefined (reading find)', and a saved advisor model looked
unavailable because the option list came back empty.

- Migrate off the vendored 0.4.2 declarations to @get-bb/plugin-sdk 0.4.21,
  which is what let the rename go unnoticed.
- Read capabilities.permissionModes at the three call sites.
- Drop the removed readonly value from the mode preference and type the
  preference as the host's own permission-mode union.
- Rebuild the fake catalogs in server.test.ts against the bb 0.40 shape.
- Add a regression test for the settings panel catalog, plus a reuse
  control and a respawn test for sessions stored under readonly.
- Correct the README: current bb has no read-only mode, so the reviewer
  runs in accept-edits and can write to the workspace.
@ChrBoebel

Copy link
Copy Markdown
Contributor

I hit the same failure independently and had opened #4 for it before spotting this PR. Yours is the more complete fix — declarations rather than a spread workaround, plus a regression test — so I've closed mine in favour of it. Two things I verified along the way that may be useful here.

Reproduced on bb 0.41.0 as well (you note 0.40.0). Installing main at bd4b6ae from git:, from ~/.bb/logs/server.1.log:

18:19:18.010Z  install of bd4b6ae recorded
18:19:18.476Z  plugin advisor failed to load: registerTool: "experimental_statusLabels"
               was folded into "presentation" (labels) in SDK 0.4.16 (tool "advisor_review")
18:19:21.736Z  plugin advisor failed to load: <same>
18:20:36.584Z  plugin advisor failed to load: <same>
18:20:40.988Z  plugin advisor failed to load: <same>

466 ms after the install completed. Worth noting for anyone reading this thread: the rejection comes from the host, not from the SDK bundled into dist/, so rebuilding the artifact against an older SDK does not avoid it.

A data point for the engines.bbPluginSdk bump to >=0.4.16. I went looking for whether the swap mirrors the breakage onto older runtimes, expecting it would, and it does not. The SDK 0.4.2 validator is a chain of hand-written per-field checks with no unknown-key rejection — registering a tool with presentation, and separately with an arbitrary made-up key, both succeed without throwing. The ≥ 0.4.16 error is a targeted deprecation guard for the removed name (it names the old key, the new key and the version, which a generic strict-object check could not produce), and there is no symmetric check in the other direction.

So below 0.4.16 the tool registers normally and simply renders no status label. Concretely, with this repo's own bb-app@0.36.0 toolchain: the regenerated declarations contain zero hits for presentation, and npx tsc -p tsconfig.json plus bb plugin build both still pass.

That makes >=0.4.16 a policy choice — advertise only runtimes that render the label — rather than a correctness requirement. Perfectly defensible either way; I mention it only so the floor is raised deliberately rather than out of caution. Caveat on my end: I exercised the 0.4.2 test harness and the 0.36.0 builder, not a live bb 0.35–0.40 host.

Unrelated: I have a second PR (#5) that needs some form of this fix in order to load, so it currently carries a minimal version of it. I'll rebase onto whichever lands.

dillonzq commented Sep 4, 2026

Copy link
Copy Markdown

Independent verification on bb 0.41.0 / plugin SDK 0.4.34:

  • reproduced the original experimental_statusLabels load failure on main (bd4b6ae)
  • applied both commits from this PR, preserving their authorship
  • npm run typecheck: passed
  • npm test: 86/86 passed
  • bb plugin build .: passed with the current 0.41.0 builder
  • installed from a local path: plugin reports running, registers advisor_review, exposes its settings, and bb advisor status succeeds

Verified branch: https://github.com/dillonzq/bb-plugin-advisor/tree/fix/sdk-tool-presentation

One maintenance note: bb plugin types --check on 0.41.0 reports the PR's @get-bb/plugin-sdk 0.4.21 pin as stale versus 0.4.34 and asks for the current host-shim type dependencies. Syncing those produced no additional source-level API errors; the existing code changes are sufficient for runtime compatibility.

@salemsayed salemsayed added the bug Something isn't working label Sep 14, 2026
@salemsayed salemsayed changed the title fix: migrate advisor_review to SDK 0.4.16 presentation labels fix: restore Advisor loading and model discovery on bb 0.40+ Sep 14, 2026
@salemsayed
salemsayed merged commit 0f82b66 into salemsayed:main Sep 14, 2026
1 check passed
@salemsayed

Copy link
Copy Markdown
Owner

Thanks for the compatibility fix. It is now shipped in Advisor v0.1.1, which the marketplace's existing ^0.1.0 range accepts. Fresh installation, backend RPCs and the settings UI passed on BB 0.40.0; current BB 0.43.1 checks and all 108 tests passed. The build now pins and validates BB/SDK versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants