Preserve Pi builtins in replace mode without hypa replacements - #95
Merged
Conversation
Strip a Pi builtin only when its paired hypa_* tool is active in the same session. Subagent allowlists that omit hypa_* keep bash/read/grep/find/ls instead of being left with only edit/write. Closes #93
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
HYPA_PI_MODE=replaceno longer strips Pibash/read/grep/find/lsunless the matching Hypa tool is actually active in that session.This is a regression from #26: the replace-mode filter correctly moved to
before_agent_start, but that hook also runs in Pi subagent sessions. Those children typically have nohypa_*tools (the allowlist excludes extension tools), so replace mode leftgeneral-purposewith onlyedit/writeand Explore with nothing.Replace mode now pairs builtins to replacements and fail-opens when the counterpart is missing:
bash↔hypa_shellread↔hypa_readgrep↔hypa_grepfind↔hypa_findls↔hypa_lsbefore_agent_startis unchanged, so parent-session replace mode and/reloadstill strip builtins when the Hypa tools are present.Test plan
cd packages/pi-hypa && npm test(87 passing)cd packages/pi-hypa && npm run buildhypa_*, partial allowlist, unpairedhypa_mcp_proxy, inverted order, hook wiring, and reload (pi-hypa: HYPA_PI_MODE=replace 不生效,原始工具未被移除 #26)Closes #93