fix: update install.sh doctor readiness parsing to use current blockers schema#9
Merged
Merged
Conversation
…rs schema The run_doctor() function was querying .readiness.ready and .readiness.checks[] which no longer exist in the doctor JSON output. Updated to use .readiness.blockers (empty array = ready) which is the current schema. Fixes agent-sh#8
There was a problem hiding this comment.
Code Review
This pull request refactors the run_doctor function in install.sh to determine system readiness based on the length of the .readiness.blockers array instead of a boolean .readiness.ready field. The review feedback highlights several opportunities to improve the robustness of the jq parsing, specifically by handling cases where the blockers field might be missing or not an array to avoid false positives or script execution errors.
… field Address code review feedback: - Use `if type == "array" then length else -1` to avoid false-ready when blockers is missing/null - Use `type == "array" and length == 0` for the display output - Restore `?` optional operator on `.readiness.blockers[]?` to prevent jq errors on missing field - Update raw fallback grep to match `"blockers": []` instead of the removed `"ready": true` - Add explicit -1 branch to report unexpected JSON structure
PR dropped the mode from 100755 to 100644, which breaks the documented './install.sh' entrypoint (README Option A) with a permission-denied error. Restore +x; content unchanged.
Collaborator
|
@vi70x3 Thanks a lot, added a small fix that was needed and merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
run_doctor()function ininstall.shparses thecomputer-use-linux doctorJSON output using an outdated schema:.readiness.ready(boolean) — field no longer exists, returnsnull.readiness.checks[]— field no longer existsThis causes
install.shto always report "doctor reports NOT ready" even on a fully provisioned system with zero blockers.Root Cause
The doctor output's
readinessobject was restructured to use:.readiness.blockers(array of strings) — empty array = ready.readiness.can_build_accessibility_tree,.readiness.can_query_windows, etc. (booleans).readiness.recommended_next_step(string)But
install.shwas not updated to match.Fix
Updated the jq queries in
run_doctor():.readiness.ready→.readiness.blockers | length == 0.readiness.checks[]failure extraction →.readiness.blockers[]Testing
Verified on CachyOS/Hyprland —
install.shnow correctly reports all-green withready: trueand exit code 0.Fixes #8