Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: let the create-agent form set the new agent's initial AGENTS.md

The form gets a collapsed "instructions" section with a plain text box. Its
text goes in the optional agents_md field of the create request, and is left
out while the box is empty or only whitespace. The controller's size refusal
shows under the box instead of in the form's general error panel. The text
box empties after a successful create.

The send and refusal logic sits in its own module with tests, and
docs/swarm/ui.md describes the field.
This commit is contained in:
iris 2026-10-18 15:59:19 +02:00
commit 30ba34f411
5 changed files with 112 additions and 3 deletions

View file

@ -386,6 +386,19 @@ 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 box and
no agent is created. 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