Repository navigation
Conversation
Compose resolves `${FTW_IMAGE_TAG:-latest}` afresh on every recreate. The
restart path sent no tag, so the recreate took whatever .env pinned or the
registry's :latest named. On 2026-09-05 22:09 a beta box on v2.14.0-beta.1
answered one press of Restart by pulling v2.0.0-beta.2: .env still held the
tag of an update from 17 August, because the pin is only written by the
updater's self-replacement step and the updater that ran the later updates
predated it. The old image knew nothing of the loadpoint, so the car did not
charge and the operator removed the charger to charge by hand.
The updater now reads the running container's tag and pins it for the
recreate. Core names its own release when it asks for a restart, which keeps
the release on an older updater as well. A build without a release tag still
lets compose resolve the image, which is the dev path.
Refs #989.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41dc8c57ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if isImmutableReleaseTag(c.cfg.CurrentVersion) { | ||
| target = c.cfg.CurrentVersion |
There was a problem hiding this comment.
Keep the test-only reported version out of restart targets
When FTW_SELFUPDATE_CURRENT_VERSION is set, cfg.CurrentVersion is deliberately a fabricated checker value used by dev/QA to simulate update availability, rather than the version actually running (see go/cmd/ftw/main.go lines 2392-2405). Using it as the restart target makes the updater pull and recreate Core on that simulated version, so pressing Restart can unexpectedly switch or downgrade a QA installation instead of preserving its running image. The restart target needs to come from the real build version or be left empty for sidecar inspection.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 41dc8c5. Configure here.
| if isImmutableReleaseTag(c.cfg.CurrentVersion) { | ||
| target = c.cfg.CurrentVersion | ||
| } | ||
| return c.Trigger(ctx, "restart", target) |
There was a problem hiding this comment.
Restart pin uses version identity
Medium Severity
TriggerRestart pins CurrentVersion whenever it looks like a release tag, so the sidecar skips reading the running image. That value is the product identity (baked Version, or FTW_SELFUPDATE_CURRENT_VERSION), which can differ from the container tag when FTW_IMAGE_TAG is empty or not adopted. A beta restart can then recreate on the baked stable release.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 41dc8c5. Configure here.




What happened
On 2026-09-05 at 22:09 local, a beta box on v2.14.0-beta.1 answered one press of Restart by pulling
ghcr.io/srcfl/ftw:v2.0.0-beta.2and recreating Core on it. The old image knew nothing of the loadpoint the operator had added since, so the car did not charge and the operator removed the charger to charge by hand.Chain of events, from the box:
POST /api/configat 22:09:26 (the operator removed the loadpoint in Settings), then the "Restart required" dialog and Restart now at 22:09:29.Trigger("restart", "")— no target.compose pullandcompose up -d --force-recreatewith noFTW_IMAGE_TAGin the environment, so compose read.env..envsaidFTW_IMAGE_TAG=v2.0.0-beta.2, written on 17 August. Every update since ran with the tag in the process environment only; the.envpin is written by the updater's self-replacement step, and the updater that ran those updates predated it.Without a
.envpin the result is the registry's:latest, which today is v2.3.2. Either way a restart on a beta box is a downgrade. Issue #989 saw the same mechanism after a rollback.The fix
restartwith no target reads the running container's image reference and pins its tag for the pull and the recreate. A running image on a moving tag (a dev build on:latest) keeps today's behaviour. Arestartthat names a target must name an immutable tag, asupdatealready must.TriggerRestartnames the running release (Version, when it is a stable or beta tag). An updater from before this change accepts a target on restart and pins it, so a new Core keeps its release on an old sidecar too. Adevbuild sends no target.Verification
go test ./cmd/ftw-updater/ ./internal/selfupdate/— new tests: restart pins the running release in every compose call and instate.json; a named target pins that; a moving target is refused with 400; a running:latestleaves the env unset.TriggerRestartis tested over a real Unix socket for beta, stable,devand legacy edge versions.go build ./...,go veton the touched packages,go test ./internal/api/ -run 'Restart|Version|SelfUpdate|Update'.Not in this PR
.envpin on every successful update (not only in the self-replacement step) and after a rollback, so a plaindocker compose up -don the host also keeps the release. That is the other half of Updater rollback does not survive a Restart: the failed target version comes back #989..envre-pinned to v2.14.0-beta.1 and Core recreated by hand; this fix does not touch.env.Refs #989.
🤖 Generated with Claude Code
Note
Medium Risk
Changes production restart and self-update compose paths that choose the Core image tag; mistakes could still recreate on the wrong release or block valid restarts, but behavior is heavily tested and narrows a known downgrade/data-loss scenario.
Overview
Restart no longer swaps FTW to a different image when compose re-resolves
${FTW_IMAGE_TAG:-latest}from stale.envor registrylatest(issue #989).The updater sidecar now, on
restartwith no target, inspects the running service image viarunningReleaseTagand setsFTW_IMAGE_TAGfor pull/recreate; optional caller-supplied targets must pass the same immutable-tag rules asupdate. Dev builds on:lateststill leave env unset.Core routes operator and in-process restarts through new
TriggerRestart, which sendsCurrentVersionwhen it is a stable or beta release tag so older sidecars that only honor an explicit target stay pinned too.Tests cover pin-from-inspect, pin-from-target, rejection of moving tags, and dev/moving-tag behavior on both updater and selfupdate paths.
Reviewed by Cursor Bugbot for commit 41dc8c5. Bugbot is set up for automated code reviews on this repo. Configure here.