Repository navigation
feat: add Cloudflare Workers AI support - #934
Merged
Merged
Conversation
57 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cloudflare-workers-aiprovider as a complete registry-driven slice across Core, Runtime, Headless, Storage, CLI, and Desktop.@cf/...snapshot model IDs, deterministic two-stage tool/reasoning replay, and a Cloudflare-specific Account ID input.Why
Cloudflare Workers AI is a remaining Phase 3 provider in Refs #860. Its account-scoped endpoint, API token boundary, fallback model catalog, reasoning field, and model IDs need first-class ownership instead of being inferred from generic OpenAI compatibility.
Scope
This PR adds only Cloudflare Workers AI under persisted provider ID
cloudflare-workers-ai. It does not add acloudflarealias or migration, Cloudflare AI Gateway, Workers binding-only deployment, user-hosted endpoints, other providers, or Phase 7 contract work.Verification
npm test --workspace=@maka/core— passed.npm test --workspace=@maka/runtime— 1,521 passed, 7 skipped, 0 failed.npm test --workspace=@maka/desktop— 2,472 passed, 0 failed, including a11y/copy/console checks.npm run e2e --workspace=@maka/desktop -- --grep='adds Cloudflare Workers AI' --workers=1— passed; verifies the provider catalog/detail journey, Cloudflare Account ID input, derived account-scoped URL, exact model ID, token field, and theme-aware asset mask.npm run typecheck— all workspaces passed.node --test scripts/sync-model-metadata.test.mjs— 20 passed.npm run rebuild && npm run check:stale— full workspace build passed and dist is fresh.npm run build:renderer --workspace=@maka/desktop— passed; the byte-identical public third-party notice is present.e4302041fbb3039608d25f9f618bd462783b875e; SHA-256 is78f8973dad59f8af7c4042ef6be451d809a4e14bdb2151a75a76b4e0811fd22f.git diff --check origin/main...HEAD— passed.94bbacdfb56216ba256980c34814da9aba963bf3with 0 P0–P3 findings.No live credential smoke was run because no safe user-owned Cloudflare credential was available. The deterministic local HTTP conformance test verifies both authenticated tool-call turns without logging secrets or raw provider responses. No separate screenshot is attached because the visible change reuses the existing provider form row and governed logo treatment; the serial Playwright journey and computed mask/color contract are the stronger regression evidence.
Impact
Users can configure Cloudflare Workers AI with an Account ID and API token, select exact supported
@cf/...models, and run reasoning/tool workflows. Existing persisted provider IDs and connections are unchanged; there is no migration or alias.Reviewer notes
Cloudflare's current model search API is account-scoped, but its published generated response schema does not provide a stable model-ID contract, so discovery intentionally uses the checked-in models.dev snapshot fallback. The runtime adapter converts the SDK's assistant
reasoning_contentreplay to Cloudflare's documentedreasoningfield only for this provider.Ready for review
Verificationexplains why it is not applicable