Repository navigation
feat(cli): add qq doctor readiness report (OB4) - #138
Merged
Merged
Conversation
lg2m
force-pushed
the
feat/eng-878-doctor
branch
from
September 23, 2026 04:05
1395e25 to
89f1195
Compare
One screen that says whether QQ is ready to run here: configuration, project trust, model, credential for the model's provider, credential store, server discovery, workspace, and data directory. Each line is ok/warn/fail/skip with the remedy indented beneath anything not ok. Exit 0 when nothing fails, 1 otherwise; `--json` for scripts. `src/doctor.rs` keeps `run_checks` free of I/O to stdout so the text and JSON renderers and the tests share one report. The credential check mirrors `RuntimeFactory::provider_authenticated`; the AWS chain helpers in `runtime.rs` are now `pub(crate)` and shared rather than duplicated. No provider is contacted; the keyring is exercised only through the model's stored credential, never probed blindly. Slice OB4 of docs/plans/onboarding-ux.md. ENG-878.
CLI reference section for `qq doctor [--json]` with the check table; troubleshooting opens with a sample report; quickstart and the guide index mention it. Ledger: OB4 to In review. Slice OB4. ENG-878.
OB3 (#137) made GOOGLE_API_KEY an alias of GEMINI_API_KEY; the doctor's credential check now reads HttpCredential::ApiKey.alternate_variables, accepts any of them as authenticating, and writes the remedy as `set GEMINI_API_KEY (or GOOGLE_API_KEY)`. Closes the OB3→OB4 follow-up named in #138 (OB4, ENG-878).
lg2m
force-pushed
the
feat/eng-878-doctor
branch
from
September 23, 2026 04:20
89f1195 to
67f0685
Compare
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.
OB4:
qq doctor— one screen that says whether QQ is ready hereSpec: docs/plans/onboarding-ux.md#ob4 Linear: ENG-878 (parent ENG-875)
What changes for users
Checks in order:
configuration,project trust,model,credential,credential store,server,workspace,data; statusesok|warn|fail|skipped. Exit 0 unless a check fails (warnings never affect exit).--jsonemits{version, checks:[{name,status,summary,remedy,details}], failed}. Colour only on a TTY. No network, no state mutation; the keyring is never probed blindly (a read-only command must not trigger unlock prompts) — keyring unavailability surfaces on the credential check when the model's credential is keyring-backed.Untrusted project:
configurationiswarn: awaiting trust,project trustisfaillisting each pending file with the sections it declares,model/credentialareskippedwith the reason.Design
src/doctor.rs:run_checks(&ConfigLoader, &CredentialStore, &LoadRequest, &ServerPaths, &Path) -> DoctorReport(no printing) +render_text/render_json.doctor_commandruns it inspawn_blocking.servercheck drivesdiscover_aton a private current-thread runtime inside the blocking task.runtime::aws_default_chain_source()extracted so the doctor andprovider_authenticatedagree on the AWS chain.How verified
fmt, clippy,
cargo test --workspace. 12 new tests indoctor::tests(no config → model fail names the global path and credential skipped; stored credential → ok; missing → remedy names login + env var; untrusted project fails untilgrant_pending_trust; keyring unavailable; JSON round-trip with known statuses; text renderer indents remedies and summarises; workspace warn / data store size; declared Custom provider NoAuth; unregisteredStored→qq auth set; unparseable config skips dependents) +cli::tests::parses_doctor_with_optional_json. Manual: temp dir with no config (exit 1), with model and no key (matches the sample above), with the key (all checks passed, exit 0), repo root (trust pending on two files, server running, 185 MiB store),--jsonparses.Docs
docs/guide/troubleshooting.md ("first stop":
qq doctor), cli.md, quickstart.md, guide README; ledger.Compatibility
No protocol/schema change. New subcommand only.
Follow-ups / decisions
warnever affect exit status? Currently never.GOOGLE_API_KEYtoo (one-line follow-up).