Skip to content

Preserve command bytes through sandbox shell quoting - #261

Open
qduc wants to merge 2 commits into
mainfrom
codex/shell-quote-roundtrip
Open

qduc wants to merge 2 commits into
mainfrom
codex/shell-quote-roundtrip

Conversation

@qduc

@qduc qduc commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Sandboxed Python and JavaScript commands containing ! can fail even though the original command is valid. The sandbox runtime repeatedly uses shell-quote 1.8.4; its double-quoted branch emits \!, and non-interactive Bash retains that backslash. Captured benchmark validation scripts consequently turned != and !r into invalid source and were regenerated.

Pin a minimal shell-quote patch through the existing pnpm patchedDependencies mechanism: emit a single-quoted bang between double-quoted segments. This preserves exact argument bytes without changing tool approval, sandbox policy, interpreter choice, or command semantics. Includes six real sandbox/child-process regressions and a diagnostic note with the upstream retirement condition.

Validation: typecheck/build, lint (40 existing warnings), 22 static guards, and all architecture/merge-base gates passed with no deviations. Provider black-box suite: 270 passed / 5 skipped. Six sandbox integration regressions passed. Identical captured failing commands now complete in the original nested benchmark sandbox. Independent verification accepted 4,112 byte comparisons across Bash/Dash and four nesting depths, eight real sandbox checks covering inert metacharacters, failure exits, credential/environment isolation and denied writes, plus exact patch/lock reproducibility. Actual macOS sandbox behavior remains untested.

This fixes a reproduced execution defect. Single-run token/cost experiments are retained separately and are not used as proof of a stable efficiency improvement.

The first CI run passed all lanes except an existing model-picker E2E readiness condition. A validated dependency trap showed that journey never loads shell-quote; identical baseline/candidate bundles and a controlled 1-second catalog delay reproduced the same navigation failure on both. The heading can appear with only the pinned model loaded. A separate validation commit waits for a fresh second-model row before navigating, preserving every favorite/nickname/selection assertion. The complete slash-command file passed 28/28; independent verification accepted the correction. CI’s precise timing was not captured.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant