Repository navigation
Add a parity guard for the four ACP shim tool definitions - #1936
Merged
Merged
Conversation
The four per-agent shims in packages/skill/shims/ hand-author the same five tool definitions and are deliberately un-shareable (each is copied standalone into an agent session temp dir with no runtime module resolution), so nothing prevented them from drifting out of agreement. Add a vitest guard that extracts each shim's tool names + descriptions and asserts they all match the gemini manifest (the machine-readable reference): codex and opencode on name + description, and claude-code — which registers by name via hook() and carries no per-tool description — on names. A rename or description edit in any one shim without the others now fails the standard test suite. All four agree today. Co-Authored-By: Claude <[email protected]>
Contributor
Author
|
APPROVE Single-pass review (test-only, no product logic). The guard is sound and fails safe:
Runs in the standard |
4 tasks
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
The four per-agent ACP shims in
packages/skill/shims/(claude-code/nodespace-hook.ts,codex/nodespace-plugin.ts,gemini/nodespace-tools.json,opencode/nodespace-plugin.ts) hand-author the same five tool definitions. The duplication is deliberate — each shim is copied into an agent session's temp directory as a standalone script with no shared runtime module resolution, so they can't import one source — but nothing verified they stay in agreement. This adds the automated guard (acceptance criteria).packages/skill/src/tests/shim-parity.test.ts(vitest, runs in the standardpackages/skillsuite) extracts each shim's tool names + descriptions and asserts they all match the gemini manifest (the machine-readable reference):{name: description}.name+ its owndescription(thedescription:immediately followingname:; parameter descriptions sit later in the schema and are excluded).hook('name', …)and carries no per-tool description, so only its tool names are comparable.A rename in any shim, or a description edit in codex/opencode/gemini without the others, now fails the suite. All four agree today.
Note on the issue's technical spec
The issue references a
SHIM_TOOLSregistry + ashim_tools_match_gemini_manifestRust test from #1509. That's stale — #1509 actually landed as "derive the ACP tool list from the Tool enum," and no such registry/test exists onmain. This implements the issue's real intent (a cross-shim parity guard) against the current code: a TS test in the TS package that owns the shims, rather than a Rust-side check.Verification
4 tests pass; I confirmed the guard catches drift by temporarily perturbing a codex description (the codex assertion failed) and reverting (back to green). The extraction fails safe — a missed tool leaves the map short of the reference's five, so drift can only make the test fail, never falsely pass. Full pre-push gate green.
Closes #1560
Co-Authored-By: Claude [email protected]