Repository navigation
Description
Implement GitHub issue #5421 in developing-today/code: fix(pm-stack): apply-config.sh treats DRY_RUN=0/false as dry-run — ready-for-agent config silently never applies
Finding
pm-stack/ready-for-agent/apply-config.sh (added by PR #3311, for #1203) decides dry-run mode with Python truthiness on the raw environment string:
apply-config.sh:28—export DRY_RUN="${DRY_RUN:-}"apply-config.sh:38—dry_run = bool(os.environ.get("DRY_RUN"))
bool("0") and bool("false") are True in Python, so DRY_RUN=0 ./apply-config.sh — or an ambient DRY_RUN=false in the caller's environment — runs as a dry run: every mutation becomes a DRY-RUN would ... print, the script exits 0, and the final line reads ready-for-agent config applied (dry run). Nothing is registered, configured, or unpaused, and nothing fails.
This matters because the same PR wired ./apply-config.sh into pm-stack/ready-for-agent/install.sh to run on every install run after the harness is verified serving. An operator or unit environment that carries a conventional false-y DRY_RUN=0 therefore silently defeats the declarative config (#1203) forever: the harness settings (including the fleet's mergePolicy: OFF human-merge posture) never converge, with a success exit and no error anywhere.
Verified live on current main (991bb49, 2026-11-04): lines 28 and 38 above are unchanged from the PR. The PR's own test, pm-stack/ready-for-agent/test-apply-config.sh, covers DRY_RUN=1 (mutates nothing) and unset (applies) only — no false-y value is pinned.
Evidence
- Source PR: feat(pm-stack): declarative ready-for-agent config + aggregator dispatch source (#1203) #3311
feat(pm-stack): declarative ready-for-agent config + aggregator dispatch source (#1203), merged 8ee2e1c; apply-config.sh introduced in commit dcea7fa. pm-stack/ready-for-agent/apply-config.sh:38on main:dry_run = bool(os.environ.get("DRY_RUN")).- Contrast with the fleet's dry-run semantics findings in the dangerous direction (sync-models: unrecognized arguments are silently ignored — a typo'd --dry-rnu rewrites the live OpenCode config in place (and reloads opencode) #3297, github-backup(worker deploy): unrecognized arguments are silently ignored — a typo'd --dry-rnu performs a real deploy (upload + secret reset) #3287): there an unrecognised flag meant a real mutation; here a recognised false-y value silently means no mutation, reported as success.
Acceptance criteria
- Only an explicit truthy value (
1, and if supportedtrue) enables dry-run;0,false,no, empty, and unset all apply for real (case-insensitive where applicable). test-apply-config.shgains a case proving a false-yDRY_RUNvalue (e.g.DRY_RUN=0) actually sends mutations to the stub harness.- The script header documents the accepted dry-run values.
- Existing test cases (dry-run mutates nothing; first apply registers/configures/unpauses; second apply is a no-op) still pass.
Found by the pr-diff-review job reviewing PR #3311; triage first against current main before fixing.
Rules from the repo owner: (1) Deliver the finished work as a pull request in this run; put "Fixes #5421" in the PR description so the issue closes on merge. (2) Cover the whole set in the one PR: if the issue names a set (files, subcommands, cases), fix every member, and batch any directly related dependency updates into the same PR — never one PR per item or per dependency. (3) Run the relevant tests and checks before opening the PR. (4) Merging is permitted but never required: merge only when checks pass and you are reasonably certain the PR is correct and low-risk — otherwise leave it open, and state your confidence and what a human should check. (5) If you hit a genuine blocker (missing credentials, a decision only the owner can make), stop and say exactly what is needed in your final summary instead of guessing.
Launched by pm-dispatch for developing-today/code. Queue task and OpenCode session ids follow in a comment below.
Activity
developing-today commentedon Nov 4, 2026
Dispatch launch confirmed.
dezren39 commentedon Nov 4, 2026
Stand-down: this tracking issue belongs to pm-dispatch session ses_e5e594c5081ffeAPNQmQjGx2sC (task 9533), which was a duplicate dispatch of #5421. The two daily top-issue jobs (rotating + code-dedicated) both fired at 07:12 and both selected #5421 within ~22 seconds — the rotating job's session ses_e5e594cc7dbffeQhm3TWhSNM38 (task 9531, tracking #5458) launched first and is the surviving worker. This session has been deleted via the OpenCode server API (DELETE returned 204; follow-up GET returns SessionNotFoundError). Closing this tracking issue as a duplicate dispatch; the race itself is filed separately.
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done