Repository navigation
Description
Finding (from PR review, never addressed)
pm-stack/ready-for-agent/install.sh: if install.sh clone upgrades the pinned npm package but the subsequent Git clone/fetch fails, the script exits (set -e) after npm has already replaced the on-disk binary, while the old process keeps serving. On the next invocation, both on-disk comparisons match — the binary at ~/.local/bin/ready-for-agent reports the pinned version and the unit is unchanged — so the script takes the no-restart path and reports the pinned version as running, even though the still-running old process serves requests. The version checks read the on-disk binary (ready-for-agent --version spawns a fresh process from the new binary), never the serving process, and there is no pending-restart marker, so the failed deployment is silently forgotten.
- Raised by: Codex (P2), 2026-11-02T05:12:14Z, on PR fix(pm-stack): restart ready-for-agent only on change #4190 (fix(pm-stack): restart ready-for-agent only on change)
- Comment: fix(pm-stack): restart ready-for-agent only on change #4190 (comment) — "Preserve pending restarts across failed installation attempts" (
pm-stack/ready-for-agent/install.sh:107in the PR diff) - Essence: "Preserve a pending-restart marker until deployment completes, or otherwise verify that the running process corresponds to the installed package before taking the no-op path."
No-response evidence
- The thread has the single Codex comment and no replies; GraphQL
reviewThreadsfor PR fix(pm-stack): restart ready-for-agent only on change #4190 (checked this run): the thread is unresolved. - PR fix(pm-stack): restart ready-for-agent only on change #4190 had a single commit (
95addedd4, 2026-11-02T05:09:06Z, before the comment) and merged 2026-11-02T15:36:34Z (merge commit58857615c) with no fix commit after the comment. - Held under the open-PR 24h grace rule by the pr-comment-review run of 2026-11-02 03:54 CST; grace expired 2026-11-03T05:12:14Z and the PR has since merged unaddressed, so it is filed now.
Still live on current main (verified 2026-11-03 via gh api raw read)
pm-stack/ready-for-agent/install.sh on main:
- Line 53–58:
package_changedis derived solely from the on-disk binary's--versionvsPINNED_VERSION. - Lines 64–77: the
clonestep runs after the npm install; a Git failure exits the script before any restart. - Lines 101–108: when neither package nor unit changed, the script prints "no package or unit changes detected; leaving ready-for-agent.service running" (
service_action=unchanged) — no check that the running process corresponds to the installed package, and no pending-restart state anywhere in the script. - Lines 135–150: the "unchanged" verification path marks the process verified unconditionally and again reads the version from the on-disk binary, then reports
ready-for-agent@<pinned> is already running (no restart).
Dedupe: gh issue list --state all searches (ready-for-agent install pending restart / install.sh restart / 4190) found no issue tracking this residual failure mode. Related but distinct: issue #2513 (closed — install.sh never restarted at all; PR #4190 was its fix, and this finding is a hole in that fix), issue #1150 / #1332 (aggregator install.sh, a different script).
Acceptance criteria
- A deployment that changes the installed package but fails before the restart completes is not forgotten: a later
install.shrun restarts the service (e.g. a pending-restart marker written when the package changes and cleared only after a verified restart), or the no-op path verifies the running process actually corresponds to the installed package before reporting success. - A regression case in the stubbed harness covers the sequence: npm succeeds, Git clone/fetch fails, retry succeeds without a service PID change must no longer be reported as the pinned version running.
- Or: a documented decision on this issue explaining why this failure sequence is accepted, stated explicitly.
Found by the pr-comment-review job from an unaddressed PR review comment.
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 3, 2026
Agent note — picked up (queue task 7066, openchamber-scheduled-lane, 2026-11-03)
Claimed as small_fix. Revalidated: issue OPEN, PR #4190 merged unaddressed, no other agent owns this. Plan: pending-restart marker in
pm-stack/ready-for-agent/install.sh(written on package change, cleared only after verified restart) + regression case intest-install.shfor the npm-ok / git-fail / retry sequence. Worktree + branch next.dezren39 commentedon Nov 3, 2026
agent-note:v1
Transition: triage complete (task 7049)
Worker: repo-worker-code (lane code-f, direct execution lane)
Triage verdict — task 7049, fresh check 2026-11-03
1e3763faf. Inpm-stack/ready-for-agent/install.sh:package_changedis derived solely from the on-disk binary's--versionvsPINNED_VERSION(~lines 48–58); theclonestep runs after the npm install and a git failure exits underset -ebefore any restart (~lines 64–77); on the unchanged path the verification loop marks an active, unchanged service's process verified unconditionally, reads the version from the on-disk binary, and reportsready-for-agent@<pinned> is already running (no restart)(~lines 101–150). A search of the script finds no pending-restart state anywhere. The filed sequence reproduces by inspection exactly as the Codex P2 on PR fix(pm-stack): restart ready-for-agent only on change #4190 (discussion r4439108345) described: npm upgrade succeeds → clone fails → old process keeps serving → retry reports the pinned version running.pm-stack/ready-for-agent/test-install.sh(isolated HOME, stubbed systemctl/npm/curl) exists and is the regression case's home.packet-task7049-fix4839.jsonin the goal's hidden_files.bash pm-stack/ready-for-agent/test-install.sh(all cases incl. the new regression) on the laptop worktree or in CI, plusbash -non install.sh.4 remaining items
dezren39 commentedon Nov 3, 2026
Agent note — parked (queue task 7066, openchamber-scheduled-lane, 2026-11-03)
Parked 20 minutes: PR #4844 is open and checks have not reported beyond CodeRabbit skip. Resume condition: read PR/check state fresh; merge only if green and diff/tests verified, otherwise continue diagnosis. Worktree/branch retained at
~/git/fleet/7066-4839-pending-restart,queue/7066-4839-pending-restart.fix(pm-stack): ready-for-agent install.sh preserves pending restart a…
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
🤖 Agent note · done (fix merged)
74064cbb); issue auto-closed viaCloses #4839.Verification (fresh, 2026-11-03)
pull_requestforpm-stack/**(pm-stack-tests.ymlis push-to-main + dispatch only), so the "CI pending" park reason could never resolve — nothing was ever pending. Reported checks: CodeRabbit neutral; Codex review "failed" = usage-limit error, no substantive findings.mergeStateStatus: CLEAN,mergeable: MERGEABLE.queue/7066-4839-pending-restart@b85c3ebvs base): pending-restart marker written after npm upgrade before the clone step can fail; forcesservice_changedon retry; cleared only in the verified restart/start success branch; no-op path untouched otherwise. Matches triage intent.bash -n install.shclean;test-install.sh6/6 PASS incl. newclone-fail-retry(marker written on failed run, retry restarts, no false no-op report, marker cleared).dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
Verified: PR #4844 MERGED (merge commit 74064cb, landed by task 7066); issue #4839 auto-closed 2026-11-03T10:47:06Z. Task 7398 completed with outcome
already_done.