swarm-ui: an editor for an agent's AGENTS.md that saves as a diff
The instructions row of the agent detail panel gets an edit button that opens the agent's AGENTS.md, as the harness last published it, in a text box. Save sends a unified diff against the revision that was loaded; when the agent changed the file meanwhile the editor keeps the operator's text, shows the agent's version and offers to save over it or take it. An unsaved edit survives closing the dialog. The diff is built in the browser (LCS over lines, three lines of context, git's no-newline marker) and was checked against git apply on 600 random before/after pairs.
This commit is contained in:
parent
bff13c8c68
commit
b5d2e310ba
7 changed files with 664 additions and 0 deletions
|
|
@ -330,6 +330,22 @@ The panel reads `GET /api/agents/{agent}/inference`; before the agent's first
|
|||
report reaches the controller, it shows the swarm's stored values only.
|
||||
[inference](inference.md) describes the settings themselves.
|
||||
|
||||
### Editing an agent's instructions
|
||||
|
||||
The **instructions** row of an agent's detail panel has an **edit** button. It
|
||||
opens `AGENTS.md`, the file the agent reads its instructions from, in a plain
|
||||
text box. The text is the copy the agent last published, so the box still
|
||||
opens for a stopped agent, but **save** needs the agent running.
|
||||
|
||||
Save sends the swarm a diff against the version you opened, and the agent
|
||||
applies it to its own file with git. When the agent changed the file in the
|
||||
meantime, the swarm refuses the diff. The box then keeps your text, shows the
|
||||
agent's version below it, and offers two ways on: **keep my text, replace the
|
||||
agent's changes**, which makes your text the new base for the next save, or
|
||||
**use the agent's version**, which drops yours. A diff that git refuses for any
|
||||
other reason shows git's message and leaves the file as it was. Closing the
|
||||
dialog keeps an unsaved edit for the next time you open it.
|
||||
|
||||
### Resource caps
|
||||
|
||||
The agent's detail panel shows its CPU quota and memory max under **resource
|
||||
|
|
|
|||
Loading…
Reference in a new issue