diff --git a/docs/swarm/ui.md b/docs/swarm/ui.md index bce82c8d..0bf00d7d 100644 --- a/docs/swarm/ui.md +++ b/docs/swarm/ui.md @@ -386,20 +386,6 @@ controller puts back what it replaced. Each agent name keys its settings and destroying an agent doesn't clear them, so a name set up before keeps its stored settings when you leave the fields empty. -### Initial AGENTS.md at creation - -A third collapsed section, **instructions**, holds a plain text box for the -text the new agent's `AGENTS.md` starts with. Left empty, or holding only -whitespace, it sends nothing and the agent starts without the file. Otherwise -the text goes as typed in the optional `agents_md` field of `POST /api/agents`. -The agent writes it on its first start, and only when it has no `AGENTS.md` -yet, so creating an agent again under a name that has one never replaces it. -The controller refuses a text over 64 KiB. Its reason shows under the -section, open or not, and the swarm creates no agent. After a successful -create the box empties. The -[instructions editor](#editing-an-agents-instructions) changes the file later. -The [swarm README](README.md#an-agents-agentsmd) has the wire details. - ### Linking external accounts Each agent on `/agents` opens three dialogs that write a credential for it diff --git a/frontend/packages/swarm-ui/src/pages/CreateAgentAgentsMd.ts b/frontend/packages/swarm-ui/src/pages/CreateAgentAgentsMd.ts deleted file mode 100644 index 94c4c04e..00000000 --- a/frontend/packages/swarm-ui/src/pages/CreateAgentAgentsMd.ts +++ /dev/null @@ -1,23 +0,0 @@ -// The create-agent form's initial `AGENTS.md` field, kept out of the -// component so `npm test` can run it. -import type { ProblemDetails } from "@hive/shared/api-error.js"; - -/** - * The `agents_md` to send with a create: nothing while the box is empty or - * holds only whitespace, so the agent starts without the file; otherwise the - * text as typed. - */ -export function agentsMdBody(text: string): { agents_md?: string } { - return text.trim() === "" ? {} : { agents_md: text }; -} - -/** - * The controller's refusal of the text, when `problem` is one: a 400 whose - * detail starts with the field's name. It shows beside the box, so any other - * failure stays with the form's general error. - */ -export function agentsMdRefusal(problem: ProblemDetails): string | null { - return problem.status === 400 && problem.detail?.startsWith("agents_md ") - ? problem.detail - : null; -} diff --git a/frontend/packages/swarm-ui/src/pages/CreateAgentForm.css b/frontend/packages/swarm-ui/src/pages/CreateAgentForm.css index a1960f15..e6e2ac3a 100644 --- a/frontend/packages/swarm-ui/src/pages/CreateAgentForm.css +++ b/frontend/packages/swarm-ui/src/pages/CreateAgentForm.css @@ -69,11 +69,6 @@ .create-agent-result-ok { color: var(--green); } -/* The controller's refusal of the AGENTS.md text, under its section. */ -.create-agent-field-error { - margin: 0; - color: var(--red); -} /* The picked archetype's description, under its select. */ .create-agent-archetype-description { margin: 0; diff --git a/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx b/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx index cb3c1f18..3074c765 100644 --- a/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx +++ b/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx @@ -38,7 +38,6 @@ import { SelectField, type SelectOption, } from "../ui/select-field/SelectField.js"; -import { TextAreaField } from "../ui/text-area-field/TextAreaField.js"; import { Button } from "../ui/button/Button.js"; import { capsBody, LimitsFields } from "../agent/detail/AgentLimits.js"; import { @@ -61,7 +60,6 @@ import { requestArchetype, type ArchetypeList, } from "./CreateAgentArchetype.js"; -import { agentsMdBody, agentsMdRefusal } from "./CreateAgentAgentsMd.js"; import "./CreateAgentForm.css"; // Mirrors swarm-controller's `HiveEntry` — same shape `HivesPage` @@ -146,8 +144,6 @@ export function CreateAgentForm({ null, ); const [archetype, setArchetype] = useState(""); - // The text the agent's `AGENTS.md` starts with; empty sends none. - const [agentsMd, setAgentsMd] = useState(""); const picked = archetypes?.archetypes.find( (a) => archetypeKey(a) === archetype, ); @@ -215,10 +211,6 @@ export function CreateAgentForm({ label: h.name, })); const hivesReady = hives !== null && hives.length > 0; - // The controller's size refusal of the AGENTS.md text, shown under its - // section so a collapsed section still shows it. - const refusal = - result.status === "error" ? agentsMdRefusal(result.problem) : null; async function submit(e: Event) { e.preventDefault(); @@ -240,7 +232,6 @@ export function CreateAgentForm({ ? requestPermissions(selected, catalogue.default) : undefined, archetype: requestArchetype(picked), - ...agentsMdBody(agentsMd), }), }); if (!r.ok) { @@ -250,7 +241,6 @@ export function CreateAgentForm({ const data = (await r.json()) as CreateAgentResponse; setResult({ status: "done", nodeId: data.node_id }); setName(""); - setAgentsMd(""); pickArchetype(""); if (catalogue) setSelected( @@ -268,8 +258,8 @@ export function CreateAgentForm({
Create a new agent's swarm-level identity. This only queues the job — check jobs to watch it settle. Resource - caps, inference and instructions are optional; leave them empty to - set nothing. A name set up before keeps the settings stored for it. + caps and inference are optional; leave them empty to set nothing. A + name set up before keeps the settings stored for it.
{hivesError && ({refusal}
- )}