feat(diagnostics): Anthropic OAuth migration warning banner (#556)#911
Draft
vivekchand wants to merge 1 commit intomainfrom
Draft
feat(diagnostics): Anthropic OAuth migration warning banner (#556)#911vivekchand wants to merge 1 commit intomainfrom
vivekchand wants to merge 1 commit intomainfrom
Conversation
…556) After Anthropic's April 4 2026 billing change, users still configured with an OAuth profile (no API key) will silently fail. ClawMetry already reads the OpenClaw config to detect billing mode; this wires that signal into a dismissible top-of-page banner so affected users see an actionable message the next time they open the dashboard. - routes/health.py: add `anthropic_oauth_warning` bool to /api/diagnostics (True when an Anthropic auth profile exists but no API key is configured) - clawmetry/templates/partials/banners.html: new #oauth-migration-banner (amber palette, matches existing heartbeat/budget banners) - clawmetry/static/js/app.js: loadDiagnostics() shows the banner on flag; dismissOauthMigrationBanner() + copyOauthMigrationCmd() handle UX Closes #556 Co-Authored-By: ClawMetry Autofix Bot <bot-autofix@clawmetry.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After Anthropic's April 4 2026 billing change, users who configured OpenClaw with an OAuth/legacy token (instead of an API key) will silently fail. ClawMetry already reads the OpenClaw config to detect billing mode; this PR wires that signal into a dismissible top-of-page warning banner so affected users see a clear, actionable message the next time they open the dashboard.
Changes
routes/health.py: extend/api/diagnosticswithanthropic_oauth_warning: bool—Truewhen an Anthropic auth profile exists in~/.openclaw/openclaw.jsonbut no API key is configured (uses existing_provider_has_api_key+_load_openclaw_config_cachedhelpers, no new logic)clawmetry/templates/partials/banners.html: new#oauth-migration-bannerdiv — amber warning palette, matching the heartbeat/budget banner style; includes a one-click copy button foropenclaw onboard --anthropic-api-keyclawmetry/static/js/app.js:loadDiagnostics()shows the banner when the flag is set and the user hasn't dismissed it;dismissOauthMigrationBanner()hides and persists dismissal vialocalStorage;copyOauthMigrationCmd()handles clipboard copy with fallbackTest plan
ANTHROPIC_API_KEY=""and add an Anthropic auth profile (withmode != "token") to~/.openclaw/openclaw.json→ banner appears on dashboard loadANTHROPIC_API_KEY=sk-ant-...→ no banner shownopenclaw onboard --anthropic-api-keyis copied to clipboardGET /api/diagnosticsreturnsanthropic_oauth_warning: true/falsecorrectlypython3 -c 'import ast; ast.parse(open("routes/health.py").read())'passesBot meta
Draft PR opened autonomously based on the plan in #556. Marked draft for human review — mark Ready for Review once happy.
Closes #556
Generated by Claude Code