Fix: Add macOS Docker socket detection fallback (Fixes #164) #192
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.
Summary
This PR fixes Issue #164 where Strix fails to detect Docker on macOS even when Docker Desktop is running.
docker.from_env()only checks Linux-style sockets and does not detect Docker Desktop’s macOS socket locations such as:As a result, Strix incorrectly reports "DOCKER NOT AVAILABLE" on macOS systems.
What this PR changes
✔ Tries
docker.from_env()first (respecting DOCKER_HOST).✔ If that fails, tries macOS-specific Docker Desktop socket paths.
✔ Falls back to Linux sockets on non-macOS platforms.
✔ Improves error messaging showing exactly which sockets were checked.
✔ Preserves existing Linux behavior — zero regressions.
Why this is needed
Many macOS users run Docker Desktop, which exposes a different socket path than Linux.
The Python docker SDK does not automatically detect these locations, causing Strix startup failure.
This PR makes Strix behave correctly on:
How to test
On macOS (Docker Desktop running):
python3 - << 'EOF'
from strix.interface.utils import check_docker_connection
client = check_docker_connection()
print(client.ping())
EOF
Expected: No error, prints
None.On Linux:
Existing behavior should remain identical.
Related Issue
Fixes #164
Additional Notes
This change is minimal, contained, safe for cross-platform usage, and aligns with behavior maintainers requested in the issue discussion.