Skip to content

fix(core): resolve Cloudflare account endpoints - #41615

Open
rekram1-node wants to merge 3 commits into
v2from
cloudflare-runtime
Open

fix(core): resolve Cloudflare account endpoints#41615
rekram1-node wants to merge 3 commits into
v2from
cloudflare-runtime

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route Cloudflare Workers AI catalog models through the native Cloudflare provider
  • remove models.dev account URL templates during catalog projection
  • pass the current /connect account ID as a provider option on every model resolution

Why

The initial version rebuilt the catalog after connection changes. Review showed that approach introduced a debounce window, stale credential/config state, and ordering problems with later config overlays.

This version keeps the catalog transform static. It selects the native provider and removes only the models.dev ${CLOUDFLARE_ACCOUNT_ID} template. ModelResolver already overlays the active credential configuration at call time, and the native provider derives the endpoint from accountId. No connection listener, catalog reload, semaphore, or plugin-owned credential state is required.

Precedence

  • explicit configured baseURL is preserved
  • CLOUDFLARE_ACCOUNT_ID produces a concrete environment endpoint
  • otherwise active /connect configuration overlays provider/model accountId settings at runtime

Scope

Cloudflare Workers AI only. This is the test case for evaluating native provider-option routing before applying a pattern elsewhere.

Testing

  • Core full suite: 1,632 passed, 16 skipped
  • Cloudflare AI package tests: 11 passed
  • focused Core resolver/models.dev/Cloudflare/error tests: 49 passed
  • Core and AI package typechecks
  • repository typecheck: 33 tasks passed

The full AI suite currently has nine unrelated baseline failures in existing Azure, OpenRouter, and Bedrock tests; all Cloudflare tests pass.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant