Skip to content

Preserve Pi builtins in replace mode without hypa replacements - #95

Merged
matt-gribben merged 1 commit into
mainfrom
fix/93-replace-mode-subagent-builtins
Aug 13, 2026
Merged

Preserve Pi builtins in replace mode without hypa replacements#95
matt-gribben merged 1 commit into
mainfrom
fix/93-replace-mode-subagent-builtins

Conversation

@matt-gribben

Copy link
Copy Markdown
Collaborator

Summary

HYPA_PI_MODE=replace no longer strips Pi bash/read/grep/find/ls unless 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 no hypa_* tools (the allowlist excludes extension tools), so replace mode left general-purpose with only edit/write and Explore with nothing.

Replace mode now pairs builtins to replacements and fail-opens when the counterpart is missing:

  • bashhypa_shell
  • readhypa_read
  • grephypa_grep
  • findhypa_find
  • lshypa_ls

before_agent_start is unchanged, so parent-session replace mode and /reload still strip builtins when the Hypa tools are present.

Test plan

Closes #93

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
Copilot AI lite review requested due to automatic review settings August 13, 2026 00:34
@matt-gribben matt-gribben added the bug Something isn't working label Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@matt-gribben
matt-gribben merged commit 2678616 into main Aug 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pi-hypa: HYPA_PI_MODE=replace strips built-in tools in subagent sessions, leaving only edit/write

2 participants