Skip to content

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

TypeScript

test(control-api): bind real-Postgres Codex attempts to a grant

Alfredo Lopez36fda96ca114
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index fa2a61081..ab31d8f4d 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.510",
+ "version": "0.1.511",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.510",
+ "version": "0.1.511",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/control-api/package.json b/control-api/package.json
index 2dcc55800..fedc85b94 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.510",
+ "version": "0.1.511",
"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.llmProviderAttemptFinalization.realPostgres.integration.test.ts b/control-api/test/services.llmProviderAttemptFinalization.realPostgres.integration.test.ts
index 3c9b4c64f..3ae69065d 100644
--- a/control-api/test/services.llmProviderAttemptFinalization.realPostgres.integration.test.ts
+++ b/control-api/test/services.llmProviderAttemptFinalization.realPostgres.integration.test.ts
@@ -36,6 +36,7 @@ describeRealPostgres('Codex attempt finalization on real PostgreSQL', () => {
)
let adminPool: Pool
let pool: Pool
+ let connectionId: string
async function runTx<T>(work: (tx: Pool) => Promise<T>): Promise<T> {
const client = await pool.connect()
@@ -72,12 +73,13 @@ describeRealPostgres('Codex attempt finalization on real PostgreSQL', () => {
await adminPool.query(`CREATE DATABASE ${quoteIdent(database)}`)
pool = new Pool({ connectionString })
await initDb({ connect: () => pool.connect() })
- await insertInitialCodexSubscriptionConnection(pool, KEY, {
+ const connection = await insertInitialCodexSubscriptionConnection(pool, KEY, {
refreshToken: 'refresh-secret',
accessToken: 'access-usable',
chatgptAccountId: 'acct_test_1',
accountFingerprint: 'fp-final',
})
+ connectionId = connection.id
}, 60_000)
afterAll(async () => {
@@ -103,6 +105,7 @@ describeRealPostgres('Codex attempt finalization on real PostgreSQL', () => {
policyHash: 'e'.repeat(64),
budgetReservationId: 'unbudgeted',
connectionRevision: 1,
+ connectionId,
})
const issued = await issueRegisteredCodexExecutionTicket(pool, {
sub: 'host/research-host',
diff --git a/control-api/test/services.llmProviderAttemptRedemption.realPostgres.integration.test.ts b/control-api/test/services.llmProviderAttemptRedemption.realPostgres.integration.test.ts
index d061e4561..e9fc99234 100644
--- a/control-api/test/services.llmProviderAttemptRedemption.realPostgres.integration.test.ts
+++ b/control-api/test/services.llmProviderAttemptRedemption.realPostgres.integration.test.ts
@@ -35,6 +35,7 @@ describeRealPostgres('Codex ticket redemption on real PostgreSQL', () => {
)
let adminPool: Pool
let pool: Pool
+ let connectionId: string
beforeAll(async () => {
config.codexSubscriptionEnabled = true
@@ -43,12 +44,13 @@ describeRealPostgres('Codex ticket redemption on real PostgreSQL', () => {
await adminPool.query(`CREATE DATABASE ${quoteIdent(database)}`)
pool = new Pool({ connectionString })
await initDb({ connect: () => pool.connect() })
- await insertInitialCodexSubscriptionConnection(pool, KEY, {
+ const connection = await insertInitialCodexSubscriptionConnection(pool, KEY, {
refreshToken: 'refresh-secret',
accessToken: 'access-usable',
chatgptAccountId: 'acct_test_1',
accountFingerprint: 'fp-redeem',
})
+ connectionId = connection.id
}, 60_000)
afterAll(async () => {
@@ -74,6 +76,7 @@ describeRealPostgres('Codex ticket redemption on real PostgreSQL', () => {
policyHash: 'e'.repeat(64),
budgetReservationId: 'unbudgeted',
connectionRevision: 1,
+ connectionId,
})
const issued = await issueRegisteredCodexExecutionTicket(pool, {
sub: 'host/research-host',