Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-ui): verify stateless host creation
Alfredo Lopezd74204fb2ca3
diff --git a/control-ui/components/HostWizard/index.tsx b/control-ui/components/HostWizard/index.tsxindex d9af0dc3d..04a01edeb 100644--- a/control-ui/components/HostWizard/index.tsx+++ b/control-ui/components/HostWizard/index.tsx@@ -67,11 +67,6 @@ import {} from './constants'import type { CreatedResource, HostWizardProps, HostWizardValidationState } from './types'-// Stateless agents can now be created from the wizard. The API and HCC-// lifecycle support were already in place; this flag gates the operator-facing-// type selector during the incremental rollout.-const SHOW_STATELESS_AGENT_SELECTOR = true-// Asymmetric save gate (spec Topic 1b): the PRIMARY provider must be usable —// its required credential slot(s) filled — before create is allowed. Fallbacks// are optional and only warn, so they never enter this gate.@@ -978,50 +973,48 @@ export function HostWizard({</span></div><div className="cu-agent-namespace">Namespace: {HOST_NAMESPACE}</div>- {SHOW_STATELESS_AGENT_SELECTOR ? (- <div className="cu-agent-access-section">- <strong id="agent-type-label">Agent type</strong>- <span className="cu-muted cu-agent-access-hint">- Stateless agents suspend after the idle window and wake on demand. Communication- channels keep stateless agents always-on unless the cluster explicitly enables- wake-on-interaction; desktop still requires a stateful agent.- </span>- <div- className="cu-agent-radio-group"- role="radiogroup"- aria-labelledby="agent-type-label"- >- <label className="cu-agent-radio cu-agent-radio--card">- <input- type="radio"- name="agent-type"- checked={!stateless}- onChange={() => setStateless(false)}- />- <span className="cu-agent-radio__copy">- <span className="cu-agent-radio__title">Stateful (always on)</span>- <span className="cu-agent-radio__description">- The agent keeps running continuously and responds immediately.- </span>+ <div className="cu-agent-access-section">+ <strong id="agent-type-label">Agent type</strong>+ <span className="cu-muted cu-agent-access-hint">+ Stateless agents suspend after the idle window and wake on demand. Communication+ channels currently keep an agent always-on, and desktop agents still require a+ stateful agent.+ </span>+ <div+ className="cu-agent-radio-group"+ role="radiogroup"+ aria-labelledby="agent-type-label"+ >+ <label className="cu-agent-radio cu-agent-radio--card">+ <input+ type="radio"+ name="agent-type"+ checked={!stateless}+ onChange={() => setStateless(false)}+ />+ <span className="cu-agent-radio__copy">+ <span className="cu-agent-radio__title">Stateful (always on)</span>+ <span className="cu-agent-radio__description">+ The agent keeps running continuously and responds immediately.</span>- </label>- <label className="cu-agent-radio cu-agent-radio--card">- <input- type="radio"- name="agent-type"- checked={stateless}- onChange={() => setStateless(true)}- />- <span className="cu-agent-radio__copy">- <span className="cu-agent-radio__title">Stateless (suspends when idle)</span>- <span className="cu-agent-radio__description">- The platform suspends the agent when idle and wakes it on demand.- </span>+ </span>+ </label>+ <label className="cu-agent-radio cu-agent-radio--card">+ <input+ type="radio"+ name="agent-type"+ checked={stateless}+ onChange={() => setStateless(true)}+ />+ <span className="cu-agent-radio__copy">+ <span className="cu-agent-radio__title">Stateless (suspends when idle)</span>+ <span className="cu-agent-radio__description">+ The platform suspends the agent when idle and wakes it on demand.</span>- </label>- </div>+ </span>+ </label></div>- ) : null}+ </div></div>)}diff --git a/control-ui/components/__tests__/HostWizard.test.tsx b/control-ui/components/__tests__/HostWizard.test.tsxindex 3a1460c43..1805ce903 100644--- a/control-ui/components/__tests__/HostWizard.test.tsx+++ b/control-ui/components/__tests__/HostWizard.test.tsx@@ -868,6 +868,24 @@ describe('HostWizard — Agent type (stateless lifecycle)', () => {expect('lifecycle' in payload.spec).toBe(false)expect('workflowControl' in payload.spec).toBe(false)})++ it('sends spec.lifecycle.stateless when Stateless is selected', async () => {+ await renderWizard()+ fireEvent.click(screen.getByRole('radio', { name: /Stateless \(suspends when idle\)/i }))+ await walkToAccessStep({ agentName: 'stateless-agent' })+ continueToConnectorsStep()+ submitFromConnectorsStep()++ await waitFor(() => {+ expect(api.apiSend).toHaveBeenCalledWith('POST', '/api/v1/admin/hosts', expect.any(Object))+ })+ const hostCall = vi+ .mocked(api.apiSend)+ .mock.calls.find(call => call[0] === 'POST' && call[1] === '/api/v1/admin/hosts')+ expect(hostCall).toBeDefined()+ const payload = hostCall![2] as { spec: { lifecycle?: { stateless?: boolean } } }+ expect(payload.spec.lifecycle).toEqual({ stateless: true })+ })})describe('HostWizard — create-only seam + compensation (R5-C1/R5-B1, V-1, V-7)', () => {diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 6a11d5f01..a7466dcb2 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.654",+ "version": "0.1.655","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.654",+ "version": "0.1.655","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 956a113f2..349558be4 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.654",+ "version": "0.1.655","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",