Skip to content

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

TypeScript

fix: keep spend outcome ledger append only

Alfredo Lopezcd60355bf295
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 94060291c..7edd6bcee 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.415",
+ "version": "0.1.416",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.415",
+ "version": "0.1.416",
"dependencies": {
"@clerum/image-policy": "file:../packages/image-policy",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-api/package.json b/control-api/package.json
index 1100f0b3d..8977c62dc 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.415",
+ "version": "0.1.416",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/services/pluginWorkloadSdkFinalization.ts b/control-api/src/services/pluginWorkloadSdkFinalization.ts
index 86eb83ef3..c56b0f7d9 100644
--- a/control-api/src/services/pluginWorkloadSdkFinalization.ts
+++ b/control-api/src/services/pluginWorkloadSdkFinalization.ts
@@ -215,8 +215,7 @@ export async function finalizePromptBridgeInTransaction(
attempt_generation, attempt_index, target_ref, provider, model,
credential_slot, host_ref, outcome, input_tokens, output_tokens
FROM plugin_workload_sdk_spend_outcomes
- WHERE provider_attempt_id = $1
- FOR UPDATE`,
+ WHERE provider_attempt_id = $1`,
[input.providerAttemptId]
)
const existing = existingResult.rows[0] as SpendOutcomeRow | undefined
diff --git a/control-api/test/services.pluginWorkloadSdkFinalization.test.ts b/control-api/test/services.pluginWorkloadSdkFinalization.test.ts
index 1fa87ceab..b38acc5a6 100644
--- a/control-api/test/services.pluginWorkloadSdkFinalization.test.ts
+++ b/control-api/test/services.pluginWorkloadSdkFinalization.test.ts
@@ -125,6 +125,10 @@ describe('Plugin Workload SDK promptBridge finalization', () => {
const sql = db.query.mock.calls.map(([statement]: [string]) => statement).join('\n')
expect(sql).toContain('plugin_workload_sdk_spend_outcomes')
expect(sql).toContain('usage_request_id')
+ const spendLookup = db.query.mock.calls.find(([statement]: [string]) =>
+ statement.includes('FROM plugin_workload_sdk_spend_outcomes')
+ )
+ expect(spendLookup?.[0]).not.toMatch(/FOR UPDATE/i)
})
it('persists an explicit unknown spend outcome without inventing token counts', async () => {