Skip to content

feat(miner): surface a codex auth-freshness remediation detail in doctor (#5166)#5297

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-codex-auth-remediation-5166
Jul 12, 2026
Merged

feat(miner): surface a codex auth-freshness remediation detail in doctor (#5166)#5297
JSONbored merged 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-codex-auth-remediation-5166

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

  • checkCodexCliPresent in packages/gittensory-miner/lib/laptop-init.js already stats auth.json for readability, but reported the same generic advisory string regardless of whether codex-cli is actually the configured driver. Now that Gate doctor's claude/codex CLI-presence checks by the configured MINER_CODING_AGENT_PROVIDER #5165 landed the provider-gating this depends on, this issue narrows the codex-specific message further.
  • When MINER_CODING_AGENT_PROVIDER === "codex-cli" and auth.json is missing or unreadable, the check now surfaces a specific, actionable remediation: found at <path> but auth.json is missing or expired — run \codex auth` to authenticate before attempts run`.
  • The unconfigured (or differently-configured) case's message is completely unchanged: found at <path> (not authenticated: run \codex auth`)`.
  • No new subprocess execution or network call -- this only refines the message text of an already-existing filesystem-stat-based check.
  • ok's gating logic itself is untouched (owned entirely by Gate doctor's claude/codex CLI-presence checks by the configured MINER_CODING_AGENT_PROVIDER #5165) -- this is a message-quality refinement for the already-ok: true (CLI-present-but-unauthenticated) case, not a behavioral bug fix.

Test plan

  • npx vitest run test/unit/miner-cli-doctor-checks.test.ts -- 20/20 passing, including 4 new cases: the codex-configured + auth-missing remediation message, the codex-configured + auth-present case (no remediation text), a different-provider-configured case keeping the generic message unchanged, and an invariant that the unconfigured-provider message shape never changes regardless of auth.json state.
  • npm run typecheck -- clean.
  • npm run build:miner -- clean (node --check on every shipped miner lib file passes).
  • npm run docs:drift-check -- clean.
  • 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 run above plus npm run typecheck/build:miner.

Fixes #5166.

…tor (JSONbored#5166)

checkCodexCliPresent already stats auth.json for readability but
reported a generic advisory string regardless of whether codex-cli is
actually the configured driver. When MINER_CODING_AGENT_PROVIDER is
codex-cli and auth.json is missing or unreadable, the check now
surfaces a specific, actionable remediation ("run `codex auth` to
authenticate before attempts run") instead of the generic aside. The
unconfigured (or differently-configured) case's message is unchanged,
and ok stays true either way -- this is a message-quality refinement
on top of JSONbored#5165's gating, not a change to the ok logic itself.
@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 94.37%. Comparing base (d56f4ec) to head (ae4a45f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5297   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files         474      474           
  Lines       40128    40128           
  Branches    14631    14631           
=======================================
  Hits        37869    37869           
  Misses       1583     1583           
  Partials      676      676           
Flag Coverage Δ
shard-1 46.28% <ø> (-0.15%) ⬇️
shard-2 34.74% <ø> (+0.03%) ⬆️
shard-3 30.96% <ø> (-1.11%) ⬇️
shard-4 32.91% <ø> (+0.81%) ⬆️
shard-5 33.59% <ø> (-0.09%) ⬇️
shard-6 45.07% <ø> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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:32:01 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This diff narrows `checkCodexCliPresent`'s message when `MINER_CODING_AGENT_PROVIDER === "codex-cli"` and auth.json is missing/unreadable, giving an actionable remediation string instead of the generic advisory, while leaving `ok` and all other branches untouched. The logic is a straightforward, correctly-scoped conditional split with four new tests covering both branches of the new ternary (configured-and-missing, configured-and-present, differently-configured, unconfigured-invariant). It matches its stated intent tightly and depends on already-landed provider-gating from #5165.

Nits — 5 non-blocking
  • nit: the large inline comment block at laptop-init.js:172-176 restates what the code already makes clear from the ternary and prior JSDoc — could be trimmed to the non-obvious 'ok stays true' rationale only.
  • nit: consider extracting the duplicated `codingAgentProviderConfiguredFor(env, "codex-cli")` check into a single call since it's now evaluated only once here but the pattern of checking then branching on the same provider string could drift if the codex/claude checks diverge further.
  • Consider consolidating the new codex-specific remediation tests with the existing 'codex: present but not authenticated' test since they now overlap in what they assert about the differently-configured/unconfigured cases (test/unit/miner-cli-doctor-checks.test.ts).
  • nit: packages/gittensory-miner/lib/laptop-init.js:172 says `auth.json is missing or expired`, but the code at packages/gittensory-miner/lib/laptop-init.js:161 only checks filesystem readability, so this message still conflates unreadable and expired states.
  • packages/gittensory-miner/lib/laptop-init.js:172: consider changing the detail to `auth.json is missing, unreadable, or expired` if you want the message to match the actual probe while keeping the intended remediation.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5166
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 b7a410d 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 a codex auth-freshness remediation detail in doctor when codex-cli is the configured driver

2 participants