feat(health-check): add container state validation for better diagnostics#355
feat(health-check): add container state validation for better diagnostics#355bugman-007 wants to merge 3 commits intoLight-Heart-Labs:mainfrom
Conversation
Lightheartdevs
left a comment
There was a problem hiding this comment.
Review: REQUEST CHANGES — Feature is non-functional due to subshell bug
Blocking: Container state messages will never display
check_container_state() calls result_set inside backgrounded subshells (&). Subshell array modifications are invisible to the parent shell. result_get "${sid}_container" always returns empty, hitting the fallback every time. The container-state-aware messages will never actually display.
Fix: Write the container state to the temp result file alongside the ok/fail status, then read it back in the parent.
Blocking: Missing guard on empty container name
If SERVICE_CONTAINERS[$sid] is unset, docker inspect gets an empty argument. Add: [[ -z "$container" ]] && return 0
Non-blocking:
- Duplicate 15-line case blocks should be extracted to a helper function
2>/dev/nullon docker inspect should be|| warn "..."per CLAUDE.md- Tests grep for strings in source code, not actual behavior — won't catch the subshell bug
🤖 Reviewed with Claude Code
|
Fixed the subshell bug and container state issues The container state messages now work correctly: Main fix:
Additional improvements:
Users will now see specific, actionable error messages instead of generic "not responding" when containers have issues. Kindly review again. Thanks. |
|
Fixed test grep pattern The docker availability check exists in All tests now pass. |
Summary
Enhances
scripts/health-check.shto check Docker container state before testing HTTP endpoints, providing clearer diagnostic messages for extension failures.Problem
Currently, health-check reports generic "not responding" errors without distinguishing between:
This makes debugging extension startup issues difficult for users.
Solution
check_container_state()function that queries container status viadocker inspecttest_service()before HTTP health checkImplementation Details
Testing
bash -nandmake lintImpact
Related Work
Builds on recent health-check improvements: