Skip to content

[Bug]: Cloud Code Assist ToS account ban is detected but never pauses the account, and the appeal_url is discarded #8752

Closed

Description

@twoimo

Client or integration

Codex CLI

Area

Authentication and account pool

Summary

A confirmed Cloud Code Assist account-level ToS ban is correctly classified by the shipped classifier but never pauses the account, because the whole auto-pause path is gated behind an opt-in flag that defaults to absent. The account keeps being selected and re-hit with the same permanent 403. The appeal_url Google returns inside the error is also dropped, so the operator never learns an appeal exists.

Observed

Real response from cloudcode-pa.googleapis.com (v1internal:generateContent):

{
  "error": {
    "code": 403,
    "message": "This service has been disabled in this account for violation of Terms of Service. Please submit an appeal to continue using this product.",
    "status": "PERMISSION_DENIED",
    "details": [{
      "@type": "type.googleapis.com/google.rpc.ErrorInfo",
      "reason": "TOS_VIOLATION",
      "domain": "cloudcode-pa.googleapis.com",
      "metadata": { "uiMessage": "true", "appeal_url": "https://forms.gle/..." }
    }]
  }
}

This is exactly the envelope #7819 (closing #7803) added at src/oauth/account-auto-pause-policy.ts:28-31: HTTP 403 + numeric code: 403 + status: "PERMISSION_DENIED" + the whole ToS sentence. Running the shipped regex against the live message:

regex matches actual message: true
code===403: true | googleStatus: PERMISSION_DENIED

So classification works. The failure is downstream.

Why it never pauses

src/oauth/account-auto-pause.ts:44-46:

const threshold = autoPauseThreshold(config.providers[name]?.accountAutoPause);
if (!threshold) return;   // <-- returns before any observer is installed

and autoPauseThreshold (account-auto-pause-policy.ts:43-47) returns undefined unless policy?.enabled === true. The type documents this as opt-in:

/** Explicit opt-in. Omitted and false both leave account eligibility unchanged. */
enabled?: boolean;

My provider had no accountAutoPause key at all (null), so no observer was ever registered and the ban was invisible to the pool.

Impact measured from usage.jsonl

Two Cloud Code Assist accounts, both genuinely banned:

account last 200 first 403 403s after ban window successes after ban
A 11-14 13:00:23 11-14 13:00:29 12 1.7 h 0
B 11-13 22:55:46 11-14 14:44:48 9 2.8 h 0

Account A's first 403 lands 6 seconds after its last 200, so there is no ambiguity window in which the verdict could be dismissed as transient. Zero successes across both accounts after the first 403, yet the pool kept issuing requests for hours.

Expected

  1. A verdict Google itself marks permanent (TOS_VIOLATION / "service has been disabled in this account") should pause that account on the first occurrence and should not require opt-in. The consecutiveFailures streak makes sense for ambiguous refusals, but a whole-message permanent ban is conclusive on first hit. At minimum this verdict should be exempt from the opt-in gate, or the gate should default to enabled for the CCA adapter.
  2. The appeal_url in ErrorInfo.metadata should be surfaced, logged once per account and exposed via the management API / dashboard, so the operator can act instead of silently retrying a dead account.

The practical workaround today is noticing the 403s by hand and setting accountAutoPause: { enabled: true } on the provider, which is not discoverable from the error message.

Reproduction

  1. Have a google-antigravity provider in config.json using authMode: "oauth", googleMode: "cloud-code-assist", with two healthy OAuth accounts and no accountAutoPause key (the default for anyone who never opted in).
  2. Let either account get suspended by Google. Generation then returns the 403 TOS_VIOLATION envelope quoted above; v1internal:loadCodeAssist still returns 200, so the account is not detected as dead by any quota path.
  3. Keep sending normal traffic through the proxy for a couple of hours.
  4. Observe: the banned account keeps being selected and re-hit with 403. usage.jsonl accumulates 403 rows with the same accountLogLabel and no successes in between, but no pausedAt / pause reason is ever set on the account (there is no GET /api/oauth/accounts field change), because no observer was registered in step 1.

To see the difference, add the opt-in and repeat:

"google-antigravity": {
  "accountAutoPause": { "enabled": true, "consecutiveFailures": 2 }
}

With the opt-in present the classifier (which already matches the message) starts counting and the account is paused after the threshold. Without it, the shipped ToS detection from #7819 is unreachable dead code for every default install.

Reproduces 100% of the time because the suspension is permanent and server-side; no local state affects it.

Version

2.100.2

Operating system

macOS 27.2 (arm64, MacBook Pro M5 Max)

Provider and model

google-antigravity / gemini-3.8-flash (googleMode: cloud-code-assist, authMode: oauth)

Logs or error output

Upstream response, verbatim (secrets removed):


HTTP/1.1 403 Forbidden

{
  "error": {
    "code": 403,
    "message": "This service has been disabled in this account for violation of Terms of Service. Please submit an appeal to continue using this product.",
    "status": "PERMISSION_DENIED",
    "details": [{
      "@type": "type.googleapis.com/google.rpc.ErrorInfo",
      "reason": "TOS_VIOLATION",
      "domain": "cloudcode-pa.googleapis.com",
      "metadata": {
        "uiMessage": "true",
        "appeal_url": "https://forms.gle/<redacted>",
        "appeal_url_link_text": "Submit Appeal"
      }
    }]
  }
}


