Repository navigation
fix(agents): remind exec models to quote shell metacharacters - #125485
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 6:36 PM ET / 22:36 UTC. ClawSweeper reviewWhat this changesAdds Unix-only shell-quoting guidance to the model-facing exec description and expands its direct and composed-description contract tests. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still omits Unix shell-metacharacter quoting guidance from the exec tool description. The focused change uses the shared description builder and covers both direct and final authorized-tool composition paths; no correctness finding was identified. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAgent tool assembly creates an exec tool description for the model, then finalizes the authorized tool set before a run. The description varies by host platform and available companion tools, affecting how agents form shell commands. flowchart LR
A[Agent tool assembly] --> B[Exec description builder]
B --> C{Host platform}
C -->|Unix| D[Quoting guidance]
C -->|Windows| E[Windows execution guidance]
D --> F[Final authorized tools]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +41. Total +41 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the shared Unix-only guidance after exact-head checks are green and GitHub confirms a clean merge. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the missing path: on Unix current main returns the base exec description without shell-quoting guidance, while the PR adds it at that branch. Is this the best way to solve the issue? Yes. Adding the reminder in the shared description builder reaches both direct exec creation and final authorized-tool composition without adding runtime policy or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d27b0e96204a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
6a3dcc6 to
16d2785
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
16d2785 to
6685010
Compare
|
Refreshed and verified at a74f33c97fa4. Exact-head CI passed, including these complete files:
The fix stays in the canonical exec-description owner: one Unix-only sentence, no additional runtime branch, and no change to Windows guidance or current process/scheduler wording. Production is +1/-1 (net zero); tests are +73/-32, including relocation of the complete existing description suite. The previous CI run caught the large test file exceeding its line limit; the dedicated description suite preserves every assertion, and the formerly failing lint lane now passes. Independent real Full-runtime/live-model proof was not completed: the isolated proof environment failed before candidate execution. The completed execution evidence is secretless exact-head CI plus the real zsh probes above; no live-model compliance claim is made. The earlier ClawSweeper current-main/history gap is resolved: the local merge base is Thanks @clawSean for the original fix. Contributor authorship is preserved. |
|
Merged via squash.
|
* origin/main: (26 commits) fix(plugins): preserve registry epoch on activation rollback (#129232) refactor(plugins): make discovery invocation-owned (#130486) feat(ui): save appearance preferences per user profile (#130340) fix: Buzz bots recover relay stalls and reject revoked senders (#130467) fix(code-mode): serialize catalog handles nested in final values (#130276) fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427) fix(agents): read the published model catalog owner from session_status (#130277) fix(channels): preserve long presentation text (#130368) fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325) refactor(plugins): unify setup registration and artifact selection (#130474) fix(memory): prevent forgotten session content from returning (#130451) refactor(outbound): consolidate transport completion (#130460) fix(workers): protect in-flight workspace manifests from concurrent retention (#130449) fix(portals): keep worker previews reachable and owned by the active environment (#130434) fix(config): keep core channels keys in the generated config schema (#120736) chore(deps): refresh dependencies after seven-day cooldown (#130296) fix(agents): remind exec models to quote shell metacharacters (#125485) fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437) fix(openshell): preserve file writes during concurrent mirror commands (#130447) fix(workers): report full nodes as at capacity, not offline (#130445) ...
…aw#125485) * fix(agents): remind exec models to quote shell metacharacters * test(agents): cover exec quoting across platform and tool availability * test(agents): isolate exec description contracts --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
exectool description?or&, a common source of zsh glob failuresWhat Problem This Solves
On Unix-like hosts, an agent can pass an unquoted URL/query argument such as
path?recursive=1toexec. Under zsh's defaultnomatchbehavior,?is treated as a glob and the shell aborts before the intended CLI runs.The current
execdescription explains backgrounding, cron, and PTY usage without warning about shell metacharacters. That leaves the model without the instruction needed to form shell-safe arguments.Why This Change Was Made
The model-facing
execdescription is the owning boundary for command-construction guidance. Adding one Unix-only sentence there reaches both the direct exec tool and the final authorized-tool composition without changing execution, approval, warning, or configuration behavior.The follow-up updates the two exact composed-description expectations that CI caught. Those expectations intentionally protect the final prompt bytes both with and without cron available; the direct builder test alone would not prove that the post-filter composition preserved the guidance.
User Impact
On Unix-like systems, models now receive a concise reminder to quote arguments containing shell metacharacters, explicitly including URL query strings with
?or&. This reduces commands that fail in the shell before the requested CLI can run. Windows guidance is unchanged.Evidence
node scripts/run-vitest.mjs src/agents/agent-tools.deferred-followup-guidance.test.tsnode scripts/run-vitest.mjs src/agents/agent-tools.deferred-followup-guidance.test.tsnode scripts/run-vitest.mjs src/agents/bash-tools.test.tsnode_modules/.bin/oxfmt --check src/agents/agent-tools.deferred-followup-guidance.test.tsgit diff --checkRendered final authorized-tool description on a Unix host:
The transcript contains no credentials, user paths, or other sensitive values.
Scope
No execution behavior, warning policy, config, or Windows guidance changes. The PR remains a +3 production-line / +6 test-line change; the follow-up updates two existing test lines with zero net line growth.
AI-assisted: yes. I reviewed the implementation, composed prompt behavior, and focused test results.