Skip to content

feat: Tool-set based routing for Addie#825

Merged
bokelley merged 2 commits into
mainfrom
bokelley/addie-skill-ecosystem
Jan 20, 2026
Merged

feat: Tool-set based routing for Addie#825
bokelley merged 2 commits into
mainfrom
bokelley/addie-skill-ecosystem

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Replaces individual tool recommendations with category-based routing for Addie:

  • Router selects tool SETS (knowledge, member, directory, agent_testing, adcp_operations, content, billing, meetings, admin) instead of individual tools
  • Sonnet receives focused tools based on selected sets, reducing context from ~4K to ~1-1.5K tokens per message
  • Always-available escape hatches (escalate_to_admin, get_account_link, capture_learning)
  • Unavailable sets hint tells Sonnet what categories weren't loaded so it can redirect if needed
  • Precision mode triggered when billing set is selected (uses Opus for financial operations)

Why

Analysis showed that Haiku's individual tool recommendations had a 0% exact match rate with what Sonnet actually called. By having Haiku select categories instead of individual tools, we:

  1. Give Haiku an easier decision (categories vs 70+ tools)
  2. Still let Sonnet pick the right specific tools within categories
  3. Significantly reduce context window usage

Changes

  • server/src/addie/tool-sets.ts - New file defining tool set infrastructure
  • server/src/addie/router.ts - Updated to use tool_sets instead of tools
  • server/src/addie/bolt-app.ts - Added filterToolsBySet() and unavailable hint injection
  • server/src/db/migrations/183_router_tool_sets.sql - Backward-compatible view update
  • server/scripts/ - Test scripts for validation

Test plan

  • Typecheck passes
  • All existing tests pass
  • Router correctly selects tool sets via admin API (10/10 test cases)
  • Admin dashboard loads correctly in Vibium
  • Multi-intent queries return multiple sets
  • Greetings correctly use react action (no tools)

🤖 Generated with Claude Code

bokelley and others added 2 commits January 20, 2026 09:09
Replaces individual tool recommendations with category-based routing:
- Router selects tool SETS (knowledge, member, directory, etc.)
- Sonnet receives focused tools based on selected sets
- Reduces context from ~4K to ~1-1.5K tokens per message
- Includes always-available escape hatches (escalate_to_admin, etc.)
- Adds unavailable sets hint so Sonnet can redirect if needed
- Billing set triggers precision mode (Opus)

Migration 183 adds backward-compatible view update.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds standard MCP tools that match the AdCP protocol specification:
- Media Buy tools: get_products, create_media_buy, sync_creatives, etc.
- Creative tools: build_creative, preview_creative
- Signals tools: get_signals, activate_signal

These tools expose the same functionality as call_adcp_agent but with
proper schemas enabling skills to work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit d1a4b67 into main Jan 20, 2026
6 checks passed
bokelley added a commit that referenced this pull request Apr 24, 2026
…#2889) (#2992)

* feat(training-agent): dogfood @adcp/client 5.14 seller helpers (closes #2889)

Adopts the five helper families shipped for seller authors in
`@adcp/client` 5.11–5.14:

- `wrapEnvelope` for sibling-field emission in the framework server's
  response adapters
- `bridgeFromSessionStore` wires `comply_test_controller.seed_product`
  fixtures through `get_products` on sandbox requests (new behavior —
  closes a latent gap where seeded products never reached the buyer
  tool)
- `mergeSeedProduct` replaces the shallow-spread overlay in
  `overlaySeededProducts`
- `mcpAcceptHeaderMiddleware` replaces the inline Accept header +
  rawHeaders rewrite on `/mcp` and `/mcp-strict`
- `adcpError()` + dispatcher `sanitizeAdcpErrorEnvelope` make
  `conflict-envelope.ts` and the response-body wrapper redundant —
  both deleted; a framework-path regression locks in that `recovery`
  is stripped from `IDEMPOTENCY_CONFLICT` envelopes at both transport
  layers

Follow-ups filed as adcontextprotocol/adcp-client#824, #825, #826,
#827 landed in 5.14 (closed), so the adoption is complete rather than
partial. Deferred: migrating `comply_test_controller` off the
`customTools` path to `registerTestController` for its auto-emitted
capability block.

Net `+183 / -459` — 276 lines of bespoke glue removed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* revert: pin @adcp/client to 5.13.0, trim adoption to 5.13-safe helpers

@adcp/client 5.14 regressed the storyboard runner — with 5.14 the
training agent drops from 52/52 clean to 39/52 (confirmed against both
this branch and main, identical behavior). Filed upstream as
adcontextprotocol/adcp-client#866.

For this PR, pin to 5.13.0 and narrow the adoption to what works
there: `wrapEnvelope`, `mergeSeedProduct`, and a hand-rolled session-
scoped `testController.getSeededProducts` callback (new behavior —
seeded products now flow through `get_products`, closing a latent
gap).

Put back until the 5.14 bump resolves adcp-client#866:

- inline Accept-header + rawHeaders rewrite on `/mcp` and `/mcp-strict`
- `conflict-envelope.ts` + `wrapResponseForConflictRedaction`
- response-wrapper regression test file

Drop the framework-path regression test for `recovery`-absence on
`IDEMPOTENCY_CONFLICT` — that path exists now only at the HTTP-layer
redactor, which `dispatchTestRequest` doesn't exercise. The legacy
`conflict-envelope.test.ts` covers the redactor's unit contract.

Storyboards local verify:
- legacy (TRAINING_AGENT_USE_FRAMEWORK=0): 52/52 clean, 380 passed, 0 failed
- framework (=1): 51/52 clean, 390 passed, 1 known residual

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant