Contract at server dev 5044168: done is the end of a reply, the chat's name follows
CI / check (push) Canceled after 0s

The server now sends `done` as soon as the reply is saved and names a new
chat afterwards: `done.chat.title_pending`, then one `title` frame before
`close` (up to the naming's time limit).

- The chat screen finishes the reply at `done` (the row replaced, nothing
  live, a queued prompt's reply followed at once) and keeps the stream only
  for the `title` frame, which renames the chat. It used to wait for
  `close`, which with this server would have left a first reply undrawn for
  the seconds the naming takes.
- The assistant's sheet follows the stream to `done` only, so a spoken
  answer is read aloud without waiting for the name.
- Fixtures: event_done (title_pending), event_done_title_pending,
  event_title. Tokens and strings are unchanged at this ref.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-11-12 10:06:37 +00:00
1 parent a30075c8f3
commit e35bf3004c
10 files changed
+191 -25

No files matched your search

@@ -27,6 +27,7 @@ import eu.llembas.android.api.SteeredFrame
import eu.llembas.android.api.StepsFrame
import eu.llembas.android.api.SubagentTranscript
import eu.llembas.android.api.Tail
import eu.llembas.android.api.TitleFrame
import eu.llembas.android.api.ToolCall
import eu.llembas.android.api.TreeFrame
import eu.llembas.android.api.TreeView
@@ -315,6 +316,26 @@ class ContractTest {
assertEquals("Waybread", read("event_done", DoneFrame.serializer()).chat.title)
}
@Test
fun doneIsTheEndAndTheChatsNameMayFollow() {
// A new chat's first reply: saved and done at once, under the name made from the prompt.
val pending = read("event_done_title_pending", DoneFrame.serializer())
assertTrue(pending.chat.titlePending)
assertEquals("How is lembas made?", pending.chat.title)
assertFalse(read("event_done", DoneFrame.serializer()).chat.titlePending)
var live = LiveReply("msg2").apply("done", text("event_done_title_pending"))
assertNotNull(live.finished)
assertEquals("How is lembas made?", live.title)
assertFalse(live.closed)
// Then, if a model names it before the stream closes, one `title` frame: only the name changes.
val finished = live.finished
live = live.apply("title", text("event_title"))
assertEquals("Waybread", live.title)
assertEquals(finished, live.finished)
assertEquals("chat1", read("event_title", TitleFrame.serializer()).chat.id)
assertTrue(live.apply("close", text("event_close")).closed)
}
@Test
fun aWholeStreamBuildsAReply() {
var live = LiveReply("msg2")