Skip to content

Add database mirrors for AI gateway state - #5965

Merged
chrarnoldus merged 2 commits into
mainfrom
add-ai-gateway-database-state
Sep 8, 2026
Merged

Add database mirrors for AI gateway state#5965
chrarnoldus merged 2 commits into
mainfrom
add-ai-gateway-database-state

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • add singleton PostgreSQL tables for gateway routing config, provider-sync timestamps, and request-logging opt-ins
  • dual-write successful Redis mutations to the corresponding database tables
  • preserve all existing Redis reads and writes during the migration period
  • retain both provider-sync timestamps in one database row without overwriting the other column

Commits

  1. 566af05d3 adds the schema and generated migration only
  2. 537e95845 adds application dual-writes only

Verification

  • pnpm --filter @kilocode/db typecheck
  • pnpm --filter web typecheck
  • pnpm --filter @kilocode/db lint
  • pnpm --filter web lint
  • formatting with oxfmt
  • git diff --check

Test suites were intentionally left to CI.

@chrarnoldus chrarnoldus self-assigned this Sep 8, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • apps/web/src/lib/ai-gateway/providers/openrouter/sync-providers-stale-alert.ts
  • apps/web/src/lib/ai-gateway/providers/openrouter/sync-providers.ts
  • apps/web/src/lib/ai-gateway/request-logging-opt-ins.ts
  • apps/web/src/routers/admin/gateway-config-router.ts
  • packages/db/src/migrations/0238_dizzy_namora.sql
  • packages/db/src/migrations/meta/0238_snapshot.json
  • packages/db/src/migrations/meta/_journal.json
  • packages/db/src/schema.ts

Reviewed by grok-4.6 · Input: 224.7K · Output: 16.5K · Cached: 1M

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit 1dd0057 into main Sep 8, 2026
53 checks passed
@chrarnoldus
chrarnoldus deleted the add-ai-gateway-database-state branch September 8, 2026 12:23
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.

2 participants