fix(cli): make Unix restart recreate containers - #3164
Open
tang-vu wants to merge 1 commit into
Open
Conversation
This was referenced Aug 25, 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.
Why this matters
On Linux and macOS,
ods restart [service]currently delegates todocker compose up -dwithout--force-recreate. Compose leaves an already-running, unchanged container untouched, so the command can report ?restarted? while the process was never restarted. It also leaves environment values captured at container creation stale after an operator edits.envor a lifecycle step updates model routing.This makes both Unix CLIs use
up -d --force-recreate --no-build --pull neverfor single-service and all-service restarts. The service selection and native Apple Silicon llama lifecycle stay unchanged.--no-build --pull nevermakes restart consume only already-installed release images; Linux contributors can still opt into the existing--rebuild-imagespath, which builds before recreation.Behavioral invariant: a successful
restartreplaces every selected Compose container with its current configuration and local pinned image, without implicitly building or pulling artifacts.Overlap check
Searched open and closed PRs for
macOS restart force recreate,ods-macos restart environment,restart force-recreate, andrestart env-backed containers, plus open issues for restart no-op/environment behavior. No open or closed PR covers the Linux/macOS paths.The historical Windows change carried in closed #1724 established this same invariant for
ods.ps1and added the Windows contract; it did not modifyods/ods-cliorods/installers/macos/ods-macos.sh. This PR completes platform parity without touching the already-hardened Windows implementation.Regression test
tests/test-unix-restart-recreate-env.shinvokes the real Linux and macOS CLI boundaries twice each: once forrestart dashboardand once forrestartwith no service. A Docker fixture records the public Compose command and requires force recreation, no build, no pull, the persisted compose flags, and the correct selected service set.The test reproduces the previous command before the fix as
up -d [dashboard], which does not guarantee any restart.Validation
bash tests/test-unix-restart-recreate-env.sh? passed for Linux and macOS, single/all service casesbash tests/test-macos-bootstrap-resume.sh? passedbash tests/test-ods-cli-pipefail-tolerance.sh? 16 passed, 0 failed, 0 skippedmake lint? passedgit diff --check? passedNo live containers were recreated during validation; the boundary fixture verifies Compose orchestration. Rollback restores the old no-op-prone
up -dbehavior and does not require a data migration.Batch compatibility
This PR was validated on synthetic integration head
9af795fc, which applies #3158 through #3167 in numeric order onupstream/main(6ff9b4fc). Combinedmake lint,make test,make smoke,make simulate, and all 418 BATS cases passed (one root-specific permission assertion skipped by design).Recommended merge order: #3158 ? #3159 ? #3160 ? #3161 ? #3162 ? #3163 ? #3164 ? #3165 ? #3166 ? #3167. The only manual reconciliation observed was the adjacent Makefile test insertion shared by #3164 and #3166; retain both
test-unix-restart-recreate-env.shandtest-chat-error-exit-parity.shlines. Production code merged automatically across the full batch.