Skip to content

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

TypeScript

feat(codex): gate broker targets and conditional secrets

Alfredo Lopezb3fd49256580
diff --git a/charts/clerum-crds/crds/host.yaml b/charts/clerum-crds/crds/host.yaml
index 8599faceb..69ea59c14 100644
--- a/charts/clerum-crds/crds/host.yaml
+++ b/charts/clerum-crds/crds/host.yaml
@@ -27,7 +27,11 @@ spec:
required:
- host
- contextRef
- - secretRef
+ x-kubernetes-validations:
+ - rule: "(has(self.model) && self.model.provider == 'codex-subscription' && (!has(self.llmPolicy) || !has(self.llmPolicy.fallbacks) || !self.llmPolicy.fallbacks.exists(f, f.provider != 'codex-subscription'))) || (has(self.secretRef) && size(self.secretRef) > 0)"
+ message: spec.secretRef is required unless every LLM target is the Codex subscription broker
+ - rule: "!has(self.llmPolicy) || !has(self.llmPolicy.fallbacks) || !self.llmPolicy.fallbacks.exists(f, f.provider == 'codex-subscription' && has(f.credentialSlot))"
+ message: credentialSlot is not supported for oauth-broker providers
properties:
host:
type: string
@@ -41,7 +45,10 @@ spec:
description: Reference to the context (e.g. context1) used for MPC servers and secrets.
secretRef:
type: string
- description: Name of the Kubernetes Secret containing API keys (openai-api-key, claude-api-key, zai-api-key).
+ description: >-
+ Name of the Kubernetes Secret containing static LLM API keys.
+ Required when any primary or fallback target uses
+ static-credentials. Optional for a Codex-subscription-only Host.
channels:
type: array
description: List of CommunicationChannel names this host interacts with.
@@ -76,6 +83,7 @@ spec:
- novita
- minimax
- azure
+ - codex-subscription
description: LLM provider to use.
name:
type: string
@@ -192,6 +200,7 @@ spec:
- novita
- minimax
- azure
+ - codex-subscription
description: >-
Fallback LLM provider. Same enum as spec.model.provider.
model:
diff --git a/charts/clerum-crds/crds/workflowrecipe.yaml b/charts/clerum-crds/crds/workflowrecipe.yaml
index ec1bae3ab..15bbdac77 100644
--- a/charts/clerum-crds/crds/workflowrecipe.yaml
+++ b/charts/clerum-crds/crds/workflowrecipe.yaml
@@ -272,6 +272,9 @@ spec:
Default agent configuration for workflow execution, or the
provider/model bootstrap binding for a stepless
spec.pluginWorkloadSdk.promptBridge runtime.
+ x-kubernetes-validations:
+ - rule: "!has(self.provider) || self.provider == 'codex-subscription' || has(self.secretRef)"
+ message: spec.agent.secretRef is required for static-credentials providers
properties:
model:
type: string
@@ -284,7 +287,7 @@ spec:
# transport is mono-credential and cannot deliver Bedrock's key
# pair nor azure's required non-secret AZURE_OPENAI_ENDPOINT —
# fail at admission, not mid-workflow (see workflowService).
- enum: [openai, claude, zai, bailian, vertex, openrouter, gemini, deepseek, groq, together, fireworks, mistral, xai, cerebras, deepinfra, perplexity, moonshot, nebius, novita, minimax]
+ enum: [openai, claude, zai, bailian, vertex, openrouter, gemini, deepseek, groq, together, fireworks, mistral, xai, cerebras, deepinfra, perplexity, moonshot, nebius, novita, minimax, codex-subscription]
description: LLM provider.
secretRef:
type: object
@@ -558,7 +561,7 @@ spec:
# bedrock AND azure intentionally absent (mono-credential
# WRC transport; see the comment on the first llm provider
# enum above).
- enum: [openai, claude, zai, bailian, vertex, openrouter, gemini, deepseek, groq, together, fireworks, mistral, xai, cerebras, deepinfra, perplexity, moonshot, nebius, novita, minimax]
+ enum: [openai, claude, zai, bailian, vertex, openrouter, gemini, deepseek, groq, together, fireworks, mistral, xai, cerebras, deepinfra, perplexity, moonshot, nebius, novita, minimax, codex-subscription]
soul:
type: string
description: Per-step SOUL content override.
diff --git a/control-api/src/config.ts b/control-api/src/config.ts
index be5871cbc..97917cfe5 100644
--- a/control-api/src/config.ts
+++ b/control-api/src/config.ts
@@ -110,6 +110,9 @@ type Config = {
// llmCatalogSyncIntervalMs (default 24h), cross-replica-deduped by a session
// advisory lock inside the cron.
llmCatalogSyncCronEnabled: boolean
+ // Default OFF. Codex subscription management/admission stays dark until
+ // CONTROL_API_CODEX_SUBSCRIPTION_ENABLED=true.
+ codexSubscriptionEnabled: boolean
llmCatalogSyncIntervalMs: number
// §4.5 sanity guard, layer 3: absolute plausibility floor. If a LIVE run's
// TOTAL mapped model count is below this, the whole run SKIPS stale-marking
@@ -773,6 +776,9 @@ export const config: Config = {
// idiom used by the other crons. This one stays dark until an operator turns
// it on deliberately.
llmCatalogSyncCronEnabled: process.env.LLM_CATALOG_SYNC_CRON_ENABLED === 'true',
+ // Default OFF. Absent or any value other than the exact token `true` keeps
+ // Codex subscription management and admission dark.
+ codexSubscriptionEnabled: process.env.CONTROL_API_CODEX_SUBSCRIPTION_ENABLED === 'true',
// Default 24h. Validated (not merely parsed): the value goes straight into
// setInterval and each tick opens a Postgres transaction + advisory lock. A
// 60s floor is orders of magnitude below the default and far above a hot loop.
diff --git a/control-api/src/routes/admin/hostSpecValidation.ts b/control-api/src/routes/admin/hostSpecValidation.ts
index 3ed3a97d8..2f7bca67b 100644
--- a/control-api/src/routes/admin/hostSpecValidation.ts
+++ b/control-api/src/routes/admin/hostSpecValidation.ts
@@ -1,6 +1,7 @@
import { z } from 'zod'
import {
type LlmProviderId,
+ PROVIDER_AUTH_MODE,
PROVIDER_CREDENTIAL_SLOTS,
isLlmProviderId,
} from '@clerum/llm-providers'
@@ -50,6 +51,101 @@ function providerSupportsFallbackCredentialSlot(provider: LlmProviderId): boolea
return slots.length === 1 && !slots[0].multiline
}
+function isCodexSubscriptionEnabled(): boolean {
+ return process.env.CONTROL_API_CODEX_SUBSCRIPTION_ENABLED === 'true'
+}
+
+type HostLlmTarget = {
+ provider: string
+ field: string
+ credentialSlot?: unknown
+}
+
+function collectHostLlmTargets(spec: Record<string, unknown>): HostLlmTarget[] {
+ const targets: HostLlmTarget[] = []
+ if (isPlainObject(spec.model) && typeof spec.model.provider === 'string') {
+ targets.push({
+ provider: spec.model.provider.trim(),
+ field: 'spec.model.provider',
+ })
+ }
+ if (Array.isArray(spec.allowedModels)) {
+ spec.allowedModels.forEach((entry, i) => {
+ if (isPlainObject(entry) && typeof entry.provider === 'string') {
+ targets.push({
+ provider: entry.provider.trim(),
+ field: `spec.allowedModels[${i}].provider`,
+ })
+ }
+ })
+ }
+ if (isPlainObject(spec.llmPolicy) && Array.isArray(spec.llmPolicy.fallbacks)) {
+ spec.llmPolicy.fallbacks.forEach((entry, i) => {
+ if (!isPlainObject(entry) || typeof entry.provider !== 'string') return
+ targets.push({
+ provider: entry.provider.trim(),
+ field: `spec.llmPolicy.fallbacks[${i}].provider`,
+ credentialSlot: entry.credentialSlot,
+ })
+ })
+ }
+ return targets
+}
+
+function validateCodexBrokerAdmission(
+ spec: Record<string, unknown>
+): { errors: Array<{ field: string; message: string }> } | null {
+ const targets = collectHostLlmTargets(spec)
+ const enabled = isCodexSubscriptionEnabled()
+ for (const target of targets) {
+ if (target.provider !== 'codex-subscription') continue
+ if (!enabled) {
+ return {
+ errors: [
+ {
+ field: target.field,
+ message:
+ 'provider "codex-subscription" is disabled (set CONTROL_API_CODEX_SUBSCRIPTION_ENABLED=true)',
+ },
+ ],
+ }
+ }
+ if (target.credentialSlot !== undefined) {
+ return {
+ errors: [
+ {
+ field: target.field.replace('.provider', '.credentialSlot'),
+ message:
+ 'credentialSlot is not supported for oauth-broker providers; drop credentialSlot',
+ },
+ ],
+ }
+ }
+ }
+
+ const hasBroker = targets.some(
+ target =>
+ isLlmProviderId(target.provider) && PROVIDER_AUTH_MODE[target.provider] === 'oauth-broker'
+ )
+ const hasStatic = targets.some(
+ target =>
+ isLlmProviderId(target.provider) &&
+ PROVIDER_AUTH_MODE[target.provider] === 'static-credentials'
+ )
+ const secretRef = typeof spec.secretRef === 'string' ? spec.secretRef.trim() : ''
+ if (hasBroker && hasStatic && !secretRef) {
+ return {
+ errors: [
+ {
+ field: 'spec.secretRef',
+ message: 'spec.secretRef is required when any static-credentials LLM target is present',
+ },
+ ],
+ }
+ }
+ return null
+}
+
const HostApprovalSchema = z
.object({
defaultPolicy: z.string().optional(),
@@ -196,6 +292,9 @@ export async function validateHostSpec(
}
if (structuralErrors.length > 0) return { errors: structuralErrors }
+ const brokerErrors = validateCodexBrokerAdmission(spec)
+ if (brokerErrors) return brokerErrors
+
// No-worsening tolerance context (Pieza D), computed once and shared by the 3
// global-allowlist gates below. On create `context.stored` is absent, so
// `storedPairs` is empty and no gate can tolerate — a fresh spec may never
@@ -659,6 +758,16 @@ async function validateLlmPolicy(
// secret pair) or a multiline service-account JSON (Vertex) — those MUST
// reuse the primary's credentials. `provider` is already narrowed to a known
// LlmProviderId above, so the registry lookup is total.
+ if (PROVIDER_AUTH_MODE[provider] === 'oauth-broker') {
+ return {
+ errors: [
+ {
+ field: `${base}.credentialSlot`,
+ message: `${base}.credentialSlot is not supported for oauth-broker providers; drop credentialSlot`,
+ },
+ ],
+ }
+ }
if (!providerSupportsFallbackCredentialSlot(provider)) {
return {
errors: [
diff --git a/control-api/test/crd.llmProviderEnums.test.ts b/control-api/test/crd.llmProviderEnums.test.ts
index 0a8604030..54a2b889a 100644
--- a/control-api/test/crd.llmProviderEnums.test.ts
+++ b/control-api/test/crd.llmProviderEnums.test.ts
@@ -61,7 +61,7 @@ describe('LLM provider CRD enums', () => {
// spec.model.provider + spec.llmPolicy.fallbacks[].provider
expect(enums).toHaveLength(2)
for (const e of enums) {
- for (const id of [...NEW_SINGLE_KEY, 'azure']) {
+ for (const id of [...NEW_SINGLE_KEY, 'azure', 'codex-subscription']) {
expect(e).toContain(id)
}
// additive: original providers preserved
@@ -75,7 +75,7 @@ describe('LLM provider CRD enums', () => {
// the two WRC provider enums (model.provider + a second one ~line 543)
expect(enums).toHaveLength(2)
for (const e of enums) {
- for (const id of NEW_SINGLE_KEY) {
+ for (const id of [...NEW_SINGLE_KEY, 'codex-subscription']) {
expect(e).toContain(id)
}
// azure and bedrock must fail at admission (mono-credential WRC transport).
diff --git a/control-api/test/hostSpecValidation.codexSubscription.test.ts b/control-api/test/hostSpecValidation.codexSubscription.test.ts
new file mode 100644
index 000000000..1ff4faf25
--- /dev/null
+++ b/control-api/test/hostSpecValidation.codexSubscription.test.ts
@@ -0,0 +1,110 @@
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { dirname, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { parse } from 'yaml'
+import { validateHostSpec } from '../src/routes/admin/hostSpecValidation.js'
+
+const crdsDir = resolve(dirname(fileURLToPath(import.meta.url)), '../../charts/clerum-crds/crds')
+
+afterEach(() => {
+ delete process.env.CONTROL_API_CODEX_SUBSCRIPTION_ENABLED
+})
+
+describe('codex-subscription Host admission', () => {
+ it('rejects a Codex target when the management flag is absent or false', async () => {
+ const isModelAllowed = vi.fn().mockResolvedValue(true)
+ const res = await validateHostSpec(
+ { model: { provider: 'codex-subscription', name: 'gpt-5.1' } },
+ { isModelAllowed }
+ )
+ expect(res).not.toBeNull()
+ expect(res!.errors[0].message).toMatch(/disabled|not enabled/i)
+ expect(isModelAllowed).not.toHaveBeenCalled()
+ })
+
+ it('allows a Codex-only Host without secretRef when the flag is on', async () => {
+ process.env.CONTROL_API_CODEX_SUBSCRIPTION_ENABLED = 'true'
+ const isModelAllowed = vi.fn().mockResolvedValue(true)
+ const res = await validateHostSpec(
+ { model: { provider: 'codex-subscription', name: 'gpt-5.1' } },
+ { isModelAllowed }
+ )
+ expect(res).toBeNull()
+ })
+
+ it('requires secretRef when a Codex Host also has a static fallback', async () => {
+ process.env.CONTROL_API_CODEX_SUBSCRIPTION_ENABLED = 'true'
+ const isModelAllowed = vi.fn().mockResolvedValue(true)
+ const res = await validateHostSpec(
+ {
+ model: { provider: 'codex-subscription', name: 'gpt-5.1' },
+ llmPolicy: {
+ fallbacks: [{ provider: 'openai', model: 'gpt-5.4-mini' }],
+ },
+ },
+ { isModelAllowed }
+ )
+ expect(res).not.toBeNull()
+ expect(res!.errors[0].field).toBe('spec.secretRef')
+ })
+
+ it('rejects credentialSlot on a broker fallback', async () => {
+ process.env.CONTROL_API_CODEX_SUBSCRIPTION_ENABLED = 'true'
+ const isModelAllowed = vi.fn().mockResolvedValue(true)
+ const res = await validateHostSpec(
+ {
+ secretRef: 'llm-keys',
+ model: { provider: 'codex-subscription', name: 'gpt-5.1' },
+ llmPolicy: {
+ fallbacks: [
+ {
+ provider: 'codex-subscription',
+ model: 'gpt-5.1',
+ credentialSlot: 'openai-api-key',
+ },
+ ],
+ },
+ },
+ { isModelAllowed }
+ )
+ expect(res).not.toBeNull()
+ expect(res!.errors[0].field).toMatch(/credentialSlot/)
+ expect(res!.errors[0].message).toMatch(/broker|oauth|credentialSlot/i)
+ })
+})
+
+describe('codex-subscription CRD contract', () => {
+ it('makes secretRef optional and requires it via CEL for any static target', () => {
+ const doc = parse(readFileSync(resolve(crdsDir, 'host.yaml'), 'utf8')) as {
+ spec: {
+ versions: Array<{
+ schema: {
+ openAPIV3Schema: {
+ properties: {
+ spec: {
+ required?: string[]
+ 'x-kubernetes-validations'?: Array<{ rule: string; message: string }>
+ }
+ }
+ }
+ }
+ }>
+ }
+ }
+ const spec = doc.spec.versions[0].schema.openAPIV3Schema.properties.spec
+ expect(spec.required).not.toContain('secretRef')
+ const rules = spec['x-kubernetes-validations'] ?? []
+ expect(
+ rules.some(r => r.rule.includes('secretRef') && r.rule.includes('codex-subscription'))
+ ).toBe(true)
+ expect(rules.some(r => r.rule.includes('credentialSlot'))).toBe(true)
+ })
+
+ it('does not expose llm:codex:execute as a user-declarable CRD scope', () => {
+ for (const file of ['host.yaml', 'workflowrecipe.yaml']) {
+ const text = readFileSync(resolve(crdsDir, file), 'utf8')
+ expect(text).not.toMatch(/llm:codex:execute/)
+ }
+ })
+})
diff --git a/deploy/base/control-plane/configmaps.yaml b/deploy/base/control-plane/configmaps.yaml
index 695eb5655..d236d3cee 100644
--- a/deploy/base/control-plane/configmaps.yaml
+++ b/deploy/base/control-plane/configmaps.yaml
@@ -93,6 +93,8 @@ data:
# LLM catalog discovery sync cron (spec 09 Fase 4). Non-destructive; code
# default off. Interval + plausibility floors keep their code defaults.
LLM_CATALOG_SYNC_CRON_ENABLED: "true"
+ CONTROL_API_CODEX_SUBSCRIPTION_ENABLED: "false"
+ CODEX_LLM_PROXY_EXECUTION_ENABLED: "false"
---
apiVersion: v1
kind: ConfigMap
diff --git a/deploy/overlays/minikube/configmaps/control-api-config.yaml b/deploy/overlays/minikube/configmaps/control-api-config.yaml
index 3debe5d43..222e2dc7c 100644
--- a/deploy/overlays/minikube/configmaps/control-api-config.yaml
+++ b/deploy/overlays/minikube/configmaps/control-api-config.yaml
@@ -99,3 +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'
diff --git a/deploy/overlays/minikube/configmaps/mcp-host-config.yaml b/deploy/overlays/minikube/configmaps/mcp-host-config.yaml
index ebb02bb04..80ba409a6 100644
--- a/deploy/overlays/minikube/configmaps/mcp-host-config.yaml
+++ b/deploy/overlays/minikube/configmaps/mcp-host-config.yaml
@@ -11,6 +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'
# 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/host-context-controller/src/hostReconciler.ts b/host-context-controller/src/hostReconciler.ts
index ec5ecab59..afdba53a0 100644
--- a/host-context-controller/src/hostReconciler.ts
+++ b/host-context-controller/src/hostReconciler.ts
@@ -933,7 +933,7 @@ export class HostReconciler {
host.spec.secretRef,
`host-${host.name}-env-secret`,
mcpHostRuntimeTokenSecretName(host),
- ],
+ ].filter((name): name is string => Boolean(name)),
verbs: ['get', 'watch', 'list'],
},
],
@@ -1953,6 +1953,9 @@ export class HostReconciler {
}
async validateHostSecret(host: HostCRD): Promise<HostSecretValidationResult> {
+ if (!host.spec.secretRef) {
+ return { ok: true }
+ }
try {
await this.coreApi.readNamespacedSecret({
namespace: host.namespace,
@@ -2541,7 +2544,7 @@ export class HostReconciler {
},
{ name: 'CLERUM_WORKSPACE_PATH', value: workspacePath },
// Changing spec.secretRef changes the pod template and rolls the host.
- { name: 'CLERUM_LLM_SECRET_REF', value: host.spec.secretRef },
+ { name: 'CLERUM_LLM_SECRET_REF', value: host.spec.secretRef ?? '' },
// mcpHost runtime token env vars. Names match WRC's podFactory.ts so mcp-host
// sees the same shape regardless of which controller provisioned it.
{
diff --git a/host-context-controller/src/types.ts b/host-context-controller/src/types.ts
index 69d66fb56..409de28cd 100644
--- a/host-context-controller/src/types.ts
+++ b/host-context-controller/src/types.ts
@@ -430,7 +430,7 @@ export interface HostGuardrailsSpec {
export interface HostSpec {
host: string
contextRef: string
- secretRef: string
+ secretRef?: string
channels?: string[]
model?: HostModelSpec
approval?: Record<string, unknown>
diff --git a/mcp-host/src/config.ts b/mcp-host/src/config.ts
index 5852b2c11..d54a71fff 100644
--- a/mcp-host/src/config.ts
+++ b/mcp-host/src/config.ts
@@ -59,6 +59,9 @@ export interface Config {
// Dev mode: Model configuration from env vars
devModelProvider?: LlmProvider
devModelName?: string
+ // Default OFF. Codex provider construction stays dark until the operator
+ // sets MCP_HOST_CODEX_SUBSCRIPTION_ENABLED=true.
+ codexSubscriptionEnabled: boolean
// Dev mode: MCP servers (parsed from CLERUM_MCP_SERVERS JSON)
devMcpServers?: McpServerInfo[]
@@ -643,6 +646,7 @@ export const config: Config = {
// resolveDevModelProvider fail-closes on a set-but-invalid value.
devModelProvider: devMode ? resolveDevModelProvider(rawDevModelProvider) : undefined,
devModelName,
+ codexSubscriptionEnabled: process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED === 'true',
// Dev mode MCP servers
devMcpServers: devMode ? parseDevMcpServers() : undefined,
diff --git a/mcp-host/src/llm/__tests__/makeProvider.throws.test.ts b/mcp-host/src/llm/__tests__/makeProvider.throws.test.ts
index 0c4bead9d..85ce29296 100644
--- a/mcp-host/src/llm/__tests__/makeProvider.throws.test.ts
+++ b/mcp-host/src/llm/__tests__/makeProvider.throws.test.ts
@@ -38,9 +38,16 @@ describe('makeProvider — divergent provider without a factory', () => {
})
describe('makeProvider — Codex broker', () => {
- it('fails closed without runtime authorizer/proxy dependencies', () => {
+ it('fails closed when the execution flag is off', () => {
+ delete process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED
+ expect(() => makeProvider('codex-subscription', {})).toThrow(/is disabled/)
+ })
+
+ it('fails closed without runtime authorizer/proxy dependencies when the flag is on', () => {
+ process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED = 'true'
expect(() => makeProvider('codex-subscription', {})).toThrow(
/requires an explicit model and runtime authorizer/
)
+ delete process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED
})
})
diff --git a/mcp-host/src/llm/__tests__/registry.test.ts b/mcp-host/src/llm/__tests__/registry.test.ts
index c14eab7f7..3b89dc6de 100644
--- a/mcp-host/src/llm/__tests__/registry.test.ts
+++ b/mcp-host/src/llm/__tests__/registry.test.ts
@@ -221,9 +221,11 @@ describe('codex-subscription zero-slot broker', () => {
})
it('fails closed when constructing Codex without runtime dependencies', () => {
+ process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED = 'true'
expect(() => makeProvider('codex-subscription', {})).toThrow(
/requires an explicit model and runtime authorizer/
)
expect(createLLMProvider({}, { provider: 'codex-subscription', name: 'gpt-5.1' })).toBeNull()
+ delete process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED
})
})
diff --git a/mcp-host/src/llm/registry.ts b/mcp-host/src/llm/registry.ts
index 485327ab4..7ac9a66bc 100644
--- a/mcp-host/src/llm/registry.ts
+++ b/mcp-host/src/llm/registry.ts
@@ -79,6 +79,9 @@ export function makeProvider(
// below. Fails closed (throws) if the operator omitted the endpoint.
return new AzureOpenAIProvider(credentials[primarySlot(d).dataKey], model ?? d.defaultModel)
case 'codex-subscription':
+ if (process.env.MCP_HOST_CODEX_SUBSCRIPTION_ENABLED !== 'true') {
+ throw new Error('[LLM] makeProvider: codex-subscription is disabled')
+ }
throw new Error(
'[LLM] makeProvider: codex-subscription requires an explicit model and runtime authorizer/proxy dependencies'
)
diff --git a/mcp-host/src/types.ts b/mcp-host/src/types.ts
index b28383662..8f32a32e9 100644
--- a/mcp-host/src/types.ts
+++ b/mcp-host/src/types.ts
@@ -44,7 +44,7 @@ export interface HeartbeatConfig {
export interface HostSpec {
host: string
contextRef: string
- secretRef: string
+ secretRef?: string
channels?: string[]
model?: ModelConfig
/** Phase 6: Tool approval configuration. */
diff --git a/workflow-recipes/package-lock.json b/workflow-recipes/package-lock.json
index 2c4905226..03fe64109 100644
--- a/workflow-recipes/package-lock.json
+++ b/workflow-recipes/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.298",
+ "version": "0.1.299",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "workload-recipes-controller",
- "version": "0.1.298",
+ "version": "0.1.299",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@aws-sdk/client-s3": "^3.1009.0",
diff --git a/workflow-recipes/package.json b/workflow-recipes/package.json
index 81a015220..921d36a8e 100644
--- a/workflow-recipes/package.json
+++ b/workflow-recipes/package.json
@@ -1,6 +1,6 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.298",
+ "version": "0.1.299",
"description": "Workload Recipes Controller (WRC) - WorkloadRecipe lifecycle management and MCP server interface",
"main": "dist/main.js",
"engines": {
diff --git a/workflow-recipes/src/types.test.ts b/workflow-recipes/src/types.test.ts
index d15ab04e8..a8f6147a5 100644
--- a/workflow-recipes/src/types.test.ts
+++ b/workflow-recipes/src/types.test.ts
@@ -14,6 +14,7 @@ import {
type WebhookVerificationScheme,
type WorkflowRecipeCRD,
type WorkflowRecipePolicySpec,
+ type WorkflowRecipeSpec,
type WorkflowRecipeStatus,
type WorkloadDef,
type WorkloadStatus,
@@ -579,3 +580,16 @@ describe('OAuthClientDef shape (O1.1)', () => {
expect(crd.spec.oauthClients?.[0].provider).toBe('salesforce')
})
})
+
+describe('codex-subscription agent', () => {
+ it('allows a Codex-only agent without secretRef', () => {
+ const spec: WorkflowRecipeSpec = {
+ agent: {
+ model: 'gpt-5.1',
+ provider: 'codex-subscription',
+ },
+ }
+ expect(spec.agent?.secretRef).toBeUndefined()
+ expect(spec.agent?.provider).toBe('codex-subscription')
+ })
+})