Skip to content

Make CLI doctor fail on unvalidated or ambiguous credentials - #47

Merged
purpshell merged 1 commit into
devfrom
codex/cli-doctor-diagnostics-20260926
Sep 26, 2026
Merged

purpshell merged 1 commit into
devfrom
codex/cli-doctor-diagnostics-20260926

Conversation

@purpshell

@purpshell purpshell commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

polymorfa doctor could exit 0 after skipping credential validation, and it silently chose one key when multiple credential environment variables were set. A no-credential run also treated the missing credential as a warning. These results made a green diagnostic misleading.

Doctor now exits 1 for missing or unvalidated credentials and reports conflicting environment credentials without sending either to the API. An explicit --profile still takes precedence. A server API key that authenticates but cannot list projects still produces a 403 warning; a rejected 401 key fails. Output remains redacted. CLI help and README describe the exit behavior.

The matching public guide is in polymorfa/polymorfa PR #384, based on CLI commit 60b083555643f823356a7f3b209330e397904a0b. Merge the guide with this change; do not publish the CLI until its separate release gates are satisfied.

Verification: 18 focused service and command tests passed, including actual command success and exit-code-1 paths. The full CLI suite passed (872 tests in 89 files), as did typecheck, lint, build, formatting, and diff checks. The paired Mintlify page passed broken-links, validate, and accessibility checks. No live API credentials or deployed environment were exercised.

Contract assessment: API and SDKs are unaffected; no wire shape, scope, or SDK method changes. CLI is updated here. Public docs are updated in PR #384; no changelog entry claims unpublished CLI behavior as shipped. Feature releases are unaffected because this local diagnostic has no flag, entitlement, or enrollment change. Admin controls are unaffected because no staff view or action changes.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 62 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: e8fae1ab-49f2-4cfb-92ad-6e2ad3542553

📥 Commits

Reviewing files that changed from the base of the PR and between 8bacf9f and 60b0835.

📒 Files selected for processing (5)
  • README.md
  • src/commands/doctor.ts
  • src/services/doctor.ts
  • test/commands/doctor.test.ts
  • test/services/doctor.test.ts

Comment @coderabbitai help to get the list of available commands.

@purpshell
purpshell merged commit 8f15b2f into dev Sep 26, 2026
3 checks passed
@purpshell
purpshell deleted the codex/cli-doctor-diagnostics-20260926 branch October 26, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant