swarm-controller: refuse an inference model name that starts with "-"
`check_model` accepted a value like `--dangerously-skip-permissions`, and the stored model ends up in the agent's `claude` argv. A PUT whose `model`, or any `subagent_models` entry (same validator), starts with `-` is now a 400 with the same problem+json shape as the other model checks. A dash inside a name (`claude-opus-4-8`) is still accepted. Raised by argus on #5084. Refs #5034
This commit is contained in:
parent
19a045a401
commit
47bd83054f
3 changed files with 32 additions and 18 deletions
|
|
@ -82,11 +82,11 @@ which swarm-controller alone writes:
|
|||
|
||||
Every field is optional, and `{}` reads the same as no key.
|
||||
|
||||
| method | path | body |
|
||||
| -------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `GET` | `/api/agents/<agent>/inference` | —; answers `{"configured": <the stored value, {} when none>, "effective": <what the agent reported, or null>}` |
|
||||
| `PUT` | `/api/agents/<agent>/inference` | the whole value, replacing the stored one; the controller refuses unknown fields, an unknown effort, or a model name with whitespace |
|
||||
| `DELETE` | `/api/agents/<agent>/inference` | —; answers 204 |
|
||||
| method | path | body |
|
||||
| -------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `GET` | `/api/agents/<agent>/inference` | —; answers `{"configured": <the stored value, {} when none>, "effective": <what the agent reported, or null>}` |
|
||||
| `PUT` | `/api/agents/<agent>/inference` | the whole value, replacing the stored one; the controller refuses unknown fields, an unknown effort, or a model name with whitespace or a leading `-` |
|
||||
| `DELETE` | `/api/agents/<agent>/inference` | —; answers 204 |
|
||||
|
||||
An agent's own queue credential grants it
|
||||
`$JS.API.DIRECT.GET.KV_agent-inference.$KV.agent-inference.<agent>`, the
|
||||
|
|
|
|||
Loading…
Reference in a new issue