Repository navigation
feat(harness): declare only direct and model tools to the model - #111
Merged
Merged
Conversation
Tools gain an optional `exposure` (direct, model, codemode, deferred, hidden; default direct). The resolved snapshot's wire, defs and executor cover only declared tools, so a call to any other tool gets `Unknown tool`. The registry still lists every tool for a later tool search. The bash file-ops rule and the skills hint consider declared tools only. 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.
Summary
@codeworksh/plugin): tools take an optionalexposure:direct(the default),model,codemode,deferredorhidden, defined as theToolExposureschema.declared(def)is the single rule for which tools the model can see, and onlydirectandmodelpass it. Pi calls themodelvaluemodel-only; we use single words for all five.setup.Unknown tool: <name>error.Registry.defs,namesandgetDefstill list every tool, so a later tool search can find deferred ones.<tools>and the tool guidelines already follow the resolved snapshot, so they need no change.readorbash, and<skills>is left out when neither is declared. This matches Pi.exposurerow in the plugin authoring docs, and Unreleased CHANGELOG notes for the plugin and harness packages.This change doesn't load deferred tools yet; the follow-up adds
resolve(loaded)and tool search. Codemode calls and the MCPexposuremapping are also out of scope.Tests
runner.loop.test.ts"tool exposure", artifact__artifacts__/tools.exposure.json:directandmodeltools.<tools>and the rules leave the other exposures out.bashashiddenremoves the bash rule.deferredtool returnsUnknown tool.plugin.skill.test.ts, artifact__artifacts__/prompt.skill.exposure.json, using example skills under.agents/skills:readhidden: the hint names bash.readdeferred andbashcodemode: no<skills>.readasmodel: the hint names read.vp checkandvp run typecheckpass, and so do the five related harness suites (57 tests).🤖 Generated with Claude Code