Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test: require a catalog sync to fill a NULL Codex display_name (#731)

Alfredo Lopez0998e9917c50
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index aa041be5d..07501440f 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.605",
+ "version": "0.1.606",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.605",
+ "version": "0.1.606",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",
diff --git a/control-api/package.json b/control-api/package.json
index adeb0d846..0f2f7f103 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.605",
+ "version": "0.1.606",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/services.codexSubscriptionCatalog.realPostgres.integration.test.ts b/control-api/test/services.codexSubscriptionCatalog.realPostgres.integration.test.ts
index f8e8a0cb9..3b710050e 100644
--- a/control-api/test/services.codexSubscriptionCatalog.realPostgres.integration.test.ts
+++ b/control-api/test/services.codexSubscriptionCatalog.realPostgres.integration.test.ts
@@ -138,4 +138,47 @@ describeRealPostgres('Codex subscription catalog on real PostgreSQL', () => {
expect(silent.refreshed).toBe(1)
expect(await windows()).toEqual({ connection: [272_000], union: [272_000] })
})
+
+ it('T-R5-2 fills a NULL display_name on an existing row and keeps it when the catalog omits it', async () => {
+ const model = 'gpt-5.6-sol'
+ const sync = (models: CodexDiscoveredModel[]) =>
+ syncCodexSubscriptionCatalog(
+ pool,
+ {
+ async listModels() {
+ return { outcome: 'ready', models }
+ },
+ },
+ 'access-token'
+ )
+ const names = async () => {
+ const connection = await pool.query<{ display_name: string | null }>(
+ `SELECT display_name FROM codex_catalog_models WHERE model = $1`,
+ [model]
+ )
+ const union = await pool.query<{ display_name: string | null }>(
+ `SELECT display_name FROM llm_allowed_models
+ WHERE provider = 'codex-subscription' AND model = $1`,
+ [model]
+ )
+ return {
+ connection: connection.rows.map(row => row.display_name),
+ union: union.rows.map(row => row.display_name),
+ }
+ }
+
+ // Stored while the proxy dropped the name, as every existing row was.
+ expect((await sync([{ model }])).added).toBe(1)
+ expect(await names()).toEqual({ connection: [null], union: [null] })
+
+ // The catalog now supplies the name; the existing rows take the refresh path.
+ const supplied = await sync([{ model, displayName: 'GPT-5.6-Sol' }])
+ expect(supplied.refreshed).toBe(1)
+ expect(await names()).toEqual({ connection: ['GPT-5.6-Sol'], union: ['GPT-5.6-Sol'] })
+
+ // A later catalog without a name keeps the stored one.
+ const silent = await sync([{ model }])
+ expect(silent.refreshed).toBe(1)
+ expect(await names()).toEqual({ connection: ['GPT-5.6-Sol'], union: ['GPT-5.6-Sol'] })
+ })
})