Skip to content

fix(agent-checklists): expose tools and instructions only to attached threads - #13

Merged
patleeman merged 1 commit into
mainfrom
fix/checklists-only-attached-threads
Oct 15, 2026
Merged

patleeman merged 1 commit into
mainfrom
fix/checklists-only-attached-threads

Conversation

@patleeman

Copy link
Copy Markdown
Owner

Root cause

bb.agents.configure returned agent_checklist_get and agent_checklist_update for every thread. BB appends each selected tool's registered instructions to 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

  • configure now reads store.getChecklistForThread(context.thread.id) on every resolution (BB calls it at thread.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.
  • There is no cache. Each resolution reads the persisted SQLite row, so attach, detach, and replacement apply on the next resolution, stay per thread, and survive a restart.
  • agent_checklist_get now returns { checklist: null, message: "No Checklist is attached to this thread." } when nothing is attached, matching agent_checklist_update. This covers a provider session that still has the tools from before a detach.
  • Version 0.2.0 -> 0.2.1. The SDK pin (0.4.21) and engines floors are unchanged. configure with 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: passes
  • pnpm test: 4 files, 88 tests passed. This includes 5 new Checklists agent activation tests: 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 the server.ts change reverted, all 5 new tests fail.
  • pnpm build: passes

At the repo root:

  • pnpm check:compat: "All 16 plugins are compatible with stable bb 0.46.0."
  • git diff --check: clean

Fixes #12

🤖 Generated with Claude Code

… 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>
@patleeman
patleeman merged commit d8edb69 into main Oct 15, 2026
2 checks passed
@patleeman
patleeman deleted the fix/checklists-only-attached-threads branch October 15, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activate checklist agent instructions and tools only for attached threads

1 participant