Introduces src/common/lib/ai/ — a centralized AI SDK provider factory and intent-driven slot registry, as the foundation for Track 3: LLM Abstraction.
What's new:
providers.ts — AI SDK provider instances (groq, cerebras, gemini, vercel_gateway) with explicit API keys. Exports AIProviderSchema, AIModelConfigSchema, AISlotConfigSchema, and getLanguageModel()registry.ts — Slot-based config registry. Currently defines plan_reranker slot (cerebras primary + groq fallback). Resolution: code defaults ← LD flag overridewith_fallback.ts — withFallback(slot, fn) — centralized transient error detection (429/502/503/rate limit/resource_exhausted) and automatic provider cascading. Replaces ad-hoc fallback chainsindex.ts — Public API barrelSupporting changes:
planSearchRerankConfig LD flag (JSON, { primary, fallback } shape) — created via ldcli, not yet consumed by plan search codegetAISlotConfig() method to LaunchDarklyProvider for registry consumption@ai-sdk/google package for Gemini supportAI_GATEWAY_API_KEY env var for Vercel AI GatewayNo existing code paths or LD flags were modified. This is purely additive — the plan search reranker wiring is the next step.
pnpm check-types passes (zero errors in changed files)planSearchRerankConfig LD flag created with correct variations via ldcli flags getworkbenchSyntaxRepairConfig LD flag is untouched (original values confirmed)🤖 Generated with Claude Code
Based on git blame analysis of 9 file(s):
| Contributor | Contribution | Files |
|---|---|---|
| Zen Agent | 45% | 4 |
| jkomyno | 15% |
| 5 |
| Rahul Tarak | 10% | 4 |
| Himanshu Dixit | 8% | 4 |
| Utkarsh Dixit | 5% | 4 |
I recommend Abir Taheer — they made the most recent edits to the new AI library files in this PR (today) and will have the best context for those changes. As a second reviewer, Zen Agent is a good choice given recent edits to the large launchDarkly file and high overall contribution/recency across the repo.
🤖 Based on git blame with recency weighting (recent edits count more).
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
:x: Patch coverage is 13.93939% with 142 lines in your changes missing coverage. Please review.
| Flag | Coverage Δ | |
|---|---|---|
| e2e-tests | 5.82% <13.93%> (+<0.01%) | :arrow_up: |
| self-hosted-tests | 5.65% <13.93%> (+<0.01%) | :arrow_up: |
| thermos-service-isolation-tests | ? | |
| thermos-unit-tests | ? | |
| unit-tests | 58.71% <13.93%> (-0.06%) | :arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| apps/apollo/src/common/lib/ai/schemas.ts | 100.00% <100.00%> (ø) | |
| apps/apollo/src/env.ts | 94.35% <100.00%> (+0.02%) | :arrow_up: |
| ...mposio_actions/actions/toolRouter/syntax_repair.ts | 96.79% <ø> (ø) | |
| apps/apollo/src/common/lib/ai/index.ts | 0.00% <0.00%> (ø) | |
| apps/apollo/src/common/lib/ai/registry.ts | 0.00% <0.00%> (ø) | |
| ...pps/apollo/src/common/lib/external/launchDarkly.ts | 65.48% <16.66%> (-0.74%) |
... and 267 files with indirect coverage changes
| :arrow_down: |
| apps/apollo/src/common/lib/ai/providers.ts | 3.03% <3.03%> (ø) |
| apps/apollo/src/common/lib/ai/with_fallback.ts | 1.29% <1.29%> (ø) |