-
Notifications
You must be signed in to change notification settings - Fork 9
fix: use snip check/run subcommands, fix pipe handling, fix multi-word args for snip check #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lenucksi
wants to merge
10
commits into
VincentHardouin:main
Choose a base branch
from
lenucksi:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+284
−137
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
eed7f17
feat: use snip check/run subcommands instead of hardcoded unproxyable…
lenucksi 2aa8086
fix: split cmd into separate args for snip check
lenucksi 2ea4f7a
fix: handle all pipe segments, not just the first
lenucksi d27373f
docs: add pipe handling documentation
lenucksi 9642c59
feat: prevent double snip prefix in &&/| compound commands
lenucksi 882fa4b
refactor: apply PR feedback - simplify tests, add snip version check,…
lenucksi dad0801
fix: add .nothrow() to hasSnipSubcommands to avoid false-positive on …
lenucksi a421df4
fix: use client.app.log for type-safe logging, add dev commands to RE…
lenucksi 952faf4
fix: pass first two words as separate raw args to snip check (avoid a…
lenucksi bdb4410
feat: inject usage instructions into system prompt via experimental.c…
lenucksi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new multi-segment pipe processing, every pipe segment is independently evaluated by
shouldWrap. BecauseWRAPPED_COMMANDSincludes"head","grep","jq","cat", and"echo"(all matched bybaseCmd), every segment of a pipeline gets wrapped. However, the expected values throughout this section were copied from the old single-segment tests and still show only the first segment wrapped.Concrete failures:
git log | head→ actualsnip run -- git log | snip run -- head, expectedsnip run -- git log | headcat file.json | jq '.content | .text'→ actualsnip run -- cat file.json | snip run -- jq '.content | .text', expectedsnip run -- cat file.json | jq '.content | .text'find / -name "*.log" 2>&1 | grep error→ bothfindandgrepget wrapped, expected onlyfindecho "hello | world" | cat→ bothechoandcatwrapped, expected onlyechoThe
WRAPPED_COMMANDSset also contains full-pipeline strings like"cat file.json | jq '.content | .text'"that can never match after pipe splitting — those entries are dead weight. Either removehead,grep,cat,jq,echofromWRAPPED_COMMANDSso the mock simulates a realisticsnip check(onlygit,go, etc. have filters), or update the expected values to reflect both segments being wrapped.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved — WRAPPED_COMMANDS/defaultShouldWrap removed in favor of
mockedWrap = async () => true. All pipe expectations updated so every segment is wrapped. Bothgit log | headandcat file.json | jq ...expectations now correctly show both segments prefixed.