Skip to content

fix(examples): make example 61's CLI usage deterministic - #166

Merged
ling-senpeng13 merged 1 commit into
mainfrom
fix/example-61-deterministic-cli
Aug 20, 2026
Merged

fix(examples): make example 61's CLI usage deterministic#166
ling-senpeng13 merged 1 commit into
mainfrom
fix/example-61-deterministic-cli

Conversation

@ling-senpeng13

@ling-senpeng13 ling-senpeng13 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Example 61's pipeline failed in a retry spiral: models wrapped compound commands in bash -c (rejected — not allowlisted), the instructed step-3 command itself started with TMPDIR=$(...) (also rejected by first-token validation), the coder had no file-writing command, and models invented placeholder cwd paths. The repeated rejections tripped the circuit breaker and Conductor's 256 KB workflow-variables limit.

Changes (prompting-only, no SDK code):

  • Shared TOOL RULES block for all four CLI stages: pass compounds directly with shell=true, never bash -c/sh -c, first word must be allowlisted, never invent cwd
  • Instructed commands rewritten to be validator-legal (mktemp -d as its own step; compounds lead with gh)
  • Allowlists completed: echo/printf for the coder, cat for the read-only stages

Considered and rejected: allowlisting bash. It would eliminate the wrapper rejections, but validation is first-token-only, so bash -c '<anything>' makes the allowlist decorative — and this example exists partly to demonstrate the allowlist as a guardrail. The better long-term fix is SDK-side: unwrap bash -c and validate the inner command.

Verified: repeated runs with zero command rejections (previously 10+ per run); one full end-to-end success (issue → commit → real PR on the sandbox repo). Note: deep swarm-stage reliability on Anthropic models also depends on a server-side history fix, outside this PR's scope.

@ling-senpeng13
ling-senpeng13 force-pushed the fix/example-61-deterministic-cli branch 2 times, most recently from 9185c44 to aaf97ce Compare August 18, 2026 22:54
@ling-senpeng13
ling-senpeng13 marked this pull request as ready for review August 18, 2026 22:57
The chained GitHub pipeline failed in a retry loop: models wrapped
compound commands in 'bash -c' (rejected — bash not allowlisted), the
instructed step-3 command itself started with a VAR=$(...) assignment
(also rejected), the coder had no file-writing command in its
allowlist, and models invented placeholder cwd paths.

Add shared TOOL RULES to every CLI stage (no shell wrappers, first
word must be allowlisted, no placeholder cwd), rewrite the instructed
commands to be validator-legal, and allowlist echo/printf for the
coder.
@ling-senpeng13
ling-senpeng13 force-pushed the fix/example-61-deterministic-cli branch from aaf97ce to f2af89d Compare August 19, 2026 01:01
@ling-senpeng13
ling-senpeng13 merged commit 1e61938 into main Aug 20, 2026
24 of 27 checks passed
@ling-senpeng13
ling-senpeng13 deleted the fix/example-61-deterministic-cli branch August 20, 2026 22:45
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.

2 participants