fix: migrate advisor_review to SDK 0.4.16 presentation labels - #3
Open
jonolee-kr wants to merge 2 commits into
Open
fix: migrate advisor_review to SDK 0.4.16 presentation labels#3jonolee-kr wants to merge 2 commits into
jonolee-kr wants to merge 2 commits into
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.
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.
Problem
Advisor fails to load on a bb host running plugin SDK 0.4.16 or later:
SDK 0.4.16 folded
experimental_statusLabelsintopresentation(labels). The host rejects the old field, so the whole plugin stays inerrorstate. Reproduced on bb 0.40.0.Change
server.ts— move the twoadvisor_reviewlabels topresentation.label. The label text is unchanged.types/bb-plugin-sdk.d.ts— addPluginAgentToolLabelsandPluginAgentToolPresentation, and replace the registration field.PluginAgentToolExperimentalStatusLabelsstays as a deprecated alias, because the SDK's bundled testing declarations still import it.package.json— raiseengines.bbPluginSdkto>=0.4.16.presentationdoes not exist before that release.server.test.ts— add a regression test. It reads the raw registration, assertspresentation.label, and asserts thatexperimental_statusLabelsis absent. The test fails on the currentmain.dist/— regenerated. The app-bundle diff is a minification artifact of the newer builder, not a code change.Verification
npx tsc -p tsconfig.json— clean.npx vitest run— 84 passed, 0 failed.bb plugin build— succeeds.Known limitation, out of scope here
bb plugin types --checkreports the vendored declarations as stale against bb 0.40. A full refresh produces 21 further type errors that are unrelated to this field, mostly thesupportedPermissionModestopermissionModesrename and test fixtures that now needprovider.capabilities. That breakage exists onmaintoday. This PR does not touch it, so the diff stays scoped to the registration failure.🤖 Generated with Claude Code