Skip to content

feat(agents): declarative tool catalog + per-agent tool allowlist (#51) - #59

Merged
serge-ivo merged 1 commit into
mainfrom
feat/3p-tool-catalog
Aug 1, 2026
Merged

feat(agents): declarative tool catalog + per-agent tool allowlist (#51)#59
serge-ivo merged 1 commit into
mainfrom
feat/3p-tool-catalog

Conversation

@serge-ivo

Copy link
Copy Markdown
Contributor

First slice of the open-to-third-party program (epic #58, workstream #51).

Why

The agent tool vocabulary is currently implied by a hardcoded per-surface switch in toolNamesFor (repo→KB-read, coding→coding, else everything). A third-party creator can't scope an agent's tools without a platform code change. This makes the vocabulary data.

What

  • Tool catalog as dataTOOL_CATALOG (groups + tier) + CREATOR_SELECTABLE_TOOLS, exported so the future authoring UI ([3P] Creator experience: onboarding + authoring UI + Coder flywheel #55) and pre-review safety scanner ([3P] Automated pre-review safety scanning #54) can enumerate what an agent may do. Excludes the permission-gated find_confirmation_link and the legacy submit_job_application.
  • Declared allowlistAgentCapabilities.tools?: string[] (validated by sanitizeToolList). When present it's authoritative: the agent gets exactly those catalog tools plus the universal BASE facilities (memory/tasks/fetch/context), replacing the per-surface default.
  • RuntimetoolNamesFor honors the allowlist; absent → behavior is identical to today, so no existing agent changes.

Safety / compatibility

  • Fully backward-compatible: no agent declares tools yet, so every current agent resolves exactly as before.
  • Ungrantable names (permission-gated, legacy, unknown) are ignored by construction — the declared list is intersected with the catalog at runtime.

Tests

  • New coverage in agent-do-tools.test.ts (allowlist precedence, override-vs-surface, ungrantable-names ignored, empty-list fallback, catalog shape) and agent-capabilities.test.ts (tools resolution both paths, sanitizeToolList dedupe/cap/junk).
  • All 680 workers/api tests pass.

Next in #51

Dogfood by migrating repo-chat to declare its tools as data (replacing its surface special-case), then the formal declarative agent schema.

Part of #58.

First slice of opening PAGS to third-party creators (#58): make the tool
vocabulary DATA instead of a hardcoded per-surface switch.

- Expose the tool groups as a catalog (TOOL_CATALOG + CREATOR_SELECTABLE_TOOLS)
  so the authoring UI (#55) and pre-review scanner (#54) can enumerate what an
  agent may do. Deliberately excludes permission-gated find_confirmation_link and
  the legacy submit_job_application.
- AgentCapabilities gains a declared `tools[]` allowlist (sanitizeToolList).
  When present it is authoritative: the agent gets exactly those catalog tools
  plus the universal BASE facilities — replacing the per-surface default.
- toolNamesFor honors the allowlist; absent → today's surface-derived behavior
  is unchanged, so no existing agent is affected (fully backward-compatible).

680 workers/api tests pass. Next in #51: migrate repo-chat to declare its tools
as data (dogfood), then the formal declarative agent schema.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@serge-ivo
serge-ivo merged commit 2ba41d8 into main Aug 1, 2026
1 check passed
@serge-ivo
serge-ivo deleted the feat/3p-tool-catalog branch August 1, 2026 02:38
serge-ivo pushed a commit that referenced this pull request Aug 1, 2026
Mark the tool catalog (#59) + repo-chat dogfood (#61) + agent-definition schema
(#62) as landed/in-progress across the strategy doc, the third-party plan, and the
README's repo-chat row (now the first "creator way" exemplar).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
serge-ivo pushed a commit that referenced this pull request Aug 1, 2026
)

sanitizeAgentDefinition / AgentDefinition had zero non-test consumers — built as a
"pure library, wiring deferred to the next PR" that never came. The lead-finder (and
every agent so far) is a standalone worker or a config chat agent; nothing consumes the
declarative definition. Removed agent-definition.{ts,test.ts} plus the helpers added
solely for it (sanitizeDeclaredCapabilities, DeclaredCapabilities, KNOWN_RUNTIMES,
KNOWN_WORKFLOWS).

KEPT (live): the tool catalog + capabilities.tools allowlist (PR #59) — repo-chat uses
it via migration 0050 through toolNamesFor. Recoverable from PR #62 history if/when the
create/update wiring is actually built.

715 workers/api tests pass; typecheck clean.
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.

2 participants