feat(miner): surface the resolved coding-agent-driver provider and CLI presence in status --json (#5164)#5312
Conversation
…I presence in status --json (JSONbored#5164) status.js's collectStatus now returns a driver section: the resolved MINER_CODING_AGENT_PROVIDER (reusing resolveFirstConfiguredCodingAgentDriverName, the same resolution driver-factory.ts uses), the NAME of the relevant model env var (never its value, via CODING_AGENT_DRIVER_CONFIG_ENV), and whether the provider's CLI binary is on PATH. noop/agent-sdk have no separate CLI binary, so cliPresent is null (not applicable) for them, same as an unconfigured provider. Exports findExecutableOnPath from laptop-init.js so status.js reuses the same PATH-scan primitive the doctor CLI-presence checks already use, rather than duplicating it or parsing a DoctorCheck's detail string. The human-readable status output renders the same info in plain text.
|
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 #5312 +/- ##
===========================================
- Coverage 94.37% 80.16% -14.21%
===========================================
Files 474 474
Lines 40128 40128
Branches 14631 14631
===========================================
- Hits 37869 32170 -5699
- Misses 1583 5895 +4312
- Partials 676 2063 +1387
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 13:53:15 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
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
packages/gittensory-engine/src/miner/driver-factory.tsalready resolvesMINER_CODING_AGENT_PROVIDERalong with per-provider model/timeout env vars, butpackages/gittensory-miner/lib/status.jsnever surfaced any of that -- an operator runninggittensory-miner status --jsonhad no way to see which coding-agent provider is configured or whether its CLI is present without separately inspecting env vars or PATH.collectStatusnow returns adriversection:{ provider, modelEnvVar, cliPresent }.provider-- the resolved provider name, viaresolveFirstConfiguredCodingAgentDriverName(the exact same resolutiondriver-factory.tsitself uses), ornullwhen unconfigured.modelEnvVar-- the name of the relevant model env var for the resolved provider (e.g.MINER_CODING_AGENT_CLAUDE_MODEL), viaCODING_AGENT_DRIVER_CONFIG_ENV-- never its value.nullfor providers with no model key (noop,agent-sdk) or when unconfigured.cliPresent-- boolean forclaude-cli/codex-cli(whether the CLI binary is on PATH),null(not applicable) fornoop/agent-sdk/unconfigured, since there's no CLI binary to check for those.findExecutableOnPathfromlaptop-init.jssostatus.jsreuses the exact same PATH-scan primitive the doctor CLI-presence checks (checkClaudeCliPresent/checkCodexCliPresent) already use, rather than duplicating the scan or parsing aDoctorCheck's detail string.statusoutput renders the same info in plain text (driver: codex-cli (CLI present: yes, model env: MINER_CODING_AGENT_CODEX_MODEL), ordriver: none configured).Test plan
npx vitest run test/unit/miner-status.test.ts-- 9 new tests covering: unconfigured (provider: null),noopandagent-sdk(no model env var,cliPresent: null),claude-cli/codex-cliwith the CLI present (real temp executable onPATH) and absent, the human-readable text rendering for both configured and unconfigured cases, and an invariant sweeping all 5 provider permutations asserting no env-var value or secret-shaped string ever appears instatus --jsonoutput. One pre-existing, unrelated test in this file (resolves the state dir...) fails locally on Windows due to apath.joinseparator mismatch (\vs/) -- confirmed viagit stashthat this failure exists identically without this PR's changes; it passes on Linux CI.npm run typecheck-- clean.npm run build:miner-- clean (node --checkon every shipped miner lib file, includinglaptop-init.jsandstatus.js, passes).npm run docs:drift-check/npm run manifest:drift-check-- clean.npm run test:miner-packfailed locally with an opaque "npm pack failed" -- root-caused tospawnSync("npm", ...)needingshell: trueto resolvenpm.cmdon Windows; confirmed viagit stashthis is pre-existing and unrelated to this PR's diff (fails identically without these changes).npm pack --workspace @jsonbored/gittensory-miner --dry-run --jsonrun directly succeeds and lists this PR's new/changed files correctly. This is a Windows-localspawnSyncPATH-resolution quirk, not a repo bug -- expected to pass on Linux CI.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 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 runs above plusnpm run typecheck/build:miner.Fixes #5164.