Repository navigation
refactor(mcp): derive the agent tool lists from one metadata table - #412
Merged
Merged
Conversation
A new agent tool had to be added by hand to AGENT_INSPECTOR, AGENT_SAFETY, ACTION_TOOLS, PAGE_AGENT_ENTRIES and sometimes READ_ONLY_VARIANTS or ACTION_TOOL_FREE_MODES, and a missed list failed quietly. Give each tool and resource one entry in AGENT_ENTRIES (kind, inspectors, tier, actions, free modes, page) and derive every list and the tool tags from it, with the same exported names, types and values. A fixture test pins the derived lists to the values kept by hand before, and a coverage test boots the server and fails when a registered tool has no entry or an entry is never registered. Refs #372
Contributor
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
|
View your CI Pipeline Execution ↗ for commit fedcbc9
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
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.
What and why
The "generate AGENT_INSPECTOR / ACTION_TOOLS / PAGE_AGENT_ENTRIES from metadata" item from #372.
Adding an agent tool used to mean editing several hand-kept lists in
config.ts. Forgetting one failed quietly: the tool stayed visible with its inspector off, or kept writing underagent.readOnly. Every built-in agent tool and resource now has one entry inAGENT_ENTRIES(101 entries, grouped by inspector), and the old lists derive from it.AGENT_INSPECTOR,AGENT_SAFETY,READ_ONLY_VARIANTS,ACTION_TOOLS,ACTION_TOOL_FREE_MODESandPAGE_AGENT_ENTRIESkeep their exported names, types and values.agentTags()andagentInspector()read the entry. The derivations are marked/* @__PURE__ */, so the panel bundle does not change (pnpm extension:buildgives no diff). The table lives inconfig.tsbecause the panel compiles it withoutallowImportingTsExtensions.Nothing changes in behaviour. The old exports were dumped before any edit and compared with the new ones: no differences. That dump is committed as a test fixture.
Docs:
AGENTS.md's quiet-failure rule, "Add an agent tool" in the contributing guide (a field table, the coverage test and the fixture step),docs/CONTEXT.md, and thedevtools-inspectoranddevtools-fix-issueskills.Left as they are: the
clear-recordingsspecial case inagentAllowed, andRPC_INSPECTOR, which is still kept by hand.Refs #372.
How it was verified
pnpm commit:checkpnpm format:checkpnpm typecheckpnpm test:devtools(3116) andpnpm test:panel(738). Newagent-metadata.test.ts:lint-pipesentry makes it fail by name);pageTools: falsedrops exactly thepageentries;RPC_INSPECTORand with each other.pnpm skills:checkapps/docsupdated andpnpm docs:buildpassespnpm extension:build: no change toextension/uiSummary by CodeRabbit