Repository navigation
Return only ok and result from plugin RPC responses - #6073
Merged
Merged
Conversation
#5658 added the tag engine's tags, keyTags and invalidated to every plugin RPC response by serialising the handler outcome as-is. Strict callers that fetch the endpoint directly rejected every successful response: the provider usage card, desktop machine enrollment and the desktop account server list. The response is now exactly { ok, result }. Core's RPC hooks compute the same tags from the contract they already hold, with the shared rpcResponseTags, and the server keeps using invalidated for its broadcast. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 21, 2026
3 tasks done
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
#5658 made plugin RPC responses carry the tag engine's bookkeeping.
invokeRpcHandlerreturnedtags,keyTagsandinvalidated, and the route sent that outcome as-is (context.json(outcome)). Every successful response became{ ok, result, tags, keyTags, invalidated }.Callers that fetch the endpoint directly with strict parsers rejected every success:
plugins/provider-usage/usage-schema.ts), which shows an error even when usage loaded;apps/desktop/src/connect-machine-enrollment.ts). It has no fallback, so a desktop app that hasn't enrolled yet fails silently, loggingcould not enroll this app with bb Connect (invalid_response). It only becomes visible when the local server is down and the app has no credential;apps/desktop/src/connect-server-sync.ts). It falls back to the stored machine credential or the account session, so the server menu still fills.The data was also redundant. Those fields are computed only from the RPC contract's
tags,keyTagsandinvalidatesdeclarations, using the parsed input and output. Core's RPC hooks already receive that same contract.It affects main and the nightly build of Oct 21 (0.46.2-nightly). Stable 0.46.1 predates #5658. These callers aren't affected: the SDK's
callRpc(used by the CLI and plugin server code), Side Chat, desktop session creation, and the community marketplace plugins checked, which call the endpoint directly and all parse loosely.What changed
invokeRpcHandlerreturns{ ok: true, result }, and the route builds{ ok: true, result: outcome.result }explicitly, so internal fields can't reach the response. The server still computesinvalidatedand broadcasts it throughnotifyPluginChanged.rpc-query-host.tscomputestags,keyTagsandinvalidatedwith the sharedrpcResponseTags, from the hook'scontract, the input parsed by the contract's input schema, and the result. That's the same function the server uses, and the same way core routes derive their tags inroute-tags.ts.envelopeflag.{ ok, result };tags,keyTagsandinvalidatesreturns exactly{ ok, result }and still callsnotifyPluginChangedwith its invalidation. It fails on main, where the body also carriestags,keyTagsandinvalidated.The provider usage card and both desktop paths work again without changes. This replaces #6069, which loosened the usage card's parser.
How you verified
pnpm start:worktreeservers, samegetUsagecall: main returns keysinvalidated, keyTags, ok, result, tags; this branch returnsok, result.@get-bb/plugin-sdk: 390 tests pass, includingrpc-query-host.test.tsx, where reads refresh from contract-declared tags and keyTags with no server-sent tags.plugin-wire.test.ts: 31 tests pass; the new test fails on main.🤖 Generated with Claude Code