Declare provider settings, and give the context figure a denominator

Two things a session could not say, and one it was saying wrongly.

**Every provider setting is reachable.** `-np 1`, the MTP draft depth, the
tool set, the sampling parameters -- most were hardcoded to what measured
best on this machine, which is right as a default and wrong as a constant:
the next machine has a different GPU and a different core count, and
nobody running this app can edit the source. `DriverKind::params` now
declares what a provider takes -- key, label, shape, what blank means, and
whether a change waits for a restart -- and the phone renders whatever
arrives, on the spawn form and in the session settings dialog. Adding a
setting to a driver is one entry in that table and no app change.
`POST /sessions/{id}/params` takes the whole map, so an absent key is the
instruction to unset; the sampling half applies at once and the session is
told in words which of the rest are waiting for a restart.

`tools` is one of them, because it is the biggest lever on a tight
context: the seven built-in definitions are ~1,300 tokens of every prompt
(2,191 against 887 with none). `"none"` omits the flag rather than passing
it on, since `--tools none` is `unknown tool "none"` and a server that
exits.

**The context figure has a denominator.** `Event::ContextWindow` carries
it, read from `llama-server`'s `/props` once the model is up -- the
measurement rather than the request, since a session that named no context
size gets the model's own. Neither coding CLI states its window, so those
keep the bare figure: "2,042" and "2,042 / 8,192" are deliberately
different-looking, and a missing ceiling is never drawn as a proportion of
an assumed one.

**And the numerator was wrong**, by the length of the last reply: it was
the prompt alone, so a five-word answer reported 2,042 against a slot
holding 2,355. It is the turn's total now, which matches `llama-server`'s
own `n_tokens` to within a token.

Two defects the review found, both of which would have shipped: changing
settings on a *stopped* session reported "no process running, so it can't
take new settings", when a stopped session is exactly when you would set
them for the next start; and `GET /tools` answers **403** rather than an
empty list on a server started without `--tools`, so reading it as a
failure made the no-tools session one that never started.

Verified against real models: settings spawned and changed live, the
restart note, a session with two tools and one with none, and the counter
checked against the server's own slot occupancy each time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-19 13:58:08 -04:00
1 parent ac476ab0c9
commit 81ab564a09
18 files changed
+831 -115

No files matched your search

+20
View File
@@ -1435,6 +1435,26 @@ verified by running it, matching dev-updater's posture.
it truncates old KV cache entries, which is silent forgetting with no
summary, and it corrupts the harness's view of what the model knows. Fine
as a server-side safety net; not memory management.
- **What a provider's settings are is declared by the server** (2026-09-19,
`DriverKind::params`). A spec is a key, words, a shape and whether a change
waits for a restart; the phone renders whatever arrives, so a driver that
grows a setting gets a control with no app change. The reason it is
declared rather than drawn is not tidiness: several `llama-server` flags
were hardcoded to what measured best on one machine, which is right as a
default and wrong as a constant — the next machine has a different GPU, and
nobody running this app can edit the source. `POST /sessions/{id}/params`
takes the whole map, so an absent key *is* the instruction to unset.
- **The context figure has a denominator where one can be measured**
(2026-09-19). `Event::ContextWindow` carries it, read from `llama-server`'s
`/props` once the model is up — the measurement rather than the request,
since a session that named no context size gets the model's own. Neither
coding CLI states its window, so those keep the bare figure: "2,042" and
"2,042 / 8,192" are deliberately different-looking, and a missing ceiling is
never drawn as a proportion of an assumed one.
The numerator was also wrong, by the length of the last reply: it was the
prompt alone, so a five-word answer reported 2,042 against a slot holding
2,355. It is the turn's total now, which matches `llama-server`'s own
`n_tokens` exactly.
- **MCP servers are configured in `config.ron`, not from the phone**
(2026-09-19). `mcpServers` on a llama provider, with Exa preset on a newly
discovered one. A phone screen for them is the obvious next step and was