feat(provision): auto-stage + self-update fduty CLI in side mode (Phase 2)#73
Merged
Conversation
Move fduty provisioning AND the CLI's own `fduty update` onto a detached background goroutine, fully OFF the runner's startup path. The runner is usable immediately; fduty resolves a beat later and is upgraded in place when a newer release exists — so a runner self-update + re-exec carries the CLI forward "alongside" it on the next boot. Every step stays best-effort and non-fatal: a missing CLI only logs an actionable manual-install hint, never blocks startup. - StartFdutyProvisioningAsync(): `go ensureFdutyCLI()` — never on the hot path - fdutySelfUpdate(): runs `fduty update` pinned to the bundled-tools dir and to the runner's own mirror (FLASHDUTY_UPDATE_BASE_URL derived from the configured install URL), so private/regional deploys upgrade from where they were provisioned; env scrubbed via BashToolEnv with install vars re-added - each leg (stage / verify / update) self-bounds its own timeout, so no overall wrapper is needed
This was referenced Jun 15, 2026
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.
What
Phase 2 of the fduty-provisioning hardening (follow-up to #71 / v0.0.23).
Moves fduty provisioning and the CLI's own
fduty updateonto a detached background goroutine, fully OFF the runner's startup path ("side mode"):StartFdutyProvisioningAsync()→go ensureFdutyCLI(). The runner is usable immediately; fduty resolves a beat later.fdutySelfUpdate()runsfduty updatepinned to the bundled-tools dir and to the runner's own mirror (FLASHDUTY_UPDATE_BASE_URLderived from the configured install URL), so private/regional deploys upgrade from where they were provisioned. A runner self-update + re-exec carries the CLI forward "alongside" it on the next boot.Testing
go build/go vet/go test ./cmd/.../gofumpt -l cmd/— all green.serve:envd serve starting(boots first), thenfduty CLI self-check passed+fduty self-update checked.envd serve starting+ an Info hint; runner starts regardless (non-fatal).Notes
feat/ai-sre(per repo flow).