Repository navigation
fix(selfupdate): let older agents accept the next release - #187
Merged
Merged
Conversation
Updaters in v0.2.0 to v0.2.3 passed the preflight only when the new binary was still running after 15s, but the new binary exits as soon as it prints "preflight ok", so every update from those versions was refused. The new binary now stays up for 20s after printing the marker, and the preflight passes as soon as it sees the marker on stdout. A binary that exits or keeps running without the marker still fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
errcheck rejects a bare receive and staticcheck rejects assigning it to _. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Impact
Agents on v0.2.0 to v0.2.3 can't update themselves: the Update button downloads the new release, then refuses it at preflight. Those agents stay on their version until someone reinstalls them by hand. With this change, the next release installs on them through the Update button.
RCA
Pressing Update on an agent did nothing; the agent stayed on its old version.
The old agent only accepted a new version if it was still running 15 seconds after a test start, but the new version stops right after saying "ok".
Every self-update from v0.2.0 to v0.2.3 is affected (the check in the old binary does the refusing).
Change
The new binary satisfies the old check, and the check is fixed for later releases.
preflight ok, then waits 20s before exiting, without touching the database or NATS. That outlasts the old 15s window.preflight okon stdout. It fails if the binary exits or runs 30s without printing it.Evidence
Real v0.2.2 agent on darwin/arm64 against a dev server, with
PDCP_UPDATE_URLpointing at builds of this branch:Claude-Local-Session: claude --resume 99f2d9da-2a0a-4594-a18f-45d2f9fb5f21