Skip to content

fix(core): run shell permission check even when command can't be parsed - #55883

Closed
Parker-Fawcett wants to merge 1 commit into
anomalyco:devfrom
Parker-Fawcett:fix/shell-unparseable-permission
Closed

Parker-Fawcett wants to merge 1 commit into
anomalyco:devfrom
Parker-Fawcett:fix/shell-unparseable-permission

Conversation

@Parker-Fawcett

@Parker-Fawcett Parker-Fawcett commented Oct 15, 2026 •

Copy link
Copy Markdown

Fixes #54393.

The shell tool skipped permission.assert whenever the scanner extracted no command nodes (e.g. a PowerShell command containing a bare --, or any other input the grammar turns into zero nodes). Such commands bypassed configured shell rules entirely.

Now the raw command is checked as one opaque resource, so it still has to satisfy the rules; with no matching rule the default effect is ask. An "always" reply is deliberately not persisted for these (save: []), so no standing allow is minted from unparsed text.

How to verify: new test denies shell commands the legacy scanner turns into no commands in packages/core/test/tool-shell.test.ts (fails on dev, passes with the fix). Also ran permission.test.ts (105 pass) and bun typecheck in packages/core (clean); the 6 tool-shell.test.ts failures in conditional-process-substitution/compound-syntax cases pre-exist on dev in this environment.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot closed this Oct 15, 2026
@opencode-agent

Copy link
Copy Markdown
Contributor

Thanks for picking up #54393!

I think this duplicates an existing open pull request:

If you think one of those is missing something, for example a test for the PowerShell -- case, a review, test or comment there would be very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shell: bare "--" in a pwsh command skips the permission check

1 participant