Commit d148e00
feat(coderd): seed ai_providers and ai_provider_keys from env at startup
Reconciles CODER_AIBRIDGE_PROVIDER_<N>_* (and the legacy single-provider
env vars) with the ai_providers / ai_provider_keys tables at server
startup. Runs on the AGPL startup codepath unconditionally so operators
can seed providers via env without enabling the bridge or proxy
features. Concurrent server starts are serialized via a Postgres
advisory lock; conflicts between env and DB fail startup with a clear
error. Soft-deleted rows are not resurrected; existing keys are not
duplicated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 00e8b40 commit d148e00
6 files changed
Lines changed: 812 additions & 1 deletion
File tree
- cli
- coderd
- database
- dbauthz
- enterprise/cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
862 | 863 | | |
863 | 864 | | |
864 | 865 | | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
865 | 887 | | |
866 | 888 | | |
867 | 889 | | |
| |||
0 commit comments