Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-ui): block plugin install until a required agent is resolved
Andy Paviacc54b2aece99
diff --git a/control-ui/app/registry/install/page.tsx b/control-ui/app/registry/install/page.tsxindex 74fbc69a1..b72c0f37b 100644--- a/control-ui/app/registry/install/page.tsx+++ b/control-ui/app/registry/install/page.tsx@@ -259,12 +259,18 @@ function RegistryRecipeInstallPreview({? (validation?.issues.filter(issue => issue.severity === 'error') ?? []): []const egressErrors = egressFindings.filter(finding => finding.severity === 'error')+ // A promptBridge recipe must resolve an agent before install, or it fails+ // after install. When the recipe's allowedModels[0] is not in the operator+ // catalog, providerForModel() returns '' and no spec.agent is injected — so+ // block the submit until a provider + model are actually chosen.+ const agentReady = !agentReq.needsAgent || (Boolean(agentProvider) && Boolean(agentModel))const canInstall =recipeText.length > 0 &&!parseResult.error &&validationErrors.length === 0 &&egressErrors.length === 0 &&!egressEditError &&+ agentReady &&!submittingconst canContinue = step === 0 ? Boolean(recipeText.trim()) && !parseResult.error : canInstalldiff --git a/control-ui/components/__tests__/RegistryInstallPage.test.tsx b/control-ui/components/__tests__/RegistryInstallPage.test.tsxindex ebf3744be..95bb60bd3 100644--- a/control-ui/components/__tests__/RegistryInstallPage.test.tsx+++ b/control-ui/components/__tests__/RegistryInstallPage.test.tsx@@ -235,6 +235,59 @@ describe('RegistryInstallPage — WorkflowRecipe preview egress editor', () => {expect(manifest.spec.agent).toEqual({ provider: 'openai', model: 'gpt-4o-mini' })})+ it('keeps Install blocked when the promptBridge model is not in the operator catalog', async () => {+ // Finding A: allowedModels is author-controlled, not constrained to the+ // operator catalog. An unlisted model resolves to no provider, so no+ // spec.agent is injected — Install must stay disabled, not submit a manifest+ // that fails after install.+ const unlistedEntry: RegistryEntry = {+ ...RECIPE_ENTRY,+ recipe_meta: {+ recipeYaml: JSON.stringify(+ {+ apiVersion: 'clerum.io/v1alpha1',+ kind: 'WorkflowRecipe',+ metadata: { name: 'market-report' },+ spec: {+ triggers: { onDemand: { requiresApproval: false, allowedActors: ['user'] } },+ pluginWorkloadSdk: {+ allowedCallers: ['orchestrator'],+ promptBridge: { allowedModels: ['unlisted-model'], maxOutputTokens: 4096 },+ },+ workloads: [+ {+ id: 'web-search',+ type: 'deployment',+ image: 'clerum/web-search:test',+ port: 3000,+ transport: { type: 'streamableHttp', path: '/mcp' },+ },+ ],+ steps: [+ {+ id: 'research',+ run: { type: 'snippet', language: 'typescript', code: 'return { ok: true }' },+ },+ ],+ },+ },+ null,+ 2+ ),+ },+ }+ vi.mocked(getRegistryEntryVersion).mockResolvedValueOnce(unlistedEntry)++ render(<RegistryInstallPage />)++ // Model prefills from the recipe, but the provider can't be derived (unlisted).+ expect(await screen.findByLabelText('Model')).toHaveValue('unlisted-model')+ fireEvent.click(screen.getByRole('button', { name: 'Continue' })) // Package -> Security+ // Security -> Install is gated on a resolved agent, so it stays disabled.+ expect(await screen.findByRole('button', { name: 'Continue' })).toBeDisabled()+ expect(installRecipeFromRegistry).not.toHaveBeenCalled()+ })+it('blocks registry recipe install when edited egress exceeds CRD cardinality', async () => {vi.mocked(getRegistryEntryVersion).mockResolvedValueOnce(RECIPE_ENTRY)render(<RegistryInstallPage />)diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 7f8a779cb..95845edfe 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.376",+ "version": "0.1.377","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.376",+ "version": "0.1.377","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 09b3b17e4..9a03b3d58 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.376",+ "version": "0.1.377","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",