A model is named by its ref: twins on two connections are told apart

Contract and strings pinned at the server's dev (6778143); the release re-pins at its tag.

- ModelInfo, SchedulingModel, StartModel and a directory's model carry
  `ref`; `key` (ref, else id) is what is chosen, kept and sent as `model`
  on create, chat update and schedules. `named()` finds a row by ref, else
  the first with that id, so an assistant model saved as an id, a chat's
  `model` and a schedule's still find theirs.
- Pickers show "Name · Connection" where two rows share an id, and key
  their rows by ref.
- An open chat says its model's id only: the ref picked here says which
  twin while the id still fits (ChatState.picked).
- A run's `error.reason` is read.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-11-18 01:16:13 +00:00
1 parent 1d3154cefa
commit efba3aacf4
23 files changed
+212 -41

No files matched your search

@@ -37,7 +37,8 @@ class ChatStateTest {
@Test
fun theModelIsTheChatsThenTheDraftsThenTheDefault() {
assertEquals("qwen", ChatState(models = models).modelId)
// A model is named by its ref; a chat and an older choice still name it by its id.
assertEquals("local/qwen", ChatState(models = models).modelId)
assertEquals("gpt-oss", ChatState(models = models, draft = Draft(model = "gpt-oss")).modelId)
assertEquals("vision-small", ChatState(models = models, chat = Chat(id = "c", model = "vision-small"), draft = Draft(model = "gpt-oss")).modelId)
}