Corresponding `usage.jsonl` rows (labels are the proxy's own `accountLogLabel`):


{"provider":"google-antigravity","status":403,"accountLogLabel":"<A>","timestamp":...}
{"provider":"google-antigravity","status":403,"accountLogLabel":"<A>","timestamp":...}
{"provider":"google-antigravity","status":403,"accountLogLabel":"<B>","timestamp":...}


75 total 403 rows for this provider in the log, 12 on account A and 9 on account B, all with `reason: TOS_VIOLATION`. No pause record was produced for either account.

Note that `v1internal:loadCodeAssist` still returns 200 for both accounts at the same time, and `https://www.googleapis.com/oauth2/v2/userinfo` returns 200 with `verified_email: true`, so nothing in the quota/health path notices the account is unusable for generation.

Screenshots and supporting files

No response

Redacted configuration

"google-antigravity": {
  "adapter": "google",
  "authMode": "oauth",
  "googleMode": "cloud-code-assist",
  "oauthAccountFailover": { "enabled": true, "autoSwitchThreshold": 80 },
  // "accountAutoPause": absent -> null; this is the bug trigger
}


`oauthAccountFailover` is enabled but does not help here: it switches on quota percentage, and a ToS-banned account still reports usable quota. Only `accountAutoPause` would catch it, and it is off by default.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Nov 14, 2026
  2. added
    account-pool
    on Nov 14, 2026
  3. twoimo commented on Nov 14, 2026

    @twoimo
    ContributorAuthor

    Confirming the workaround on the same install (2.100.2, macOS): adding the opt-in makes it work correctly on the live path.

    "google-antigravity": {
      "accountAutoPause": { "enabled": true, "consecutiveFailures": 2 }
    }

    Applied via ocx provider edit so the running proxy picked it up (editing config.json directly did not take effect — GET /api/config still reported accountAutoPause: null until the management path wrote it). Then two requests:

    attempt 1: HTTP 403 provider error 403 ... Terms of Service ...
    attempt 2: HTTP 403 provider error 403 ... Terms of Service ...
    attempt 3 (account B now): HTTP 403 ... Terms of Service ...
    attempt 4: HTTP 403 "OAuth account is paused. Resume it in account settings and retry."
    

    ocx account list google-antigravity --json:

    { "id": "63bd84…", "paused": true, "pauseDetails": { "reason": "account_permission_denied", "pausedAt": 1794646749258 } },
    { "id": "f96c72…", "paused": true, "pauseDetails": { "reason": "account_permission_denied", "pausedAt": 1794646797258 } }

    So the classifier, the pause write, and the pool exclusion all work. The only gap is that this is opt-in and undiscoverable from the error. Two small follow-ups would close it:

    • Treat a whole-message TOS_VIOLATION refusal as conclusive on first hit regardless of accountAutoPause.enabled.
    • Keep surfacing ErrorInfo.metadata.appeal_url in the operator-visible error so the 403 tells the user what to do (appeal), instead of only that it failed.

    A side note while testing: pointing defaultProvider at a provider whose accounts are all paused yields OAuth account is paused on every request rather than failing over to another configured provider. That is arguably correct, but it is easy to hit after this exact scenario because the default provider keeps its old value.

  4. dongbidi commented on Nov 14, 2026

    @dongbidi

    Additional reproduction: account suspension in native Antigravity and Codex Desktop

    This adds evidence about the Google account suspension itself, alongside the OpenCodex auto-pause behavior described above. The affected Antigravity account had been working earlier; requests then began returning the account-level Terms of Service refusal.

    Observed in this incident:

    • The Google Models & Usage page showed Gemini quota headroom at the time of the failure: 96% weekly remaining and 83% of the five-hour limit remaining. This does not look like quota exhaustion.
    • The native Antigravity application, used directly without OpenCodex in the request path, displayed the same message: HTTP 403 / PERMISSION_DENIED, stating that the service was disabled in the account for a Terms of Service violation and asking the user to submit an appeal.
    • In Codex Desktop through the local OpenCodex Responses endpoint, refreshing the provider/model catalog did not change the upstream result. A request using google-antigravity / gemini-4-carbon first returned the same 403 refusal.
    • With accountAutoPause: { enabled: true, consecutiveFailures: 2 } configured, the subsequent attempt showed OpenCodex's local response, OAuth account is paused. Resume it in account settings and retry.

    This separates two effects: Google's account-level refusal is still present in the official Antigravity app, while OpenCodex's configured auto-pause then prevents further retries. The direct-app result does not establish whether OpenCodex contributed to Google's suspension; it shows that the restriction is not just a local proxy, provider-refresh, or Codex Desktop connection error.

    Useful follow-up would be to surface the structured Google refusal and its appeal link clearly, make the account-level suspension distinct from quota exhaustion in the operator-facing error, and prevent repeated requests once this definitive refusal is received. No email address, OAuth credential, account identifier, or Google error ID is included here.

  5. Ingwannu commented on Nov 16, 2026

    @Ingwannu
    Owner

    The current source confirms the behavior you isolated: captureAccountAutoPauseAttempt returns before installing an observer when autoPauseThreshold is absent, and the config contract deliberately treats absent/false as opt-out. That is a policy/default gap rather than a failure of the exact 403 classifier. Your follow-up shows the configured streak path working; the native-app observations in #8760 do not establish why Google suspended the account.

    Making a permanent refusal override that opt-in changes account eligibility by default, so it needs an explicit owner decision, including how an explicit false differs from an omitted setting. A patch must retain the existing credential-generation, destination, policy-revision and pause-revision fences; a response for an old login must not pause a new one. Add structured TOS-refusal versus ordinary 403/quota/transient controls, and no automatic resume or silent account-policy change.

    Appeal guidance should be a separate bounded, validated operator-visible projection. Treat upstream metadata as untrusted; do not blindly log or render an arbitrary appeal URL or its query data. #8820's unmerged acknowledgement does not implement first-hit pausing or reverse an upstream suspension. No account settings, eligibility or service were changed in this triage.

  6. Ingwannu commented on Nov 16, 2026

    @Ingwannu
    Owner

    Follow-up: #8826 is now open as a Draft for the no-policy default described above. Its proposed threshold-one path is limited to the exact Cloud Code Assist account-ban envelope, while explicit policy values override the default. It still needs owner policy acceptance, current-head review and CI; this is not a shipped fix. Appeal URL presentation remains a separate outstanding part of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolbug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions