Skip to content

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

TypeScript

fix(codex): enable minikube subscription lane and green Playwright gate

Alfredo Lopeza3ef4b501b47
diff --git a/Makefile b/Makefile
index 0d39e7835..94120c12f 100644
--- a/Makefile
+++ b/Makefile
@@ -1017,7 +1017,7 @@ test-e2e-codex-subscription-runtime: ## Codex subscription runtime acceptance (R
KUBECONTEXT=$(E2E_KUBECONTEXT) bash scripts/e2e/e2e-codex-subscription-runtime.sh
.PHONY: test-e2e-codex-subscription-playwright
-test-e2e-codex-subscription-playwright: ## Codex subscription Control UI guardians (4 specs; Desktop deferred until connected subscription)
+test-e2e-codex-subscription-playwright: ## Codex subscription Control UI guardians (5 tests; Desktop deferred until connected subscription)
@echo "Running Codex subscription Control UI Playwright guardians..."
@if [ -z "$${KUBECONTEXT:-$(E2E_KUBECONTEXT)}" ]; then \
echo "Refusing Codex subscription Playwright: explicit Kubernetes context is required" >&2; \
diff --git a/deploy/overlays/minikube/configmaps/codex-llm-proxy-config.yaml b/deploy/overlays/minikube/configmaps/codex-llm-proxy-config.yaml
new file mode 100644
index 000000000..70e191b83
--- /dev/null
+++ b/deploy/overlays/minikube/configmaps/codex-llm-proxy-config.yaml
@@ -0,0 +1,9 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: codex-llm-proxy-config
+ namespace: control-plane
+ labels:
+ app: codex-llm-proxy
+data:
+ CODEX_LLM_PROXY_EXECUTION_ENABLED: 'true'
diff --git a/deploy/overlays/minikube/configmaps/control-api-config.yaml b/deploy/overlays/minikube/configmaps/control-api-config.yaml
index 222e2dc7c..e9b7c1b47 100644
--- a/deploy/overlays/minikube/configmaps/control-api-config.yaml
+++ b/deploy/overlays/minikube/configmaps/control-api-config.yaml
@@ -99,5 +99,5 @@ data:
# it. Set the line below to 'false' to hide it explicitly.
# CONTROL_API_PUBLISHER_UI_ENABLED: 'false'
CLERUM_ATTACHMENT_MAX_BYTES: '52428800'
- CONTROL_API_CODEX_SUBSCRIPTION_ENABLED: 'false'
- CODEX_LLM_PROXY_EXECUTION_ENABLED: 'false'
+ CONTROL_API_CODEX_SUBSCRIPTION_ENABLED: 'true'
+ CODEX_LLM_PROXY_EXECUTION_ENABLED: 'true'
diff --git a/deploy/overlays/minikube/configmaps/mcp-host-config.yaml b/deploy/overlays/minikube/configmaps/mcp-host-config.yaml
index 80ba409a6..34f97cf2e 100644
--- a/deploy/overlays/minikube/configmaps/mcp-host-config.yaml
+++ b/deploy/overlays/minikube/configmaps/mcp-host-config.yaml
@@ -11,7 +11,7 @@ data:
CLERUM_CONTEXT_MAPPER_URL: 'http://host-context-controller-api-gateway.control-plane.svc.cluster.local:8081'
CLERUM_CONTEXT_MAPPER_POLL_INTERVAL: '30000'
MCP_PROXY_ENABLED: 'false'
- MCP_HOST_CODEX_SUBSCRIPTION_ENABLED: 'false'
+ MCP_HOST_CODEX_SUBSCRIPTION_ENABLED: 'true'
# e2e lane pin: 60s keeps the revoke-on-staleness scenario fast and
# deterministic. Production defaults to 180s (bounded 600s) in
# mcp-host/src/config.ts so a normal HCC rollout (~77s in clerum-dev) does not
diff --git a/deploy/overlays/minikube/kustomization.yaml b/deploy/overlays/minikube/kustomization.yaml
index 1a241eeda..de4b04935 100644
--- a/deploy/overlays/minikube/kustomization.yaml
+++ b/deploy/overlays/minikube/kustomization.yaml
@@ -108,4 +108,5 @@ patchesStrategicMerge:
patches:
# ConfigMap overrides: replace base values with minikube-specific config
- path: configmaps/control-api-config.yaml
+ - path: configmaps/codex-llm-proxy-config.yaml
- path: configmaps/channel-reader-config.yaml
diff --git a/scripts/e2e/e2e-codex-subscription-playwright.sh b/scripts/e2e/e2e-codex-subscription-playwright.sh
index f3e29f69a..7a485a567 100755
--- a/scripts/e2e/e2e-codex-subscription-playwright.sh
+++ b/scripts/e2e/e2e-codex-subscription-playwright.sh
@@ -58,9 +58,13 @@ wait_http() {
load_branch_profile_ports() {
local ctx="${KUBECONTEXT:-${MINIKUBE_PROFILE:-}}"
local ports_env="${CLERUM_PROFILE_PORTS_ENV:-${E2E_PROFILE_PORTS_ENV:-}}"
+ local urls_preconfigured=false
+ if [[ -n "${CONTROL_UI_URL:-${CONTROL_UI_BASE_URL:-}}" && -n "${CONTROL_API_URL:-${CONTROL_API_BASE_URL:-}}" ]]; then
+ urls_preconfigured=true
+ fi
if [[ "${ctx}" =~ ^clerum-(codex|detached)- ]] || [[ "${ctx}" =~ ^clerum-.+-[0-9a-f]{7,8}$ ]]; then
- if [[ -z "${ports_env}" ]]; then
- die "branch-owned context ${ctx} requires ports.env from branch-profile preflight; set CLERUM_PROFILE_PORTS_ENV or E2E_PROFILE_PORTS_ENV"
+ if [[ -z "${ports_env}" && "${urls_preconfigured}" != "true" ]]; then
+ die "branch-owned context ${ctx} requires ports.env from branch-profile preflight, or explicit CONTROL_UI_URL and CONTROL_API_URL"
fi
elif [[ -z "${ports_env}" && -n "${ctx}" ]]; then
ports_env="${HOME}/.cache/clerum/minikube-profiles/${ctx}/ports.env"
diff --git a/tests/e2e/playwright/control-ui/codex-subscription-workflow-recipe.spec.ts b/tests/e2e/playwright/control-ui/codex-subscription-workflow-recipe.spec.ts
index d7df3389f..5abf81c19 100644
--- a/tests/e2e/playwright/control-ui/codex-subscription-workflow-recipe.spec.ts
+++ b/tests/e2e/playwright/control-ui/codex-subscription-workflow-recipe.spec.ts
@@ -11,11 +11,10 @@
* API calls are limited to fixture setup/cleanup; the Codex template swap is UI-driven.
*/
import { expect, test } from '@playwright/test'
+import { adminSessionCookieHeader } from '../helpers/session-cookie'
import { loginControlUiVisible } from '../helpers/visible-login'
const BASE_API = process.env.CONTROL_API_URL ?? process.env.CONTROL_API_BASE_URL ?? ''
-const ADMIN_USERNAME = process.env.TEST_ADMIN_USERNAME ?? 'admin'
-const ADMIN_PASSWORD = process.env.TEST_ADMIN_PASSWORD ?? 'changeme123!'
const RECIPE_NS = 'sandbox-recipes'
const CODEX_TEMPLATE = 'Agentic Workflow (Codex Subscription)'
@@ -25,18 +24,13 @@ function uniqueRecipeName(): string {
return `e2e-codex-wr-${Date.now().toString(36)}`.slice(0, 63).replace(/-$/, '')
}
-async function api<T>(
- token: string,
- method: string,
- path: string,
- body?: unknown
-): Promise<ApiResult<T>> {
+async function api<T>(method: string, path: string, body?: unknown): Promise<ApiResult<T>> {
if (!BASE_API) throw new Error('CONTROL_API_URL is required for workflow-recipe fixture setup')
const response = await fetch(`${BASE_API}${path}`, {
method,
headers: {
- Authorization: `Bearer ${token}`,
- 'Content-Type': 'application/json',
+ ...adminSessionCookieHeader(),
+ ...(body === undefined ? {} : { 'Content-Type': 'application/json' }),
},
body: body === undefined ? undefined : JSON.stringify(body),
})
@@ -52,38 +46,22 @@ async function api<T>(
return { status: response.status, data, text }
}
-async function loginApiToken(): Promise<string> {
- const result = await api<{ token?: string }>('', 'POST', '/api/v1/admin/auth/login', {
- username: ADMIN_USERNAME,
- password: ADMIN_PASSWORD,
+async function createPlaceholderRecipe(name: string): Promise<void> {
+ const result = await api<{ metadata?: { name?: string } }>('POST', '/api/v1/admin/recipes', {
+ metadata: { name, namespace: RECIPE_NS },
+ spec: {
+ agent: { provider: 'codex-subscription', model: 'gpt-5.1' },
+ triggers: { onDemand: { requiresApproval: false, allowedActors: ['user'] } },
+ steps: [{ id: 'noop', instruction: 'Return ok.', timeoutSeconds: 60 }],
+ workloads: [],
+ },
})
- expect(result.status, result.text).toBe(200)
- expect(result.data.token, 'admin login must return a bearer token').toBeTruthy()
- return result.data.token!
-}
-
-async function createPlaceholderRecipe(token: string, name: string): Promise<void> {
- const result = await api<{ metadata?: { name?: string } }>(
- token,
- 'POST',
- '/api/v1/admin/recipes',
- {
- metadata: { name, namespace: RECIPE_NS },
- spec: {
- agent: { provider: 'zai', model: 'glm-4.7' },
- triggers: { onDemand: { requiresApproval: false, allowedActors: ['user'] } },
- steps: [{ id: 'noop', instruction: 'Return ok.', timeoutSeconds: 60 }],
- workloads: [],
- },
- }
- )
expect([200, 201], result.text).toContain(result.status)
expect(result.data.metadata?.name).toBe(name)
}
-async function deleteRecipe(token: string, name: string): Promise<void> {
+async function deleteRecipe(name: string): Promise<void> {
const result = await api<Record<string, unknown>>(
- token,
'DELETE',
`/api/v1/admin/recipes/${encodeURIComponent(name)}`
)
@@ -93,11 +71,14 @@ async function deleteRecipe(token: string, name: string): Promise<void> {
test.describe('Codex subscription workflow recipe authoring', () => {
test('operator can load a Codex subscription template without LLM secrets', async ({ page }) => {
test.skip(!BASE_API, 'CONTROL_API_URL is required for recipe fixture setup')
+ test.skip(
+ !process.env.PLAYWRIGHT_ADMIN_TOKEN,
+ 'admin session cookie missing; globalSetup must run first'
+ )
- const token = await loginApiToken()
const recipeName = uniqueRecipeName()
- await deleteRecipe(token, recipeName)
- await createPlaceholderRecipe(token, recipeName)
+ await deleteRecipe(recipeName)
+ await createPlaceholderRecipe(recipeName)
try {
// E2E_GUARDIAN_ENTRY_POINT
@@ -129,23 +110,12 @@ test.describe('Codex subscription workflow recipe authoring', () => {
await expect(manifest).toContainText('"provider": "codex-subscription"')
await expect(manifest).not.toContainText('secretRef')
- const validate = page.waitForResponse(
- response =>
- response.url().includes('/api/v1/admin/recipes/validate') &&
- response.request().method() === 'POST',
- { timeout: 30_000 }
- )
+ // L1 validation is client-side on "Review manifest"; server L2 runs only on deploy.
await page.getByRole('button', { name: 'Review manifest' }).click()
- const validateResponse = await validate
- expect(
- validateResponse.ok(),
- `server manifest validation must succeed, got ${validateResponse.status()}`
- ).toBe(true)
-
await expect(page.getByText(/Manifest review passed/)).toBeVisible({ timeout: 20_000 })
await expect(page.getByText(/must not declare an LLM secretRef/i)).toHaveCount(0)
} finally {
- await deleteRecipe(token, recipeName)
+ await deleteRecipe(recipeName)
}
})
})
diff --git a/tests/e2e/playwright/package-lock.json b/tests/e2e/playwright/package-lock.json
index d52deb104..fe1b86930 100644
--- a/tests/e2e/playwright/package-lock.json
+++ b/tests/e2e/playwright/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.24",
+ "version": "0.1.25",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-playwright-tests",
- "version": "0.1.24",
+ "version": "0.1.25",
"devDependencies": {
"@playwright/test": "^1.50.0",
"@types/node": "^22.0.0"
diff --git a/tests/e2e/playwright/package.json b/tests/e2e/playwright/package.json
index 30debefd9..c818479fa 100644
--- a/tests/e2e/playwright/package.json
+++ b/tests/e2e/playwright/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.24",
+ "version": "0.1.25",
"private": true,
"description": "Playwright E2E tests for Control UI and Desktop App",
"scripts": {
diff --git a/tests/e2e/playwright/playwright.codex-subscription.config.ts b/tests/e2e/playwright/playwright.codex-subscription.config.ts
index 5f14e86cd..f56a4b17e 100644
--- a/tests/e2e/playwright/playwright.codex-subscription.config.ts
+++ b/tests/e2e/playwright/playwright.codex-subscription.config.ts
@@ -7,6 +7,7 @@ const CONTROL_UI_URL =
export default defineConfig({
testDir: '.',
+ globalSetup: path.join(__dirname, 'global-setup.ts'),
timeout: 45_000,
expect: { timeout: 15_000 },
retries: 0,