Repository navigation
Description
Summary
When a plugin's bb.agents.configure() callback returns instructions longer than 4096 characters, the host keeps the first 4096 characters and drops the rest. There is no error, warning, log line, or plugin status. The agent gets text cut off mid-sentence, and the trailing rules never reach it. The same limit for a tool's static instructions is enforced the other way: registration fails with an error. We expected the dynamic path to surface the overflow too.
Versions and environment
- bb 0.46.0 (desktop app built from source at
desktop-v0.46.0); the code path is identical onmainat411eac54ac16d0a3cb57d1de8396d37564884a73. - macOS 15.7.4, Node 22.19.0.
- Provider-independent (the truncation happens on the server before any provider sees the text).
Steps to reproduce
Smallest repro, at the exact code path, in packages/plugin-sdk/src/internal/:
import { it } from "vitest";
import { normalizePluginAgentConfiguration } from "./host-policy";
it("repro", () => {
const rules = Array.from({ length: 9 }, (_, i) => `- Rule ${i + 1}: ${"x".repeat(480)}`);
rules.push("- Last rule: never call grill_round in this panel.");
const instructions = rules.join("\n");
const out = normalizePluginAgentConfiguration({
knownSkillIds: new Set(),
knownToolIds: new Set(),
pluginId: "example",
value: { tools: [], skills: [], instructions },
});
process.stderr.write(JSON.stringify({
inputLength: instructions.length,
outputLength: out.instructions?.length,
lastRuleKept: out.instructions?.includes("Last rule"),
}) + "\n");
});pnpm exec vitest run <that file> from packages/plugin-sdk.
Expected vs actual
Actual:
{"inputLength":4469,"outputLength":4096,"lastRuleKept":false}
Nothing else is reported: the server stores the sliced text in dynamicInstructions and the plugin stays running.
Expected: the overflow is visible to the plugin author, for example a configure() failure like the static tool-instructions check, a plugin status/log warning naming the plugin and the length, or at least a one-time warning in the plugin's log.
Evidence
- Slicing:
host-policy.ts#L3546-L3553 - Static tool instructions over the same limit throw instead:
host-policy.ts#L3130-L3136 - The server uses the sliced value without any check:
plugin-service.ts#L2298-L2333 - The limit is documented only as a type comment:
backend-contract.ts#L1238 - Found in practice: a plugin's per-chat instructions are ~3,840 characters; a new ~550-character rule vanished and only the test suite noticed. Project names are interpolated several times, so a long name alone can push the existing last rule out.
What we ruled out
- Not a duplicate: searched for "instructions truncated", "dynamic instructions limit", "agents.configure instructions", "instructions 4096". The closest are Session context policy: let a plugin narrow what one agent session loads (BB plugins, skills, MCP, CLI plugins, instructions) — working prototype #4233 (session context policy) and Slash menu lists plugin skills that agents.configure deselected #5215 (deselected skills in the slash menu); neither covers this.
- Not a misuse: the 4096 limit itself is documented in
PluginAgentConfiguration.instructions. This issue is about the overflow going unnoticed, not about the limit's size. createFakePluginHostmirrors the same silent slice, so plugin tests do not catch it either.
Suggested priority and effort
Low priority, small effort. It affects plugin authors with long dynamic instructions; the workaround is to keep instructions short or move guidance into a thread message. Nothing is lost except the cut-off instructions, but because nothing reports the cut, it can go unnoticed indefinitely.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 15, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins.confirmed-repro.markasoftware-tc commentedon Nov 2, 2026
Summary
Additional reproduction for this defect class: the legacy
bb.agents.contributeInstructions()path also silently slices contributions at 4096 characters, independently of theagents.configure()normalizer described above. This remains present on currentmainat890c8482e1e1b0137484ccc372452250ef2f764c. A fix limited to the normalizer would leave this second path unchanged.Versions and environment
mainat890c8482e1e1b0137484ccc372452250ef2f764c, fetched directly from GitHub.Steps to reproduce
This executes the exact instruction-contribution loop extracted from production source in a small VM harness, with a contribution callback and logger spy. TypeScript annotations are removed with Node's
stripTypeScriptTypes; the loop's logic is not rewritten. Run in a scratch directory with Node 22.23.4 and an authenticatedgh:Expected vs actual
Actual stdout, verbatim:
{"case":"overflow","inputLength":4120,"outputLength":4096,"tailRuleKept":false,"warnings":0} {"case":"exact-limit","inputLength":4096,"outputLength":4096,"tailRuleKept":false,"warnings":0} {"case":"empty","inputLength":0,"outputLength":0,"tailRuleKept":false,"warnings":0}Node additionally prints its standard
stripTypeScriptTypesExperimentalWarning; that warning is from the harness's type stripping, not a BB overflow diagnostic. The overflow case completes successfully, omitsFINAL_RULE_MUST_SURVIVE, and makes no logger warning call. The exact-limit and empty cases are negative controls and contain no tail rule in their inputs.Expected: overflow should be visible to the plugin author, for example rejection with an actionable error or a diagnostic naming the plugin and input/limit lengths. Silently removing trailing rules should not be reported as an ordinary successful contribution.
Evidence
thr_9g7x4i3ymz(agent-context audit). Lengths and warning counts above were measured by the included harness; assertions verify the returned text equals the first 4096 characters and that the logger spy receives no calls.What was ruled out
agents.configure()normalizer: the reproduction calls only the server's separatelistPluginInstructionContributions()loop.Authored by GPT-6.
Allow plugin dynamic instructions up to 32768 characters (#7050)