fix(miner): gate doctor's claude/codex CLI-presence checks by MINER_CODING_AGENT_PROVIDER (#5165) - #5271
Conversation
…ODING_AGENT_PROVIDER (JSONbored#5165) checkClaudeCliPresent/checkCodexCliPresent in laptop-init.js ran unconditionally, contradicting their own comment that a CLI is "only needed once a driver provider is configured" -- a rationale that was never actually implemented, so doctor could not distinguish "no provider configured, CLI absence is fine" from "provider configured but the CLI is missing, every attempt will fail." Both checks now read MINER_CODING_AGENT_PROVIDER and only flip ok to false when the relevant provider (claude-cli / codex-cli) is configured and its CLI binary is absent. An unconfigured provider, or a different provider configured, remains ok: true with the existing advisory message. The already-present authenticated/unauthenticated detail is unchanged either way.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5271 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 474 474
Lines 40114 40114
Branches 14627 14627
=======================================
Hits 37856 37856
Misses 1583 1583
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 12:56:33 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
checkClaudeCliPresent/checkCodexCliPresentinpackages/gittensory-miner/lib/laptop-init.jsran unconditionally, contradicting the code's own comment that a CLI is "only needed once a driver provider is configured" -- a rationale that was never actually implemented. As a result,doctorcould not distinguish "no provider configured, CLI absence is fine" from "provider configured but the CLI is missing/broken, every attempt will fail."MINER_CODING_AGENT_PROVIDER(viaoptions.env/process.env, matching the existing pattern) and only flipoktofalsewhen the relevant provider (claude-cli/codex-clirespectively) is configured and its CLI binary is absent.ok: truewith the existing advisory message unchanged.runDoctorChecks()'s overall control flow is touched.Test plan
npx vitest run test/unit/miner-cli-doctor-checks.test.ts-- 16/16 passing, including the newdescribe("provider-gated CLI-presence failures (#5165)", ...)block: the regression case (CLI missing + unconfigured staysok: true), CLI missing + a different provider configured stays advisory, CLI missing + the matching provider configured fails with the actionable message, CLI present + matching provider configured is unaffected, for bothclaude-cliandcodex-cli, plus an invariant that an unconfigured/differently-configured provider's check is neverok: falseregardless of CLI presence.npm run typecheck-- clean.npm run build:miner-- clean (node --checkonlaptop-init.jsand every other shipped miner lib file passes).npm run docs:drift-check-- clean.packages/gittensory-miner/**currently sits outside vitest'scoverage.includeglob (per the issue's own Codecov-visibility note), socodecov/patchcannot measure this change yet -- treating the 100%-including-invariants-and-regression tests above as the enforced house standard regardless, per the issue's instructions.npm run test:coveragelocally (shared/resource-contended machine); relying on the targeted test run above plusnpm run typecheck/build:miner.Fixes #5165.