fix: honor standalone doctor config and validate provider names - #213
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 7:39 PM ET / 23:39 UTC. ClawSweeper reviewWhat this changesDoctor now honors configuration before project initialization, and provider lookup rejects inherited object-property names with the existing unsupported-provider error. Merge readiness✅ Ready for maintainer review Keep open: both defects remain on current main, and the focused patch addresses them without an identified correctness blocker. Priority: P2 Review scores
Verification
How this fits togetherClawpatch’s doctor command combines project configuration, environment variables, and command flags to select a local coding provider. It reports provider availability and initialization state without starting a repair. flowchart TD
A[Config and environment] --> C[Resolve provider settings]
B[Command flags] --> C
C --> D[Read optional project state]
D --> E{Supported provider name?}
E -->|Yes| F[Check provider availability]
E -->|No| G[Usage error]
F --> H[Diagnostic report]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep doctor on the shared configuration path while treating project metadata as optional and accepting only registered provider names. Do we have a high-confidence way to reproduce the issue? Yes: current-main source shows standalone config being discarded after missing-state detection and inherited registry keys being accepted. The supplied CLI observations corroborate both paths; no reproduction was executed in this review. Is this the best way to solve the issue? Yes: reusing the existing loader and flag merger removes the divergent path, while the own-property check narrowly rejects invalid names without changing supported providers or persisted settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fa57be4726f2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Before
init,doctor --config ...could silently check Codex instead of the provider selected in the config: configuration loading was tied to required project state, and the missing-state handler discarded the loaded settings. Separately, inherited object names such astoStringwere accepted by the provider registry and failed later withprovider.check is not a function.User Impact
Doctor honors standalone config before initialization, preserves normal flag/environment precedence, and reports missing state without creating it. Unsupported provider names fail consistently with the existing usage error.
Why This Change Was Made
Load configuration independently from optional project metadata, reuse the normal provider-flag merge, and restrict registry lookup to its own entries. No harness permission or authentication policy changes.
Evidence
Six new cases fail on the old implementation; precedence preservation also has regression coverage.
Live before: an explicit config selecting
mockreportscodexand loses the configured model;--provider toStringexits 1 with a method error.Live after: the same explicit config reports provider
mockand itsfixture-model;--provider toStringexits 2 withunsupported provider: toString.Full validation:
pnpm typecheck,pnpm lint,pnpm format:check,pnpm test(957 passed, 2 existing platform skips), andpnpm buildpass.Isolated Codex autoreview: scoped-clean at P0–P2 against the final formatted files.
Final installed-package smoke: 13 features mapped, including 3 CUDA;
pnpm website:smokealso passed.