Skip to content

fix: update install.sh doctor readiness parsing to use current blockers schema#9

Merged
avifenesh merged 3 commits into
agent-sh:mainfrom
vi70x3:fix-install-doctor-parsing
May 25, 2026
Merged

fix: update install.sh doctor readiness parsing to use current blockers schema#9
avifenesh merged 3 commits into
agent-sh:mainfrom
vi70x3:fix-install-doctor-parsing

Conversation

@vi70x3
Copy link
Copy Markdown
Contributor

@vi70x3 vi70x3 commented May 25, 2026

Problem

The run_doctor() function in install.sh parses the computer-use-linux doctor JSON output using an outdated schema:

  • Queries .readiness.ready (boolean) — field no longer exists, returns null
  • Queries .readiness.checks[] — field no longer exists

This causes install.sh to always report "doctor reports NOT ready" even on a fully provisioned system with zero blockers.

Root Cause

The doctor output's readiness object 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.sh was not updated to match.

Fix

Updated the jq queries in run_doctor():

  • .readiness.ready.readiness.blockers | length == 0
  • .readiness.checks[] failure extraction → .readiness.blockers[]
  • Display output now shows blockers list instead of checks list

Testing

Verified on CachyOS/Hyprland — install.sh now correctly reports all-green with ready: true and exit code 0.

Fixes #8

…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
@vi70x3 vi70x3 requested a review from avifenesh as a code owner May 25, 2026 04:16
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread install.sh Outdated
vi70x3 and others added 2 commits May 25, 2026 07:27
… 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.
@avifenesh
Copy link
Copy Markdown
Collaborator

@vi70x3 Thanks a lot, added a small fix that was needed and merging.

@avifenesh avifenesh merged commit 4f33282 into agent-sh:main May 25, 2026
15 checks passed
@vi70x3 vi70x3 deleted the fix-install-doctor-parsing branch May 26, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: install.sh doctor readiness parsing uses outdated JSON schema

2 participants