Skip to content

Surface a codex auth-freshness remediation detail in doctor when codex-cli is the configured driver #5166

Description

@JSONbored

Context

checkCodexCliPresent in packages/gittensory-miner/lib/laptop-init.js already stats auth.json for readability, but today it reports a generic advisory string regardless of whether codex-cli is actually the configured provider. Once the provider-gating issue in this batch lands, the check will be able to distinguish "configured and broken" from "not configured" — this issue narrows the codex-specific message further so operators get an actionable remediation instead of a vague aside.

Dependencies

Depends on the provider-gating issue in this same batch ("Gate doctor's claude/codex CLI-presence checks by the configured MINER_CODING_AGENT_PROVIDER") landing first — do not start until that ships, since this issue extends the same checkCodexCliPresent function's now-gated ok logic with a more specific message for the codex-configured-and-broken case.

Requirements

  1. Extend checkCodexCliPresent so that when MINER_CODING_AGENT_PROVIDER === 'codex-cli' (per the now-landed gating) and auth.json is missing or unreadable, the reported message names the exact remediation step: run codex auth.
  2. The message text should mirror ORB's codexAuthReadinessProbe messaging convention for consistency across the codebase.
  3. When codex-cli is not the configured provider, the check must retain its existing generic advisory behavior (no change to the unconfigured case's message).
  4. Do not introduce any new subprocess execution or network call — this only refines an already-existing filesystem-stat-based check's message text.
  5. Do not change the ok boolean's gating logic itself — that is fully owned by the provider-gating issue this depends on; this issue only changes the message content for the already-gated failure case.

Deliverables / Acceptance Criteria

  • checkCodexCliPresent emits the specific "run codex auth" remediation string when codex-cli is configured and auth.json is missing/unreadable
  • Unconfigured-provider case message is unchanged
  • Message wording aligned with ORB's codexAuthReadinessProbe convention
  • test/unit/miner-cli-doctor-checks.test.ts updated with a case asserting the new message text

Test Coverage Requirements

This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. Add: (1) unit tests covering both the codex-configured/auth-missing case (asserting the exact "run codex auth" string appears) and the codex-configured/auth-present case (no remediation message), (2) an invariant test asserting the unconfigured-provider case's message never changes shape regardless of auth.json state, and (3) a regression test is not applicable since this is a message-quality refinement, not a behavioral bug fix.

Codecov visibility note: packages/gittensory-miner/**, apps/gittensory-miner-ui/**, and apps/gittensory-miner-extension/** currently sit entirely outside vitest's coverage.include glob, so codecov/patch cannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change under packages/gittensory-engine/src/** or the repo's own src/** remains fully Codecov-instrumented as usual. Either way, this does not lower the bar: treat the 100%-including-invariants-and-regression target above as the enforced house standard regardless of what Codecov can currently see, and it becomes gate-enforced for real once #4864/#4865 ship.

Expected Outcome

An operator who has configured codex-cli as their coding-agent provider and whose codex auth has gone stale sees a precise "run codex auth" instruction in doctor output instead of a generic, unhelpful "not authenticated" note.

Links & Resources

  • packages/gittensory-miner/lib/laptop-init.js (checkCodexCliPresent)
  • ORB's codexAuthReadinessProbe messaging (self-host AI provider checks)
  • See the provider-gating issue in this same batch (required dependency)
  • Theme: Claude/Codex self-host operational parity

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions