Fix Pi raw mode accepting compound shell commands - #97
Open
just-a-node wants to merge 1 commit into
Open
Conversation
just-a-node
force-pushed
the
fix/pi-raw-shell-validation
branch
from
September 2, 2026 03:08
f13d7e7 to
d1b5514
Compare
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_shellcalls that combineraw: truewith shell operators, redirects, quoting, substitutions, escapes, or multiline inputWhy
hypa rawreceives an argv array after the user's interactive shell has parsed the command. The Pi adapter instead receives a command string and currently reconstructs argv withsplit(/\s+/). Although the implementation comment says complex syntax must use compressed mode, the tool contract does not communicate or enforce that restriction.For example, this Pi call:
{"command":"mkdir fixture && cd fixture && git init","raw":true}currently invokes
mkdirwithfixture,&&,cd,fixture,&&,git, andinitas ordinary arguments. That can silently create unintended filesystem entries. The new validation fails before spawning Hypa and directs callers to omitraw, allowing compressed mode to own shell parsing.Validation
npm run build— passesnpx tsx --test test/tools.test.ts— 24/24 passnpm test— the new tests pass; the suite retains 3 unrelated failures on unmodifiedmainin bundled-native binary resolution tests (resolveBundledHypaBinary/resolveHypaBinary)No CLI flags or core
hypa rawbehavior change; this only enforces the Pi adapter's existing documented-in-code restriction.