Skip to content

feat(workers-ai): promote CF Workers AI to primary executor with full env-var config#74

Merged
stackbilt-admin merged 2 commits into
mainfrom
auto/feature/issue-72
Jun 24, 2026
Merged

feat(workers-ai): promote CF Workers AI to primary executor with full env-var config#74
stackbilt-admin merged 2 commits into
mainfrom
auto/feature/issue-72

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Closes #72

Summary

  • Wire WORKERS_AI_MODEL env var end-to-end: Env interface → buildEdgeEnvEdgeEnv.workersAiModelexecuteWorkersAi model resolver
  • Add WORKERS_AI_MODEL to wrangler.toml.example [vars] section with the default model (@cf/meta/llama-3.3-70b-instruct-fp8-fast) documented
  • Also commits the OTDD foundational work from this session: executor-router.contract.ts (Zod v4 contract with 6 semantic invariants) and executor-router-semantic.test.ts (19 tests covering DAG, tier ordering, env-override)
  • executor-router.ts: workers_ai route gains tier: 'free', isDefault: true, and env-driven model resolution
  • dispatch.ts: EdgeEnv.workersAiModel?: string added

Test plan

  • pnpm test in web/ — 1562 passed, 1 skipped (verified locally)
  • Semantic contract tests (S1–S10) all pass
  • Router tests for workers_ai routing all pass
  • Deploying with WORKERS_AI_MODEL set to a different model overrides the default at runtime

🤖 Generated with Claude Code

Aegis and others added 2 commits June 24, 2026 13:28
… 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>
@stackbilt-admin stackbilt-admin merged commit d63a904 into main Jun 24, 2026
1 of 2 checks passed
@stackbilt-admin stackbilt-admin deleted the auto/feature/issue-72 branch June 24, 2026 18:35
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.

feat(infra): add WORKERS_AI_MODEL env var for deploy-time CF model selection

1 participant