feat(doctor): add extension diagnostics and health reporting#360
feat(doctor): add extension diagnostics and health reporting#360bugman-007 wants to merge 4 commits intoLight-Heart-Labs:mainfrom
Conversation
5e5b444 to
a1549f0
Compare
Lightheartdevs
left a comment
There was a problem hiding this comment.
Review: REQUEST CHANGES — Two bugs produce incorrect output
Blocking: local used outside a function
The extension diagnostics block uses local container=..., local issues=(), etc. at top-level scope. local outside a function is undefined behavior in Bash — some shells silently treat it as global, others error. Under set -euo pipefail, this is a latent crash.
Fix: Wrap the diagnostics block in a function (e.g., collect_extension_diagnostics). This also fixes the >30 line threshold.
Blocking: printf '%s' missing newline separator
Issues array built with printf '%s' "${issues[@]}" concatenates elements with no separator: "container_not_runningmissing_dependency:searxng". Needs printf '%s\n' for the tr '\n' ',' pipe to work. Multi-issue extensions produce malformed JSON.
Non-blocking:
2>/dev/nullondocker inspect— should be logged per CLAUDE.md- JSON construction via sed pipeline is fragile — consider
jqor building in the Python block - Tests are static grep only, won't catch the JSON bug
for dep in $deps— unquoted variable expansion subject to globbing
🤖 Reviewed with Claude Code
…ove error handling
|
Fixed the bash scoping and JSON formatting bugs Extension diagnostics now work correctly: Critical fixes:
Code improvements:
The JSON output is now properly formatted and the script won't crash on systems with different bash configurations. Kindly review again. Thanks. |
|
Fixed unbound variable error The Split the declaration and assignment: local GPU_BACKEND
GPU_BACKEND="${GPU_BACKEND:-nvidia}"This allows the default value to work correctly even when the outer variable is unset. The integration test should now pass. |
d59b4e5 to
6cdfb72
Compare
6cdfb72 to
d0bde91
Compare
|
Fixed dependency issue with SERVICE_GPU_BACKENDS PR #360 was trying to use Fix: Made the GPU backend compatibility check conditional: if [[ -v SERVICE_GPU_BACKENDS ]]; then
# Check GPU backend compatibility
fiThe extension diagnostics now work correctly whether or not PR #357 has been merged. Once #357 merges, the GPU backend checks will automatically activate. |
Summary
Enhances
dream-doctor.shto analyze extension health, dependencies, and compatibility, providing actionable diagnostics for troubleshooting extension issues.Problem
Current doctor report focuses on system capabilities and preflight checks but doesn't analyze extension-specific issues:
Solution
docker inspectfor each extensionReport Schema Additions
{ "extensions": [ { "id": "comfyui", "container_state": "running", "health_status": "healthy", "issues": [] }, { "id": "perplexica", "container_state": "exited", "health_status": "unknown", "issues": ["container_not_running", "missing_dependency:searxng"] } ], "summary": { "extensions_total": 5, "extensions_healthy": 3, "extensions_issues": 2 } }Example Autofix Hints
Implementation Details
Testing
Impact
Related Work
Builds on PR #355 (container state validation) and PR #357 (GPU backend validation). Completes the extension operability diagnostic suite.