Skip to content

WSL: opencode-go Forbidden intermittently — works fine on Windows with same IP/version #44390

Closed as not planned

Description

@EricYang2100

Description

Environment

  • OpenCode version: 1.18.18 (both WSL and Windows)
  • OS: WSL2 Ubuntu 22.04 (kernel 6.18.33.2) + Windows 10
  • Public IP: same for both (101.87.170.107)
  • Provider: opencode-go (Go plan)

Problem

WSL Linux build gets AI_APICallError: Forbidden on opencode-go API calls.
Windows build with the same account/IP/version works perfectly.

The error is intermittent — sometimes it works, sometimes it doesn't.
Total Forbidden errors in today's log: 140

Affected models (from log)

  • deepseek-v4-flash (36 errors)
  • deepseek-v4-pro (18 errors)
  • deepseek-v4-flash-free (16 errors)
  • ox-alpha-free (3 errors)
  • x-preview-f-free (2 errors)
  • big-pickle (2 errors)

Both opencode-go (57 errors) and opencode (20 errors) providers are affected.

Additional evidence

  • https://models.opencode.ai/api.json also returned 403 at times from WSL
  • All API endpoints (api.opencode.ai, gateway.opencode.ai) are reachable from WSL
  • Same auth.json key is used on both sides

Log excerpt

timestamp=2026-08-23T11:36:13.268Z level=ERROR message="stream error" providerID=opencode-go modelID=deepseek-v4-flash error.error="AI_APICallError: Forbidden" timestamp=2026-08-23T11:40:03.124Z level=ERROR message="Failed to fetch models.dev" cause="403 GET https://models.opencode.ai/api.json"

Expected behavior

WSL should work the same as Windows since they share the same network and account.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues reporting 403 Forbidden with the opencode-go provider. Please check:

    The WSL-vs-Windows discrepancy you describe may be a distinct angle (OS-level differences in HTTP headers, TLS fingerprint, or user-agent sent by the Linux binary), but the underlying AI_APICallError: Forbidden symptom is shared. It may be worth cross-referencing those issues and adding any relevant details there, or confirming if your issue is specifically reproducible only on WSL.

  2. EricYang2100 commented on Aug 23, 2026

    @EricYang2100
    Author

    Additional data point: WSL vs Windows discrepancy
    I have a possibly related but distinct case. Same machine, same public IP, same API key, same opencode version (1.18.18), but:

    Windows build: works fine
    WSL Linux build: intermittent AI_APICallError: Forbidden
    Environment
    WSL2 Ubuntu 22.04 (kernel 6.18.33.2) + Windows 10
    Public IP: 101.87.170.107 (confirmed identical for both)
    Provider: opencode-go (Go plan)
    OpenCode: 1.18.18 on both sides
    Evidence
    140 Forbidden errors in one day on WSL
    Affected models: deepseek-v4-flash (36), deepseek-v4-pro (18), deepseek-v4-flash-free (16), ox-alpha-free (3), big-pickle (2)
    Both opencode-go (57 errors) and opencode (20 errors) providers affected
    models.opencode.ai/api.json also returned 403 intermittently from WSL
    All endpoints are reachable from WSL (curl works)
    Key observation
    Since the public IP and API key are identical, this suggests the Forbidden may be related to something the Linux binary sends differently — possibly TLS fingerprint, User-Agent, or other HTTP headers that differ between the Windows and Linux builds.

    The error is intermittent on WSL — sometimes the same model works, sometimes it returns Forbidden.

  3. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions