fix: load under bb >= 0.40 (presentation.label + non-recursive tool schema) - #1
Open
DianaMak-Di wants to merge 1 commit into
Open
DianaMak-Di wants to merge 1 commit into
DianaMak-Di wants to merge 1 commit into
Conversation
The plugin fails to load on bb 0.40 / plugin SDK >= 0.4.16 with two
separate registerTool errors.
1. `experimental_statusLabels` was folded into `presentation` (labels) in
SDK 0.4.16, so the host rejects the field outright:
registerTool: "experimental_statusLabels" was folded into
"presentation" (labels) in SDK 0.4.16 (tool "todo")
Moved to `presentation: { label: { pending, completed } }`.
2. With that fixed, the host then rejects the tool parameters:
tool "todo" parameters contains recursive JSON Schema
$ref "#/$defs/__schema0"
`nestedTodoInputSchema` was a `z.lazy()` self-reference via `children`,
which emits a recursive `$ref`. bb validates tool parameter schemas with
`assertNoRecursiveJsonSchemaReferences` and refuses any cycle.
Unrolled the nesting to a fixed `MAX_NESTED_TODO_DEPTH` (5) instead. The
emitted schema is finite and stays far below the 128 KiB parameter cap.
Note that 2. is a behaviour change: `children` was previously unbounded in
depth and is now capped at 5 levels. Happy to adjust the constant or take a
different approach if you would rather keep arbitrary depth.
`npm test` passes; verified end to end on bb 0.40.0 — plugin reports
`running`, the composer card renders, and `bb todo show` works.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The plugin currently fails to load on bb 0.40.0 (plugin SDK >= 0.4.16). Installing from
mainsucceeds, but the plugin never starts, so thetodotool is never registered.Two independent breaks, one after the other:
1.
experimental_statusLabelswas removedThe host rejects the field outright (
RENAMED_AGENT_TOOL_FIELDS). Moved to the current shape:2. Recursive tool parameter schema
With the above fixed, the next load attempt fails on:
nestedTodoInputSchemawas az.lazy()self-reference throughchildren, which emits a recursive$ref. bb validates tool parameters withassertNoRecursiveJsonSchemaReferencesand refuses any cycle.This PR unrolls the nesting to a fixed
MAX_NESTED_TODO_DEPTH(5) via abuildNestedTodoSchema(depth)helper. The emitted schema is finite and well under the 128 KiB parameter cap (PLUGIN_AGENT_TOOL_PARAMETERS_MAX_BYTES).Open question
Fix 2 is a behaviour change —
childrenwas previously unbounded in depth and is now capped at 5 levels. I picked 5 as a practical default, but it is your call: happy to change the constant, or to take a different approach entirely (e.g. keeping the recursive Zod type for internal validation and handing the host a depth-limited schema separately) if you would rather not cap the public contract.Verification
npm testpassesbb plugin reload todoreportsrunning, the composer todo card and header badge render, nested/dependsOn/requiresitems behave as before, andbb todo show --thread …prints the treedist/is untracked, so this touches source only🤖 Generated with Claude Code