Repository navigation
feat(cli): add deskaoy doctor platform diagnostic (Batch 12) - #22
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acf861f6b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if getattr(args, "json", False): | ||
| print(json_mod.dumps(result, indent=2)) |
There was a problem hiding this comment.
Return failure status in JSON mode
When deskaoy doctor --json is used and run_doctor() reports a hard failure, this branch prints the JSON and then falls off the end of _cmd_doctor, so main() returns None and console entry points exit successfully. This contradicts the documented exit-code contract and makes JSON mode unsafe for CI/automation that relies on nonzero status for broken package/safety checks.
Useful? React with 👍 / 👎.
| def _check_platform() -> list[CheckResult]: | ||
| results: list[CheckResult] = [] | ||
| results.append(CheckResult("OS", Status.PASS, f"{platform.system()} {platform.release()}")) | ||
| results.append(CheckResult("Python", Status.PASS, sys.version.split()[0])) |
There was a problem hiding this comment.
Validate the supported Python version
This now reports the running Python interpreter as PASS unconditionally. On an unsupported interpreter such as Python 3.10, deskaoy doctor can still conclude the environment is usable if the other hard checks pass, even though pyproject.toml requires Python >=3.11 and the previous doctor explicitly validated that requirement. Please compare sys.version_info against the package minimum and mark unsupported versions as a hard failure or warning.
Useful? React with 👍 / 👎.
acf861f to
815650c
Compare
Batch 12 — deskaoy doctor platform diagnostic (Issue #19). New diagnostics module (src/deskaoy/diagnostics/) with side-effect-free platform checks: - Package: version, import path, storage path - Platform: OS, Python, architecture - Adapter readiness: - Windows: comtypes/pywin32/pyautogui/mss availability - Linux: session type, DISPLAY, xdotool backend status - macOS: experimental gate, pyobjc, Accessibility/Screen Recording permissions - Optional deps: LLM, grounding, Pillow, OpenTelemetry - Safety: key blocklist, sensitive apps - Known limitations: macOS gate, Wayland, lint debt Replaces the old stale doctor command that referenced patchright/browser. Output modes: human-readable (default), --json, --verbose. Status model: PASS/WARN/FAIL/SKIP. Exit 0 for usable, 1 for hard failures. Cross-platform: missing optional deps are WARN/SKIP, not FAIL. Tests: 13 tests covering JSON output, exit codes, Linux backend detection, status semantics, no-input-injection invariant. Signed-off-by: Alajmah <55954113+Alajmah@users.noreply.github.com>
815650c to
136ae15
Compare
Batch 12 — deskaoy doctor platform diagnostic
Issue: #19
Adds a side-effect-free platform diagnostic command that exposes the adapter truthfulness work from Batches 5, 10, and 11 as user-facing diagnostics.
What it does
deskaoy doctorchecks:Output modes
--json: machine-readable JSON with stable top-level keys (status, checks, summary)--verbose: show full detail for all checksStatus model
Exit codes: 0 for usable/warnings, 1 for hard failures.
Cross-platform: missing optional deps on the wrong platform are WARN/SKIP, never FAIL.
What was replaced
The old stale
_cmd_doctorthat referenced patchright/browser/mcp and said macOS/Linux are not implemented. Now uses real backend detection.Verification