feat(web): Add roadmap gate metrics and MCP-first fallback policy#452
feat(web): Add roadmap gate metrics and MCP-first fallback policy#452LucasSantana-Dev merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Code review (mandatory pass): Findings
Assumptions/Open questions
Summary
|
|
Caution Review failedPull request was closed or merged during review WalkthroughA new feature flag Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API as API Route<br/>(allowDirectProviderFallback)
participant MCP as MCP Gateway
participant Direct as Direct Provider
Client->>API: POST /api/generate
API->>API: Read ENABLE_MCP_DIRECT_PROVIDER_FALLBACK flag
alt allowDirectProviderFallback = true
API->>MCP: Route generation via MCP
alt MCP Success
MCP-->>API: Output stream
else MCP Failure
API->>Direct: Fallback: resolve default<br/>provider & model
Direct-->>API: Stream generation events
end
else allowDirectProviderFallback = false
API->>MCP: Route generation via MCP
alt MCP Success
MCP-->>API: Output stream
else MCP Failure
API-->>Client: Error response
end
end
API-->>Client: Final response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.16.3)apps/web/src/__tests__/lib/features/flags.test.ts┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m apps/web/src/__tests__/lib/services/provider-router.test.ts┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m apps/web/src/app/api/generate/route.ts┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Project Scorecard |



Supersedes #451 (branch update blocked by repository rule GH013).
Summary
GET /api/metricsfor:adoption.gate50)routing.mcp)ENABLE_MCP_DIRECT_PROVIDER_FALLBACKfeature flagfalserouteViaMcpsplit into helper functions to reduce cognitive complexity below gateWhy
Roadmap priorities require validation/adoption metrics and completion of WebApp->Gateway integration with MCP as the primary flow before broader Phase 2 expansion.
Testing
npm run lintnpm run type-checknpm run testnpm run buildnpm --workspace @siza/web test -- src/app/api/metrics/__tests__/route.test.ts src/__tests__/lib/services/provider-router.test.ts src/__tests__/lib/features/flags.test.tsSummary by CodeRabbit
New Features
Improvements