You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Permission patterns truncated/skipped when parsing commands with tree-sitter-powershell (Windows) — allow rules never match #52615
On Windows (default PowerShell shell), the bash tool builds permission patterns from a tree-sitter-powershell parse of the command (shell.ts: (ps ? p.ps : p.bash).parse(command)), and that grammar breaks on common POSIX shapes. The broken text is what reaches the permission evaluator:
--flag=value truncation — the command node closes before the =, so the pattern loses everything from =value onward. An allow rule matching the full command never matches → last-rule * deny wins → an explicitly allowed command is denied.
Trailing standalone -- — parse root becomes ERROR with zero command nodes → patterns.size === 0 → the permission check is skipped entirely → the command runs with no check at all (opposite failure).
tree-sitter-bash 0.25.0 parses every one of these correctly; only the PowerShell path breaks them.
Steps to reproduce
Windows 11, PowerShell 5.1, OpenCode 1.18.34 (latest)
Activity
github-actions commentedon Oct 2, 2026
This issue might be a duplicate of existing issues. Please check:
chezmoi git -- pushbypasses configured bash permission checks.--double hyphen #39931: Bash commands containing a standalone--bypass permission checks.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