Repository navigation
perf(hook): avoid Pi package barrel import - #2938
Conversation
kingpy-bot
left a comment
There was a problem hiding this comment.
Independently verified this on exact head 3e7d02d7b4bdcfaba8793433267c83721a34de44. The only runtime value import from the Pi package barrel is removed; the replacement imports are type-only and the local toolName === "bash" guard preserves the handler's runtime filtering before reading event.input.command.
In an isolated Rust 1.91 container, the focused Pi install regression passed, cargo fmt --all --check and cargo clippy --all-targets -- -D warnings passed, and the full cargo test --all gate passed (2,493 tests, 8 ignored). The installed-extension assertion also exercises the intended no-runtime-named-import invariant.
AI-assisted review.
KuSh
left a comment
There was a problem hiding this comment.
LGTM except a few comments missing to document things
…#2753 Also fixes two docs left stale by the barrel-import removal: hooks/pi/README.md and hooks/README.md still described bash-tool detection via the removed isToolCallEventType value import. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Summary
Fixes #2753
Test plan
hooks/pi/rtk.tsagainst@earendil-works/pi-coding-agent0.80.6cargo test test_run_pi_mode_global_installs_plugincargo fmt --all --check && cargo clippy --all-targets && cargo testTiming
With Bun 1.3.14 on macOS arm64, loading the package barrel took about 250 ms after warmup. Loading the small extensions module took about 10 ms.