Skip to content

feat(miner): surface the resolved coding-agent-driver provider and CLI presence in status --json (#5164)#5312

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-status-driver-info-5164
Jul 12, 2026
Merged

feat(miner): surface the resolved coding-agent-driver provider and CLI presence in status --json (#5164)#5312
JSONbored merged 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-status-driver-info-5164

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

  • packages/gittensory-engine/src/miner/driver-factory.ts already resolves MINER_CODING_AGENT_PROVIDER along with per-provider model/timeout env vars, but packages/gittensory-miner/lib/status.js never surfaced any of that -- an operator running gittensory-miner status --json had no way to see which coding-agent provider is configured or whether its CLI is present without separately inspecting env vars or PATH.
  • collectStatus now returns a driver section: { provider, modelEnvVar, cliPresent }.
    • provider -- the resolved provider name, via resolveFirstConfiguredCodingAgentDriverName (the exact same resolution driver-factory.ts itself uses), or null when unconfigured.
    • modelEnvVar -- the name of the relevant model env var for the resolved provider (e.g. MINER_CODING_AGENT_CLAUDE_MODEL), via CODING_AGENT_DRIVER_CONFIG_ENV -- never its value. null for providers with no model key (noop, agent-sdk) or when unconfigured.
    • cliPresent -- boolean for claude-cli/codex-cli (whether the CLI binary is on PATH), null (not applicable) for noop/agent-sdk/unconfigured, since there's no CLI binary to check for those.
  • Exports findExecutableOnPath from laptop-init.js so status.js reuses the exact same PATH-scan primitive the doctor CLI-presence checks (checkClaudeCliPresent/checkCodexCliPresent) already use, rather than duplicating the scan or parsing a DoctorCheck's detail string.
  • The human-readable (non-JSON) status output renders the same info in plain text (driver: codex-cli (CLI present: yes, model env: MINER_CODING_AGENT_CODEX_MODEL), or driver: none configured).
  • No secret value (env-var value, auth file contents) ever appears in the output -- only names and booleans, by construction.

Test plan

  • npx vitest run test/unit/miner-status.test.ts -- 9 new tests covering: unconfigured (provider: null), noop and agent-sdk (no model env var, cliPresent: null), claude-cli/codex-cli with the CLI present (real temp executable on PATH) 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 in status --json output. One pre-existing, unrelated test in this file (resolves the state dir...) fails locally on Windows due to a path.join separator mismatch (\ vs /) -- confirmed via git stash that this failure exists identically without this PR's changes; it passes on Linux CI.
  • npm run typecheck -- clean.
  • npm run build:miner -- clean (node --check on every shipped miner lib file, including laptop-init.js and status.js, passes).
  • npm run docs:drift-check / npm run manifest:drift-check -- clean.
  • npm run test:miner-pack failed locally with an opaque "npm pack failed" -- root-caused to spawnSync("npm", ...) needing shell: true to resolve npm.cmd on Windows; confirmed via git stash this is pre-existing and unrelated to this PR's diff (fails identically without these changes). npm pack --workspace @jsonbored/gittensory-miner --dry-run --json run directly succeeds and lists this PR's new/changed files correctly. This is a Windows-local spawnSync PATH-resolution quirk, not a repo bug -- expected to pass on Linux CI.
  • packages/gittensory-miner/** currently sits outside vitest's coverage.include glob (per the issue's own Codecov-visibility note), so codecov/patch cannot measure this change yet -- treating the tests above as the enforced house standard regardless, per the issue's instructions.
  • Did not run the full unsharded npm run test:coverage locally (shared/resource-contended machine); relying on the targeted test runs above plus npm run typecheck/build:miner.

Fixes #5164.

…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-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.16%. Comparing base (6f05c31) to head (3e27941).
⚠️ Report is 11 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (6f05c31) and HEAD (3e27941). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (6f05c31) HEAD (3e27941)
shard-5 1 0
shard-2 1 0
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     
Flag Coverage Δ
shard-1 46.28% <ø> (-0.28%) ⬇️
shard-2 ?
shard-3 30.96% <ø> (-1.14%) ⬇️
shard-4 32.91% <ø> (+0.83%) ⬆️
shard-5 ?
shard-6 45.43% <ø> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 158 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb gittensory-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 12, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 13:53:15 UTC

5 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a `driver` section to `gittensory-miner status`/`status --json` surfacing the resolved coding-agent provider, its model env-var name, and CLI-on-PATH presence, reusing `resolveFirstConfiguredCodingAgentDriverName`/`CODING_AGENT_DRIVER_CONFIG_ENV` from driver-factory.ts and the existing `findExecutableOnPath` scan (now exported) rather than duplicating logic. The implementation correctly handles all four provider states (unconfigured, noop, agent-sdk, claude-cli/codex-cli) and never surfaces env-var values, only names/booleans, which the tests explicitly assert. The PR links issue #5164 and is narrowly scoped to the stated operator-facing goal.

Nits — 5 non-blocking
  • The external secret-scan flags `test/unit/miner-status.test.ts:294-295`, but this is the literal constant `secretModelValue = "sk-ant-should-never-appear-in-output"` used purely as a test fixture to assert the value never leaks — it is not a real credential and needs no rotation.
  • status.js:renderDriverLine's `modelText` is silently omitted when `provider` has no model key (noop/agent-sdk) or is unconfigured, which is correct behavior but could use a one-line comment explaining why (mirrors the JSON `null` semantics) since it's not obvious from the render function alone.
  • Consider adding a short inline comment in `renderDriverLine` (status.js) cross-referencing the `modelEnvVar: null` semantics from `resolveDriverStatus` so both null-producing paths stay conceptually linked for future readers.
  • No functional gaps found in `PROVIDER_CLI_BINARY`'s claude/codex mapping — worth double-checking it stays in sync if driver-factory.ts ever adds a new CLI-backed provider name, since it isn't derived from `CODING_AGENT_DRIVER_NAMES`.
  • nit: packages/gittensory-miner/lib/status.d.ts:2 keeps `provider` as plain `string | null`, which is weaker than the concrete provider names returned by `resolveFirstConfiguredCodingAgentDriverName`; consider importing/exporting the engine provider type or a local union so downstream TypeScript callers do not lose that contract.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5164
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 121 registered-repo PR(s), 71 merged, 11 issue(s).
Contributor context ✅ Confirmed Gittensor contributor joaovictor91123; Gittensor profile; 121 PR(s), 11 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: joaovictor91123
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 121 PR(s), 11 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask 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.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

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.

  • Re-run Gittensory review

@JSONbored JSONbored merged commit fb76770 into JSONbored:main Jul 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. manual-review Gittensor contributor context

Projects

Development

Successfully merging this pull request may close these issues.

Surface the resolved coding-agent-driver provider and CLI presence in gittensory-miner status --json

2 participants