Skip to content

Comments

Store list of Vercel / user byok providers in the database#513

Merged
chrarnoldus merged 13 commits intomainfrom
christiaan/vercel-providers
Feb 25, 2026
Merged

Store list of Vercel / user byok providers in the database#513
chrarnoldus merged 13 commits intomainfrom
christiaan/vercel-providers

Conversation

@chrarnoldus
Copy link
Contributor

No description provided.

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 24, 2026

Code Review Summary

Status: 2 Open Suggestions | Recommendation: Consider before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Open Suggestions (click to expand)

SUGGESTION

File Line Issue
src/lib/providers/openrouter/sync-providers.ts 38 Promise.all rejects on first failure — a single flaky endpoint request aborts the entire sync. Consider Promise.allSettled or per-model error handling to allow partial results.
src/lib/providers/openrouter/sync-providers.ts 42 Model IDs containing / (e.g. anthropic/claude-3.5-sonnet) are interpolated directly into the URL path, producing .../models/anthropic/claude-3.5-sonnet/endpoints instead of treating the full ID as a single path segment. Consider encodeURIComponent(model.id) if the API expects a single segment.
Previous Review Issues — Now Resolved ✅

The following issues from earlier review rounds have been addressed:

File Issue Status
sync-providers.ts Missing HTTP response status check on modelsResponse ✅ Fixed (line 31)
sync-providers.ts Sequential API calls (was for...of loop) ✅ Fixed (now uses pLimit(8) + Promise.all)
sync-providers.ts Missing HTTP response status check on endpointsResponse ✅ Fixed (line 46)
sync-providers.ts Wrong variable modelsResponse.status in error message ✅ Fixed (now uses endpointsResponse.status)
sync-providers.ts Transaction callback missing tx parameter ✅ Fixed (line 427 now receives and uses tx)
Other Observations (not in diff)
File Line Observation
src/lib/providers/openrouter/sync-providers.ts 414-417 The three independent async calls (fetchGatewayModels(OPENROUTER), fetchGatewayModels(VERCEL), syncProviders()) run sequentially. They could be parallelized with Promise.all to reduce total sync time.
Files Reviewed (5 files)
  • src/db/schema.ts — 0 issues (new nullable openrouter and vercel jsonb columns added correctly)
  • src/lib/providers/openrouter/sync-providers.ts — 2 open suggestions
  • src/lib/providers/vercel/types.ts — 0 issues (new file, clean Zod schemas)
  • src/lib/providers/vercel/index.ts — 0 issues (renamed from vercel.ts)
  • src/db/migrations/0031_polite_warpath.sql — 0 issues (generated migration)

Fix these issues in Kilo Cloud

@chrarnoldus chrarnoldus marked this pull request as draft February 24, 2026 19:55
@chrarnoldus chrarnoldus force-pushed the christiaan/vercel-providers branch from 8f774c0 to e948f23 Compare February 25, 2026 08:57
@chrarnoldus chrarnoldus marked this pull request as ready for review February 25, 2026 09:07
@chrarnoldus chrarnoldus merged commit b4cbfca into main Feb 25, 2026
12 checks passed
@chrarnoldus chrarnoldus deleted the christiaan/vercel-providers branch February 25, 2026 09:07
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.

3 participants