Skip to content

fix(claude): show Anthropic account verification guidance - #8956

Merged
lidge-jun merged 4 commits into
lidge-jun:devfrom
oliver-mee:fix-claude-verification-notice
Nov 21, 2026
Merged

lidge-jun merged 4 commits into
lidge-jun:devfrom
oliver-mee:fix-claude-verification-notice

Conversation

@oliver-mee

@oliver-mee oliver-mee commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When Anthropic asks for account verification, direct Claude Code shows where to go, but OpenCodex turns the notice into a generic permission error. The Messages endpoint now keeps the HTTP 403 and points Claude Code to the official Anthropic Verification Portal. Request history records account_verification_required rather than a generic access denial.

The link is fixed. The response and request history do not copy upstream URLs, query parameters, or organization IDs. Other permission errors, routing, and retry behavior are unchanged.

Verification

  • bun run test tests/claude-integration/messages-lane-errors.test.ts tests/lib/upstream-condition.test.ts tests/claude-integration/messages-error-contracts.test.ts tests/claude-integration/claude-client-refusal-status.test.ts tests/usage/request-log-error-detail.test.ts: 110 passed on macOS with the pinned Bun runner. The new cases cover both /v1/messages stream settings against a loopback Anthropic fixture, one upstream send, and sanitized recent and persisted request logs. Before the fix, both cases returned the generic denial.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, and git diff --check: passed.
  • cd docs-site && bun install --frozen-lockfile && bun run build: passed.
  • Full-suite scope exception: the repository-wide suite is disproportionate for this error-presentation change. The focused files cover the affected protocol, classification, and logging contracts. Full and cross-platform coverage remains unverified locally.

Maintainer follow-up (review round)

  • Merged current dev and added the Spanish translation of the new troubleshooting note; without it tests/ci-workflows/docs-spanish-localization.test.ts fails on the merged tree.
  • Tightened isClaudeVerificationNotice: only the portal link may follow the fixed sentence, so an appended diagnostic such as an invalid key keeps its own classification. The unit test covers the link, an appended credential diagnostic and a foreign link, and fails on the previous matcher.
  • On the merged head: focused tests (upstream-condition, messages-lane-errors) 40 pass; docs parity tests 445 pass; typecheck, structure:check and file-size ratchet exit 0. Independent review: APPROVE after three rounds.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. The regression checks that no organization ID survives in the client body or request logs. No auth behavior changes.

Developed with AI agents, with a human in the loop. Model: gpt-6.2-sol.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features
    • Recognized Anthropic’s account-verification notice and return a clear message linking to the Verification Portal.
    • Preserve the HTTP 403 response and label the condition account_verification_required in request and usage records.
    • Keep sensitive upstream details out of user-facing responses and persisted records.
  • Documentation
    • Added troubleshooting guidance in English and Spanish for the verification notice, including how to resolve it and how OpenCodex handles the error.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

OpenCodex classifies Claude’s exact verification notice as account_verification_required only for HTTP 403. Messages errors use a fixed verification-portal link and retain the 403 response. Tests cover streaming and non-streaming responses, logged classifications, and removal of upstream URL data.

Changes: Claude verification 403 handling

Layer / File(s) Summary
Classify the verification notice
src/lib/upstream-condition.ts, tests/lib/upstream-condition.test.ts
The classifier recognizes the specified Claude verification notice at status 403. Tests cover other statuses, quoted notice text, a verification URL without the notice, and trailing diagnostics.
Build and validate the Messages response
src/lib/messages-error-body.ts, tests/claude-integration/messages-lane-errors.test.ts, structure/data-planes/error-detail.md, docs-site/src/content/docs/guides/claude-code.md, docs-site/src/content/docs/es/guides/claude-code.md
For the recognized condition, Messages returns a verification-specific message with a fixed portal link. Integration tests check both streaming modes, the retained 403 status, recorded classifications, and removal of an upstream URL sentinel. English and Spanish guides and error-detail documentation describe the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • lidge-jun/opencodex#8153: Defines the Messages error response contract and updates the Claude Code guide, which are also relevant to the response and documentation changed here.
Merge Risk: Minimal · up to 3f467

This change keeps Anthropic's HTTP 403 for account-verification notices and points users to the official verification portal. No actionable merge risk was found. Other permission errors, routing, and retry behavior are unchanged.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(claude): show Anthropic account verification guidance" matches the main change. The PR keeps Anthropic's HTTP 403 for account-verification notices and points Claude Code users to the fi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix(claude): show Anthropic account verification guidance" matches the main change. The PR keeps Anthropic's HTTP 403 for account-verification notices and points Claude Code users to the fixed Anthropic Verification Portal link. The changes span the upstream condition classifier, the error body builder, the error-detail docs, tests, and the English and Spanish guides, all of which relate to this guidance. The title is short, specific, and uses a conventional commit prefix.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a4209bc and 3f4673f.

Files selected for processing: 4

  • docs-site/src/content/docs/es/guides/claude-code.md
  • src/lib/messages-error-body.ts
  • src/lib/upstream-condition.ts
  • tests/lib/upstream-condition.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers notified: @lidge-jun @Ingwannu

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as ready for review November 19, 2026 09:59
Review follow-up for lidge-jun#8956. The Claude account-verification matcher accepted any text
after the fixed sentence, so a different diagnostic appended to it (an invalid key, say)
would have been shown as the Anthropic verification guidance. Only the portal link may
follow now; the unit test covers the link, an appended credential diagnostic and a
foreign link.
@github-actions
github-actions Bot marked this pull request as draft November 21, 2026 06:49
@lidge-jun
lidge-jun marked this pull request as ready for review November 21, 2026 06:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T06:55:12.385750Z 3f4673f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (MAINTAINERS.md maintainer-integration exception; lane fb2101-queue-b).

  • Exact head: 3f4673f76e1a105fb2463c84ebfa0e23298658ba
  • Checks on this head: all completed checks pass (ci with gates and test changed, CodeRabbit, enforce-target, hygiene); none pending or failing. Fork runs were approved after confirming the diff touches no .github, CI scripts or install hooks.
  • Review: terra, three rounds. Round 1 APPROVE-WITH-NITS (focused tests fail on origin/dev 37/3 and pass here). Round 2 found the verification matcher accepted any text after the fixed Claude sentence; the maintainer limited the suffix to the portal link and added link, appended-credential-diagnostic and foreign-link cases. The maintainer also merged dev and added the Spanish troubleshooting note that docs-spanish-localization requires on the merged tree. Round 3: APPROVE; presentation-only, no cooldown or rotation change, no identifier echoed or logged.
  • Merged with current dev (061e4ac) locally before merging: typecheck, structure:check, file-size ratchet, docs parity, test-layout, core-lab boundary and the focused suites pass (510/0).
  • Review threads: 0 unresolved.
  • Scope: Claude error presentation in src/lib plus docs; no credential handling, workflow, release, dependency or provider-preset surface.

This is maintainer integration, not an independent approval.

@lidge-jun
lidge-jun merged commit 6a4a4e8 into lidge-jun:dev Nov 21, 2026
39 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants