Skip to content

fix(google): classify "User location is not supported" as location/permission error instead of invalid_request #3467

Description

@agentHits

Client or integration

Codex App

Area

Provider adapter

Summary

When Google Antigravity (Cloud Code Assist API) rejects a request due to an unsupported geographic region or datacenter IP (HTTP 400 with FAILED_PRECONDITION: User location is not supported for the API use.), OpenCodeX classifies it as Antigravity invalid request and returns type: "invalid_request_error".

Expected: It should be classified as a location/permission error (location_not_supported / permission_error) rather than an invalid request error, because the request payload/prompt is not syntactically invalid.

Reproduction

  1. Start OpenCodeX proxy (opencodex start --port 10100).
  2. Configure google-antigravity provider.
  3. Send a request from a network location or datacenter IP where Google API restricts access.
  4. Upstream returns 400 User location is not supported for the API use.
  5. Observe OpenCodeX output: Provider error 400: Antigravity invalid request: User location is not supported for the API use. with type: "invalid_request_error".

Version

2.43.0

Operating system

macOS 15.5

Provider and model

google-antigravity / gemini-3.8-flash

Logs or error output

Provider error 400: {"error":{"message":"Provider error 400: Antigravity invalid request: User location is not supported for the API use.","type":"upstream_error","code":null}}

Screenshots and supporting files

No response

Redacted configuration

No response

Checks

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

Activity

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

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirks

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions