fix(agents): alias Pi tool names that collide with its built-ins - #335
Merged
Merged
Conversation
zzet
approved these changes
Jul 25, 2026
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
Pi has no native MCP support — extensions register tools into a flat, unprefixed registry, and Pi lets a same-named registration silently override a built-in (
read,bash,edit,write,grep,find,ls). Gortex's default facade-v1 surface includeseditandread, so the Pi bridge was overriding those two built-ins with a generic relay that doesn't match Pi's expected result shape — breaking the built-in's own rendering (edited filename showed as"...") and any extension hooked to the built-in shape (e.g. a lint-on-edit plugin expecting the nativeedittool).Changes
gortex_edit,gortex_readtoday) instead of prefixing every Gortex tool, since a blanket prefix has previously confused the model — Gortex's own guidance and tool descriptions reference bare names elsewhere.safeRegisternow registers under the alias name and returns the name actually used;registerOneTooldedupes against the aliased name.internal/agents/pi/extension/index.ts) — no server-side/shared code changed, since the collision is specific to Pi's flat tool registry.cmd/gortex/testdata/agent-render/pi.txt).Testing
go test -race ./...)TestAgentsRenderGolden) for the embedded extension source; no separate unit test addedChecklist
Meta["methods"]for interfaces (if applicable) — not applicableEdgeMemberOfedges to their containing type (if applicable) — not applicable