Skip to content

fix: implement proper VALIDATION_REQUIRED error handling with progressive cooldown#338

Draft
aaronsewall wants to merge 2 commits intoNoeFabris:devfrom
aaronsewall:335-validation-errors
Draft

fix: implement proper VALIDATION_REQUIRED error handling with progressive cooldown#338
aaronsewall wants to merge 2 commits intoNoeFabris:devfrom
aaronsewall:335-validation-errors

Conversation

@aaronsewall
Copy link
Contributor

Summary

This PR implements comprehensive fixes for the VALIDATION_REQUIRED error handling issue (#335).

Changes

Error Detection & Handling

  • Added structured ErrorInfo detection for VALIDATION_REQUIRED errors
  • Returns synthetic error with visible verification URL to users
  • Progressive cooldown schedule (10m → 1h → 6h → 24h) instead of hardcoded 24h

Account Management

  • Fixed getMinWaitTimeForFamily to properly handle account cooldowns
  • Added verification URL storage and persistence
  • Clear verification state on successful API calls
  • Added 'Clear verification block' action for manual recovery

UI Improvements

  • Added verification-required badge (magenta) in auth menu
  • Shows verification URL in account details
  • Clear instructions for users on how to recover

Testing

  • Added comprehensive tests for cooldown and verification logic
  • All 815 tests pass

Fixes

Fixes #335

…sive cooldown

- Add structured ErrorInfo detection for VALIDATION_REQUIRED errors
- Fix getMinWaitTimeForFamily to properly handle account cooldowns
- Implement progressive cooldown schedule (10m → 1h → 6h → 24h)
- Add verification URL storage and display
- Return synthetic error with visible verification URL to users
- Add verification-required badge (magenta) in auth menu
- Add 'Clear verification block' action for manual recovery
- Clear verification state on successful API calls
- Add comprehensive tests for cooldown and verification logic

Fixes NoeFabris#335
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

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

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

@aaronsewall
Copy link
Contributor Author

@codex

@aaronsewall
Copy link
Contributor Author

This is probably over-engineered but the goal was to make it easy to surface the verification URL to the user when it occurs. 🤷

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b9e598c89

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +123 to +127
if (account.cooldownReason === 'verification-required') {
options.push({
label: 'Clear verification block (I verified my account)',
value: 'clear-verification',
color: 'green',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire up clear-verification action to state reset

This menu option introduces a new clear-verification action, but nothing in the caller handles it: promptLoginMode only reacts to delete, refresh, and toggle, so choosing “Clear verification block” performs no state change and the cooldown remains in place. That means users who actually verified their account have no way to unblock it via the CLI, despite the UI implying they can. Please add handling to call AccountManager.clearVerificationCooldown (or equivalent) and persist the updated storage when this action is selected.

Useful? React with 👍 / 👎.

@aaronsewall
Copy link
Contributor Author

I'm not thrilled with this after testing it. The toast notifications are fine, but using opencode cli the error messages are ugly and kind of "flood" the terminal (error characters extend past the screen). On reloading the session the chat message for the error is actually ok looking. Not quite sure how to solve that.

I also can't actually test the opencode auth login changes on my machine, it's never worked for me with plugins. I went and verified all my accounts yesterday and mostly just looked at the urls this branch writes to the antigravity-accounts.json file. These expire (not sure how long) and I needed to trigger sending new messages to get new urls, which required me to basically keep one account in the file at a time. Overall just not a great experience for users trying to dig out of this hole, but I'd say still an incremental improvement. Feels like this PR is in the right spirit but maybe not solving the problem quite the right way. Happy to iterate more, but I don't really want to merge this in as is, so planning to leave it as a draft.

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