fix(dream-cli): compose summary wrapper for restart/start/stop/update#1001
Closed
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Closed
fix(dream-cli): compose summary wrapper for restart/start/stop/update#1001yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Conversation
…date The four commands that shell out to `docker compose` (restart, start, stop, update) previously let the raw per-container-state-transition output pass through with no summary and no visible error banner. A failure like "dream-llama-ready is unhealthy" was one line buried in 40+ lines of state transitions. Introduce `_compose_run_with_summary` that runs compose with `--progress quiet`, captures stdout+stderr to a mktemp log, and either prints a "<verb> — done" success line or a red "<verb> failed:" banner that surfaces up to 20 lines matching error|unhealthy|failed|dependency and points the operator at the preserved full log. Wrap all four callers. For `cmd_update`, keep the existing `if ! …; error` guard on both the pull and up-recreate calls so the actionable rollback hint is preserved on top of the surfaced error context. Use `cmd || rc=\$?` to capture the compose exit code (safe under `set -e` and not reliant on `\$?` after `if…fi`, which is spec'd to 0 on the not-taken branch). The grep | sed | head pipeline is safe under `set -e` without pipefail — this branch does not have pipefail, so no SIGPIPE / no-match exit concerns. Platform impact: - macOS / Linux / Windows (WSL2): identical — no platform branching. `docker compose --progress quiet`, `grep -iE`, `sed`, `head`, `mktemp` are all portable.
This was referenced Apr 23, 2026
Contributor
Author
|
Superseded by #1016, which is a superset of this PR. #1016 contains all of this PR's
Merging this PR alone would ship a known resource leak. Closing in favor of #1016. |
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
Wrap
docker composecalls fromdream restart,start,stop, andupdatewith a summary function that surfaces"<verb> — done"on success or a red"<verb> failed:"banner with up-to-20 error-keyword lines + full log path on failure. Also teachessr_resolveto accept container names (e.g.dream-token-spyas copied fromdocker ps) by stripping thedream-prefix when the literal input doesn't match any alias.Why
Previously, a compose failure like "dream-llama-ready is unhealthy" was one line buried in 40+ lines of state transitions. Users couldn't distinguish "all up" from "one unhealthy" without re-running and squinting. Separately, users copying container names from
docker psoutput would get "no such service" errors becausesr_resolveonly matched registered aliases.How
Single commit
431e83cf:_compose_run_with_summary <verb> <docker-compose-args...>: runs compose with--progress quiet, captures stdout+stderr tomktemp, prints either a success line or a red failure banner with up to 20grep -iE 'error|unhealthy|failed|dependency'matches plus the preserved log path.cmd_restart,cmd_start,cmd_stop,cmd_update) wrap through the helper. Forcmd_update, the existingif ! …; errorguard on both pull and up-recreate calls is preserved so the rollback hint remains on top of the surfaced error context.|| warn "(no error keywords matched in compose log)"—|| warnis CLAUDE.md's project-blessed form for "tolerate this specific non-match and log why the summary is empty." Upstreammaintoday runs underset -eonly (nopipefail), so the guard is defensive for the forthcoming pipefail adoption; it costs nothing today and keeps the function correct under future pipefail.sr_resolvenow strips a leadingdream-prefix if the literal input has no alias and the stripped form does — recovers the service ID for container names. All registry-loader-generated container names followdream-<sid>by convention.Testing
dream restart dream-token-spy(container name): resolves totoken-spy, restart succeeds (previously "no such service").|| trueas a CLAUDE.md silent-swallow violation; replaced with|| warn+ corrected block comment. Re-verified.Platform Impact
docker compose --progress quiet,grep -iE,sed,head,mktempare all portable across the three.