Repository navigation
v7.198.1
Stop misreading POSIX shell-tool commands as cmd.exe, and stop rejecting >&1; in compound commands
What changed
- OpenCode 2 dispatches terminal commands as the
shelltool on POSIX hosts as well as Windows. The shell-write scope guard inherited a Windows (cmd/PowerShell) grammar for theshelltool from command content alone, so a Linux command that merely started withechowas parsed ascmd.exesyntax and could be rejected with a false-positive write-guard denial. Theshelltool now inherits that content-based Windows grammar only on Windows; off Windows it is a POSIX executor likebash. An explicitcmd /c/powershell -Commandwrapper, or a PowerShell-shaped body, still selects the Windows grammar on every platform, and Windows behavior is unchanged./swarm guardrail explainshares the same resolver, so its preview matches the gate. - The
cmdredirect scanner now treats;as the end of a>&<descriptor>token. Compound commands that duplicate a descriptor and are read under thecmdgrammar, such asgit status 2>&1; echo doneon theshelltool orcmd /c "git status 2>&1; dir", were previously rejected as an unresolvable write target; they are now recognized as plain descriptor duplication (no file written). A non-numeric target such as>&name;is still fail-closed, and a real redirect after the;is still detected and scope-checked. - Inline interpreter evaluation (
python -c,node -e, …) is unchanged: it stays fail-closed for every role. A safer way to let read-only pipelines through is tracked separately. This release therefore does not permit inline evaluation; the originally proposed change that did (and whose commit subject reads "permit read-only interpreter evals") was removed before merge because it let non-coder roles and scoped coders write protected paths.
Migration
No configuration or schema migration is required.
Addresses part of #3323 (items 1 and 2).