Skip to content

fix: report stopped and missing containers in service health - #131

Merged
TMHSDigital merged 2 commits into
TMHSDigital:mainfrom
laozhej:fix/114-container-health
Nov 18, 2026
Merged

TMHSDigital merged 2 commits into
TMHSDigital:mainfrom
laozhej:fix/114-container-health

Conversation

@laozhej

@laozhej laozhej commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What changed

homelab_serviceHealth reads one docker ps -a JSON snapshot and uses it for both the container table and the summary. Non-running containers, unhealthy checks, and checks that are still starting are listed as needing attention. An empty selection returns a clear message instead of claiming all containers are healthy.

The service filter is shell-quoted, malformed output returns an error, and dry runs return their command description without a health verdict. Added the required changelog entry.

Why

Fixes #114. The previous command omitted stopped containers, and its table header made an empty result look nonempty. It also checked only unhealthy health checks, missing crashed or restarting containers.

The parsed fields and --all behavior follow the Docker container list reference.

Type

  • New MCP tool
  • New skill
  • New rule
  • Bug fix
  • Documentation
  • Other

Testing

  • cd mcp-server && npm run build && npm test passes: 332 tests passed, 10 live-Pi tests skipped on Node 22.23.0.
  • pytest tests/ -v --tb=short passes: 272 tests on Python 3.15.2.
  • Tested against a live Pi (not applicable to this mocked regression run).

All 13 initial regression cases fail before the change and pass after. Coverage includes exited, dead, restarting, created, paused, removing, unhealthy, starting, and empty selections, plus valid, malformed, and dry-run output. An additional test checks service-filter shell quoting. git diff --check passes.

Checklist

  • No secrets or credentials committed
  • CHANGELOG.md updated
  • README.md updated (not applicable; no tools, skills, or rules added)
  • CLAUDE.md updated (not applicable; no tools, skills, or rules added)

Prepared with OpenAI Codex assistance. The commit includes the required DCO sign-off.

Hosted CI currently requires maintainer approval for this fork contribution (MCP Server CI run); the build/test jobs have not run on GitHub yet. Results above are local.

Resolve conflicts with TMHSDigital#132 by keeping both changelog entries and both test imports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: TM Hospitality Strategies <[email protected]>
@TMHSDigital
TMHSDigital merged commit cdd33b5 into TMHSDigital:main Nov 18, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

serviceHealth reports 'All containers healthy' for exited or missing containers

2 participants