Skip to content

Fix #5421: fix(pm-stack): apply-config.sh treats DRY_RUN=0/false as dry-run — ready #5461

Closed

Description

@developing-today

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

Acceptance criteria

  • Only an explicit truthy value (1, and if supported true) enables dry-run; 0, false, no, empty, and unset all apply for real (case-insensitive where applicable).
  • test-apply-config.sh gains a case proving a false-y DRY_RUN value (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

  1. developing-today commented on Nov 4, 2026

    @developing-today
    ContributorAuthor

    Dispatch launch confirmed.

  2. dezren39 commented on Nov 4, 2026

    @dezren39
    Member

    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.

  3. dezren39 commented on Nov 4, 2026

    @dezren39
    Member

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions