GeezerVison is showing github.com — zen/go: Gemini 4 Argon returns upstream 403 "Request rejected in accordance with our terms of use and policies" · Issue #64557 · anomalyco/opencode
zen/go: Gemini 4 Argon returns upstream 403 "Request rejected in accordance with our terms of use and policies" #64557DescriptionSummary
Requests to Gemini 4 Argon via the OpenCode Go subscription (opencode.ai/zen/go/...
route) fail with an upstream 403 policy rejection, even for trivial prompts ("test").
Other models on the same subscription (e.g. GLM-5.3) work minutes later, so client auth
and billing are fine. The rejection comes from the Google upstream behind the relay.
The error is also mislabeled in the UI as an "Authentication error".
Environment
- opencode version: v2.3.0
- OS: macOS 15 (Darwin 24.6.0, arm64)
- Terminal: iTerm.app (xterm-256color, truecolor)
- Shell: /bin/bash
- Install/channel: latest stable desktop app (v2.3.0, /Applications/OpenCode.app)
- Active plugins: none
Reproduction
- In the desktop app, select
opencode-go/gemini-4-argon (OpenCode Go subscription).
- Send a trivial prompt, e.g.
test.
- Request fails immediately; two consecutive attempts failed at
2026-11-17 ~19:11 ET (2026-11-18 00:11 UTC).
Expected Behavior
The prompt completes. If the upstream provider rejects it on policy grounds, the error
is surfaced as a provider policy rejection, not as an "Authentication error".
Actual Behavior
Verbatim error shown in the chat UI (twice):
Authentication error: Authentication failed for https://opencode.ai/zen/go/v1/chat/completions.
Status: 403 Forbidden. Response: Upstream request failed: [403] Request rejected in
accordance with our terms of use and policies.
Additional Context
- The upstream message is Google Gemini's verbatim policy-block message. It is currently
reported widely as false positives against coding-agent traffic, including trivial
prompts, paid accounts, and third-party apps/relays:
opencode service status reports a healthy server (http://127.0.0.1:49374). The
server log shows no stream error entries at the failure timestamp, so the failure
surfaced client-side only.
- Workaround: switching to another model on the same subscription (e.g. GLM-5.3) works.
- Possible asks: (1) check whether the Zen relay's Google upstream project is being
ToS-flagged, (2) consider routing/fallback, (3) consider distinguishing upstream
policy 403s from auth errors in the UI.
Activityopencodejr commented on Nov 18, 2026 Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.
Thanks for the detailed report. I reproduced the mislabelling part with a mock server standing in for the Go gateway's 403 response, which you gave in the report.
What I did: on opencode v2.3.0, I pointed a custom OpenAI-compatible provider at a local server. The server answers every request with HTTP 403 and the body Upstream request failed: [403] Request rejected in accordance with our terms of use and policies., then I ran opencode run --format json with the prompt test. The error comes back as "type":"provider.auth" (an authentication failure), not as a provider policy refusal. It still happens on the latest dev (de291ab). The script below reproduces it.
Not covered: I could not check the upstream refusal of Gemini 4 Argon itself. It happens in the hosted Go service and needs a real Go account to see. I also didn't run the desktop app, so the "Authentication error" label it shows is as you described it.
Related:
Reproduction script (repro.sh)
#!/usr/bin/env bash
# Reproduces #64557: an upstream 403 policy refusal is classified as provider.auth.
# Needs bun and @opencode/cli (bun add -g @opencode/[email protected]).
set -euo pipefail
dir=$(mktemp -d); cd "$dir"
cat > mock.ts <<'TS'
const body = JSON.stringify({ error: { type: "server_error", message: "Upstream request failed: [403] Request rejected in accordance with our terms of use and policies." } })
Bun.serve({ port: 4599, fetch: () => new Response(body, { status: 403, headers: { "content-type": "application/json" } }) })
TS
bun mock.ts & mock=$!; trap 'kill $mock' EXIT; sleep 1
mkdir proj && cd proj && git init -q
cat > opencode.jsonc <<'JSON'
{
"providers": {
"mockgo": {
"name": "Mock Go",
"env": ["MOCKGO_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "http://127.0.0.1:4599/zen/go/v1" },
"models": { "gemini-4-argon": { "name": "Gemini 4 Argon" } }
}
}
}
JSON
opencode --version
MOCKGO_API_KEY=sk-test opencode run --format json --model mockgo/gemini-4-argon "test" | grep '"type":"error"'
# Expected: an error type other than provider.auth (e.g. a content-policy error). Actual: "type":"provider.auth".
Run it: bash repro.sh
Reacted by tomrannosaurus neriousy commented on Nov 19, 2026 Thanks for the detailed report and the links, they helped a lot.
The 403 itself came from Google, not from OpenCode. For short stretches, Google flagged one of the Vertex endpoints behind Gemini 4 Argon and rejected every request on it, whatever the prompt. Your failures at 00:11 UTC on Nov 18 fall in one of those stretches. Most of the time the gateway retried on another route and users didn't notice; yours hit a stretch where no other route was available. The refusals have stopped since, and Argon on Go is working normally again.
The "Authentication error" label was our bug. We treated every 403 as an auth failure unless it matched a known content-policy message, and Google's wording wasn't on that list. That's fixed in #64910: these refusals are now reported as a provider policy rejection instead of an authentication failure. It will ship in the next release.
If you see this again on a recent version, please open a new issue with the timestamp.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|