Skip to content

Codex skills no longer stop on temp-file cleanup, which Codex refuses as rm -f (GST-3364) - #4612

Merged
capy-ai[bot] merged 6 commits into
mainfrom
codex-renders-stop-using-forced-rm
Nov 21, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
codex-renders-stop-using-forced-rm

Conversation

@garrytan

@garrytan garrytan commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Skills that clean up temp files now run on Codex: Codex CLI refuses any rm with a force flag, and 67 of the 1,239 shell blocks in gstack's Codex skills used one.
This unblocks gstack on Codex (office-hours, review, ship, the plan reviews, spec and gstack-upgrade all hit it). Nothing to do after merging.

What Codex refuses, and where it comes from

Codex 0.170's codex-rs/shell-command/src/command_safety/is_dangerous_command.rs (rm_args_include_force_option) flags any literal rm whose arguments before -- include --force or a single-dash cluster containing f (-f, -rf, -fr, -Rf). It parses the whole script with tree-sitter, so text inside trap '...', $(...) and bash -c counts too. codex-rs/core/src/exec_policy.rs then returns Forbidden when approvals are off ("rm -f style commands are not permitted. Use a safer approach") and Prompt otherwise. Both files are unchanged at tag rust-v0.170.0. The rule has been in place since the forced-rm hardening in 0.145 (openai/codex#33464).

What changed
  • The templates and shared resolvers that render into the Codex skills now use plain rm <file> where the file is known to exist, rm <file> 2>/dev/null || true (or [ ! -e <file> ] || rm -- <file>) where it may already be gone, and rm -r <dir> for folders. /ship's leftover-worktree cleanup adds </dev/null: without -f, rm -r asks about every read-only file when it runs on a terminal, and a git checkout's pack files are read-only. /gstack-upgrade uses plain rm -r, because its size budget had 14 bytes left. Agent shells give it no terminal, so it does not ask there.
  • Prose and echo hints that tell the agent to run rm -rf now say rm -r. /careful and /guard keep their examples, because those list what the guard warns about.
  • test/codex-forced-rm.test.ts renders the Codex host and fails on any forced rm in a shell fence or inline code span. It also checks Codex's own test cases: the positive ones are flagged, and gstack's cleanup forms are not.
  • The docs-audit reset in /ship Step 14.5 changed, so the docsync fixture interface now uses the new command. Captured runs that used the old command still replay.
  • The pins on three /ship and /review section files move to replay GST-3364. Only their shell cleanup lines changed, and every reviewer brief keeps its pinned bytes, so this is a deterministic no-loss check, as in GST-3075. The per-host size pins drop to the new, smaller sizes.
  • Generated SKILL.md and section files are regenerated. /ship grows by 88 bytes, recorded in test/size-ledger/ship, and every other skill stays the same size or shrinks.
Agent notes
  • Repro: Codex 0.170's real classifier, built from bash.rs and is_dangerous_command.rs at rust-v0.170.0 with its own 30 unit tests passing, refused 67 of the 1,239 shell blocks across 34 Codex render files on main (2 in office-hours/SKILL.md, matching GEVA-555). It refuses 0 on this branch. The 187 blocks tree-sitter can't parse (placeholders) are the same before and after, and the new text-level test covers them.
  • The new test fails on main with 90 hits and passes here.
  • The edit to office-hours/SKILL.md is limited to the two bash lines that come from the shared gbrain and aside resolvers (/office-hours checks for a real user first and ends startup sessions with a dated test (GST-3024) #4468 also touches the file).
  • Paid evals were not run. The selector picked 109 behavioral probes as a full fallback because generate-test-failure-triage.ts is a shared input. The change is shell cleanup lines only, and every reviewer brief keeps its bytes (replay GST-3364), so the maintainer ruled to skip them on 2026-11-21.
  • Review: pass 1 at 883f447 and its fix round (ae2a25e, which adds </dev/null to gstack-upgrade's rm -r calls) were followed by a second-model finding that the Step 7 cleanup skipped dangling symlinks. 0becf55 fixes that with an -L check, under the PR's one exception granted by the maintainer: one read-only full review, no further fix round.
  • Focused local run: 1,956 pass, 19 skip and 1 fail across 52 files. The failure was docsync-fault-interface 'seeded attempt 1', which timed out at its 5 s limit under parallel load and passed alone in 4.6 s at the same tree. It is logged as flaky and the branch doesn't touch it. typecheck and typecheck:test are clean, and the parity suite passes.

Approvals

Approved: yes (record r-1343d7e1a629). The full approval record stays private.
Plan: exempt: bug fix
Plan check: exempt bug fix
Ruled note: p1/outside-voice#1 at 0becf55 ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-21-ruling) at 2026-11-21T15:25:58.555Z: Fixed in b307f1f; the granted fix-check a-1c775510dc90 (range 0becf55..b307f1f) came back clean; finish did not count it only because of the range_base defect GST-3260 is fixing (approval a-53e7a1a73c97)

Open in Capy

{
  "schema_version": 1,
  "pr": 4612,
  "head": "b307f1fde39ebd374baccf06d31b6eaab79540b1",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "codex-forced-rm": {
      "pass": 3,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "run": "ship-4612",
  "head_tree": "4eea028ac5c995b20f04a6c4f84dc169cfdb0f94",
  "product_patch_id": "0ee48b096cadf4c6ddc631e562bc647c9dfa800b",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 115,
    "rules": "85b3923b1a978e41",
    "base": "43c9c201e34b6d6a4b75418ec4d20e147557dd80",
    "registry": "43c9c201e34b6d6a4b75418ec4d20e147557dd80",
    "gate_scan": {
      "tagged": 0,
      "head": "b307f1fde39ebd374baccf06d31b6eaab79540b1"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=115"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @4eea028ac5c9 (8 checks, current for b307f1fde39e)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44918175165/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44917618586/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=4eea028ac5c9 tests=38685 skipped=104 runs=44918175165/1 profiles=ci-reuse/free-tests heads=b307f1fde39e verified=2026-11-21T15:21:33.628Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, CONTRIBUTING.md and docs/ (read-only audit)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "review_round_grants": [
    {
      "kind": "extra-round",
      "head": "0becf55f20664ab1e8a830d5ba62844ea8d24232",
      "pr": 4612,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "Captain exception: one read-only full review of the final head after the -L guard (outside-voice#1), no fix round",
      "at": "2026-11-21T14:53:05.377Z",
      "approval": "a-81e9c2e2af05"
    },
    {
      "kind": "fix-check",
      "head": "0becf55f20664ab1e8a830d5ba62844ea8d24232",
      "pr": 4612,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "Captain exception 2: existence-guarded .git removal so a real failure breaks the chain",
      "at": "2026-11-21T15:09:20.130Z",
      "approval": "a-1c775510dc90",
      "stop_run": "ship-4612",
      "findings": [
        "p1/outside-voice#1"
      ]
    }
  ],
  "ruled_notes": [
    {
      "finding": "p1/outside-voice#1",
      "head": "0becf55f20664ab1e8a830d5ba62844ea8d24232",
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "Fixed in b307f1f; the granted fix-check a-1c775510dc90 (range 0becf55..b307f1f) came back clean; finish did not count it only because of the range_base defect GST-3260 is fixing",
      "at": "2026-11-21T15:25:58.555Z",
      "approval": "a-53e7a1a73c97",
      "relayed": "GSTA-36:2026-11-21-ruling"
    }
  ],
  "gate_dispositions": []
}
{"head":"0becf55f20664ab1e8a830d5ba62844ea8d24232","run":"ship-4612","mark":"stop","tree":"d8e1064446088e7328a783d7226173d560046321"}

…GST-3364)

Codex CLI 0.170 refuses any rm with a force flag, so 67 of 1,239 shell blocks in the Codex skills were rejected. Templates and resolvers now use plain rm, rm <file> 2>/dev/null || true, or rm -r, and a new test renders the Codex skills and fails on any forced rm.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 5 commits November 21, 2026 14:07
… section files (GST-3364)

gstack-upgrade drops the extra guards to stay under its size ratio, the per-host size pins drop to the smaller sizes, the three section files whose cleanup lines changed are repinned under deterministic no-loss replay GST-3364, and the targeted-record test checks the new reset.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Removing a git checkout with plain rm -r asks about read-only object files when stdin is a terminal. Close stdin on those removals, and spell out the two update-marker paths so POSIX sh removes them too.

Review-Finding: p1/specialist-batched#1 reader=state-machines
Review-Finding: gstack-upgrade/SKILL.md.tmpl:363:posix-sh-brace-expansion reader=core
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The missing-file guard also checks -L, so a dangling symlink is removed as it was with rm -f.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The .git removal is guarded only for an absent path, so a real removal failure breaks the chain and restores the previous vendored copy, as rm -rf did.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit bd77c8c into main Nov 21, 2026
85 checks passed
@garrytan garrytan mentioned this pull request Nov 21, 2026
capy-ai Bot added a commit that referenced this pull request Nov 21, 2026
- Habits from nine teams, written into gstack. (#4585)
- Three more habits from teams that run evals. (#4602)
- The /ship conductor trial plan gives its real-problem judge one more attempt on fresh labels after it missed its agreement bar twice, and stops the trial incomplete if it misses again (GST-3003). (#4611)
- The /ship conductor trial plan now stops a trial only at the final remote-gate refusal, gives both arms the same note that the brief overrides team rules, and counts every report the no-gstack arm returns (GST-3003). (#4609)
- The /ship conductor trial plan now ends a trial at the remote gate when its case base isn't main, gives the no-gstack arm a test runner, and audits every trial for exposure to the plan (GST-3003). (#4605)
- The /ship conductor trial plan now runs an uncounted pilot in every arm before its counted trials and takes one planned look at half the cases (GST-3003). (#4587)
- gstack's own use on Capy can be counted, and is kept out of real-use numbers. (#4576)
- Free Tests shards finish closer together. (#4578)
- The weekly test-time recording can land again on its own. (#4581)
- The job-log tree.json step's recommended sleep is long enough for real runners. (#4589)
- Pull requests no longer wait on the Trunk flaky-test upload, and the quick tier's flaky passes now reach Trunk. (#4579)
- Windows Setup E2E finishes sooner on install changes. (#4575)
- Skills no longer stop on Codex when they clean up temp files. (#4612)
- /review on Codex with OpenAI models no longer holds back a review that ran its adversarial pass. (#4622)
- Crew threads on Capy now check in at 500M own tokens, standing threads rotate at 250M and any subagent past 50M gets a look, half the old lines, because Capy's token counts read about half what they did before 2026-11-15. (#4582)
- gstack no longer offers to add a `## Skill routing` section to your project's CLAUDE.md. (#4629)
- The README and docs no longer say gstack makes your agent fix more bugs. (#4598)
- `/eval-plan` now writes eval plans that waste less money. (#4591)
- /cso checks every folder above a source file before it looks at the file, so it never looks through a symlinked folder. (#4592)
- Plan reviews no longer read a /design-review audit summary as the branch's design doc. (#4623)
- Node's built-in test files now run with `node --test` in repos that use vitest or jest. (#4626)
- A quarantined test that the runner skipped now fails the run instead of passing it. (#4590)
- A flaky free test is fixed: the spawnSync overflow check no longer fails about once an hour on CI. (#4613)
- Free Tests runs its shards on 16-core runners. (#4600)
- /office-hours asks for ground truth first. (#4468)
- Every startup session ends with a dated test. (#4468)
- /plan-tune's dream cycle now logs each send of your typed answers to Anthropic. (#4621)
- Landing a ready PR no longer depends on a hand-copied gate decision, and the ready note, release PR and squash message say the right thing. (#4596)
- /ship no longer asks for a fresh review because of a stacked parent that main already had. (#4580)
- Results PRs with large captured agent sessions can be reviewed. (#4574)
- /ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body. (#4595)
- /ship's review readers are now told never to stop processes they didn't start. (#4607)
- /ship's review no longer stops when Capy's own drive sync database grows past 100 MB. (#4606)
- /ship's preflight now honors your repository's time limit for rerunning CI-skipped tests, and tells you when a fresh worktree needs its packages installed. (#4608)
- The slowest free test file is now six files. (#4588)
- Step 11.5 keeps a reviewed head current across base-only merges. (#4577)
- On a Capy install, only the owner's opt-in sends telemetry. (#4597)
- New page: working across agent systems. (#4583)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot added a commit that referenced this pull request Nov 22, 2026
… findings it fixed (GST-3260) (#4664)

/ship now closes a review finding when its fix round was granted and a
follow-up check read the fix clean, or when the fix commit names the
finding and a later full review reads it clean. Before, someone had to
write a ruling by hand.

Why: since this was missing, PRs whose findings were already fixed and
checked stalled at the round limit (#4537, harness-evals#508, #4597,
harness-evals#504, #4612).

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
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