feat(cli): enrich ao doctor (#90)#99
Conversation
Greptile SummaryThis PR significantly enriches
Confidence Score: 5/5Safe to merge; the new checks are read-only diagnostics with no side effects beyond a temporary write-probe file that is immediately deleted. All new code paths are diagnostic-only. Token handling is correct (trimmed, sent over TLS, not logged), response bodies are properly drained via defer, version comparisons use strconv.Atoi with error propagation, and test isolation is thorough. The only open question is whether Aider/OpenCode harnesses were intentionally deferred. backend/internal/cli/doctor.go — specifically the doctorHarnesses slice, which lists only two of the four harnesses named in the PR description. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ao doctor] --> B[runDoctor]
B --> C[Core Section]
C --> C1[config check]
C --> C2[data-dir check]
C2 -->|pass| C3[data-dir-write probe]
C --> C4[sqlite / checkStore]
C --> C5[daemon / inspectDaemon]
B --> D[Tools Section]
D --> D1[checkGit - git --version - compare >= 2.25.0]
D --> D2[checkZellij - zellij --version]
B --> E[Agent harnesses Section]
E --> E1[checkHarness: claude-code]
E --> E2[checkHarness: codex]
B --> F[GitHub Section]
F --> F1{githubToken}
F1 -->|AO_GITHUB_TOKEN or GITHUB_TOKEN| F2[use env token]
F1 -->|gh binary found| F3[gh auth token]
F1 -->|none| F4[WARN: no token]
F2 --> F5[GET /user Bearer token]
F3 --> F5
F5 -->|200| F6[PASS: login + scopes]
F5 -->|401/403| F7[FAIL: rejected]
F5 -->|other| F8[WARN: unexpected status]
B --> G[writeDoctorText or JSON encode]
Reviews (2): Last reviewed commit: "fix(cli): address doctor review feedback" | Re-trigger Greptile |
Summary
Closes #90.
ao doctorsections while keeping existing PASS/WARN/FAIL check lines.AO_GITHUB_TOKEN/GITHUB_TOKENorgh auth token, including/useridentity and OAuth scopes when available.--jsonoutput with section metadata and cover the new checks in CLI tests.Validation
cd backend && go build ./...cd backend && GOLANGCI_LINT_CACHE=$(mktemp -d) go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 run --path-mode=abs ./internal/clicd backend && PATH=<go-only temp bin>:/usr/bin:/bin go test -race ./...Note: per corrected brief,
npx @redwoodjs/agent-ci runwas not run.