Skip to content

V2 Workers AI ignores saved account ID when resolving the catalog endpoint #48404

Description

@pkyanam

Description

V2 still requires CLOUDFLARE_ACCOUNT_ID when a Workers AI credential already contains configuration.accountId. The catalog URL contains ${CLOUDFLARE_ACCOUNT_ID}; the native OpenAI-compatible mapping does not substitute the saved account ID before endpoint validation. Initialization fails before any Cloudflare request.

The same failure occurs with providers.cloudflare-workers-ai.settings.accountId and legacy credential metadata. Setting the service environment variable works around it. Related closed proposals: #41615 and #40907.

Plugins

Built-in Cloudflare Workers AI provider.

OpenCode version

Observed on opencode2 v0.0.0-beta-19425; reproduced with a resolver regression test on current v2.

Steps to reproduce

  1. Connect Workers AI with an API token and saved account ID, or configure providers.cloudflare-workers-ai.settings.accountId.
  2. Leave CLOUDFLARE_ACCOUNT_ID unset in the server environment.
  3. Select cloudflare-workers-ai/@cf/deepseek-ai/deepseek-v4-flash-0731 and send a message.
  4. Observe CLOUDFLARE_ACCOUNT_ID is required to resolve the provider endpoint despite the saved account setting.

Screenshot and/or share link

Reproduced in a local automated resolver test; no session shared.

Operating System

macOS 26.6.2, arm64.

Terminal

Noninteractive CLI reproduction.

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions