fix: restore Advisor loading and model discovery on bb 0.40+ - #3
Conversation
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.
|
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 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 A data point for the So below 0.4.16 the tool registers normally and simply renders no status label. Concretely, with this repo's own That makes 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. |
|
Independent verification on bb 0.41.0 / plugin SDK 0.4.34:
Verified branch: https://github.com/dillonzq/bb-plugin-advisor/tree/fix/sdk-tool-presentation One maintenance note: |
|
Thanks for the compatibility fix. It is now shipped in Advisor v0.1.1, which the marketplace's existing |
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 removedsupportedPermissionModescapability field.This moves tool labels to
presentation.label, readscapabilities.permissionModes, migrates from vendored declarations to@get-bb/plugin-sdk0.4.21, and replaces reviewer sessions using the removedreadonlymode. The reviewer usesaccept-editsand 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.