feat(workers-ai): promote CF Workers AI to primary executor with full env-var config#74
Merged
Merged
Conversation
… env-var config (closes #72) - Add executor-router.contract.ts: Zod v4 contract with ExecutorTier, fallback DAG validation, single-default invariant, and placeholder isolation guards (OTDD semantic contract) - Add executor-router-semantic.test.ts: 19 tests across S1–S10 covering schema parse, acyclic DAG, cost-downgrade invariant, anthropic resilience, free-tier terminal, and env-override behavior - Extend ExecutorRoute with tier/isDefault/placeholder/fallback fields; mark workers_ai as isDefault:true with env-driven model override (OTDD refactor) - Wire WORKERS_AI_MODEL env var end-to-end: Env interface → buildEdgeEnv → EdgeEnv.workersAiModel → executeWorkersAi and executor-router model resolver - Add WORKERS_AI_MODEL to wrangler.toml.example [vars] section with default model documented Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…align || vs ??, fix I5/I6 ordering, add buildEdgeEnv integration tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Closes #72
Summary
WORKERS_AI_MODELenv var end-to-end:Envinterface →buildEdgeEnv→EdgeEnv.workersAiModel→executeWorkersAimodel resolverWORKERS_AI_MODELtowrangler.toml.example[vars]section with the default model (@cf/meta/llama-3.3-70b-instruct-fp8-fast) documentedexecutor-router.contract.ts(Zod v4 contract with 6 semantic invariants) andexecutor-router-semantic.test.ts(19 tests covering DAG, tier ordering, env-override)executor-router.ts:workers_airoute gainstier: 'free',isDefault: true, and env-driven model resolutiondispatch.ts:EdgeEnv.workersAiModel?: stringaddedTest plan
pnpm testinweb/— 1562 passed, 1 skipped (verified locally)WORKERS_AI_MODELset to a different model overrides the default at runtime🤖 Generated with Claude Code