Skip to content

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

TypeScript

test(desktop): r2-m2 decouple grant policy from env defaults

Josuébd80fb280391
diff --git a/desktop-app/test/e2e-playwright/sdk-client-notification/sdkWorkloadFixture.ts b/desktop-app/test/e2e-playwright/sdk-client-notification/sdkWorkloadFixture.ts
index 6f49a728f..97acfa57a 100644
--- a/desktop-app/test/e2e-playwright/sdk-client-notification/sdkWorkloadFixture.ts
+++ b/desktop-app/test/e2e-playwright/sdk-client-notification/sdkWorkloadFixture.ts
@@ -35,6 +35,13 @@ if (MODEL_PROVIDER !== 'openai' && MODEL_PROVIDER !== 'claude') {
}
const CREDENTIAL_SLOT = process.env.E2E_WORKFLOW_CREDENTIAL_SLOT || `${MODEL_PROVIDER}-api-key`
+export const SDK_WORKLOAD_MODEL_CONFIG = {
+ targetRef: `primary-${MODEL_PROVIDER}`,
+ provider: MODEL_PROVIDER,
+ model: MODEL_NAME,
+ credentialSlot: CREDENTIAL_SLOT,
+} as const
+
function requireAdminPassword(): string {
const password =
process.env.E2E_ADMIN_PASSWORD ||
@@ -141,17 +148,10 @@ export async function createSdkWorkloadGrants(
recipeNamespace: RECIPE_NS,
recipeName,
capabilityFamily: 'promptBridge',
- provider: MODEL_PROVIDER,
- allowedModels: [MODEL_NAME],
- promptTargets: [
- {
- targetRef: `primary-${MODEL_PROVIDER}`,
- provider: MODEL_PROVIDER,
- model: MODEL_NAME,
- credentialSlot: CREDENTIAL_SLOT,
- },
- ],
- defaultTargetRef: `primary-${MODEL_PROVIDER}`,
+ provider: SDK_WORKLOAD_MODEL_CONFIG.provider,
+ allowedModels: [SDK_WORKLOAD_MODEL_CONFIG.model],
+ promptTargets: [SDK_WORKLOAD_MODEL_CONFIG],
+ defaultTargetRef: SDK_WORKLOAD_MODEL_CONFIG.targetRef,
allowedCallers,
quotaLimits: { maxRequestsPerRun: 3 },
}),
diff --git a/desktop-app/test/sdkWorkloadFixture.test.ts b/desktop-app/test/sdkWorkloadFixture.test.ts
index 613bb3713..34341a64d 100644
--- a/desktop-app/test/sdkWorkloadFixture.test.ts
+++ b/desktop-app/test/sdkWorkloadFixture.test.ts
@@ -1,5 +1,8 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { createSdkWorkloadGrants } from './e2e-playwright/sdk-client-notification/sdkWorkloadFixture'
+import {
+ SDK_WORKLOAD_MODEL_CONFIG,
+ createSdkWorkloadGrants,
+} from './e2e-playwright/sdk-client-notification/sdkWorkloadFixture'
type GrantRequest = {
allowedCallers: string[]
@@ -54,17 +57,10 @@ describe('createSdkWorkloadGrants', () => {
recipeNamespace: 'sandbox-recipes',
recipeName: 'recipe-default',
capabilityFamily: 'promptBridge',
- provider: 'openai',
- allowedModels: ['gpt-5.4-mini'],
- promptTargets: [
- {
- targetRef: 'primary-openai',
- provider: 'openai',
- model: 'gpt-5.4-mini',
- credentialSlot: 'openai-api-key',
- },
- ],
- defaultTargetRef: 'primary-openai',
+ provider: SDK_WORKLOAD_MODEL_CONFIG.provider,
+ allowedModels: [SDK_WORKLOAD_MODEL_CONFIG.model],
+ promptTargets: [SDK_WORKLOAD_MODEL_CONFIG],
+ defaultTargetRef: SDK_WORKLOAD_MODEL_CONFIG.targetRef,
allowedCallers: ['sdk-caller'],
quotaLimits: { maxRequestsPerRun: 3 },
},