Repository navigation
fix(agent-checklists): expose tools and instructions only to attached threads - #13
Merged
Merged
Conversation
… threads Resolve the bb.agents.configure selection per thread from the persisted store, so threads without a Checklist get no checklist tools, no tool-registration instructions, and no dynamic instruction. Attach, detach, and replacement apply on the next resolution. Bump to 0.2.1. Fixes #12 Co-Authored-By: Claude Opus 5.5 <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.
Root cause
bb.agents.configurereturnedagent_checklist_getandagent_checklist_updatefor every thread. BB appends each selected tool's registeredinstructionsto the thread instructions, so every thread was told to "Read the checklist before starting work and after major progress", even with no Checklist attached. The conditional wording in the dynamic instruction did not cancel that.Change
configurenow readsstore.getChecklistForThread(context.thread.id)on every resolution (BB calls it atthread.start/turn.submit). With no Checklist it returns{ tools: [], skills: [] }: no tools, so no tool instructions, and no dynamic instruction. With a Checklist it returns both tools and a short instruction.agent_checklist_getnow returns{ checklist: null, message: "No Checklist is attached to this thread." }when nothing is attached, matchingagent_checklist_update. This covers a provider session that still has the tools from before a detach.configurewith the thread context already exists in the pinned SDK.SDK limitation: the SDK says tool and instruction selections apply "when the provider session is next started or resumed; an already-running session is not hot-mutated". For providers that keep a long-lived session, a mid-session attach or detach may only take effect once BB rebuilds that session. The plugin re-resolves on every turn, so nothing more can be done on the plugin side. The inert
null+ message reply covers the gap.Existing checkbox updates, notes/evidence, pause, and continuation paths are unchanged.
Verification
In
packages/bb-plugin-agent-checklists:pnpm typecheck: passespnpm test: 4 files, 88 tests passed. This includes 5 newChecklists agent activationtests: no attachment (no tools, null instruction, no "checklist" text in the dynamic or tool-instruction surface); attached; attach -> detach -> replace on the next resolution (the replacement is read, not the old one); independent threads + plugin reload; stale tool call with no attachment. With theserver.tschange reverted, all 5 new tests fail.pnpm build: passesAt the repo root:
pnpm check:compat: "All 16 plugins are compatible with stable bb 0.46.0."git diff --check: cleanFixes #12
🤖 Generated with Claude Code