A message that cannot start is kept (#16431)
A message sent to Talk is never lost. When no turn can start for it right now, the message stays in the conversation and one line under it says why and when to try again, marked failed so the page draws Retry:
- the account that answers you is resting: "The account that answers you is resting until 18:08 UTC. Your message is kept; Retry then." (the time is the account's own, or what it said);
- the forge is answering as many people as it can: Retry in a minute;
- pictures sent while an answer is under way: Retry when it has finished;
- no account answers for you yet: who can grant one, through the forge's own ask;
- the agent cannot run on this forge (no sandbox): an admin sees the cause;
- the forge is starting (a woken cell waits for the forge it replaces before its agent runs, which
has taken minutes): "This forge is starting; its agent answers within a few minutes. Your message
is kept; Retry then." The API answers it as a kept send (202,
whystarting) with the seconds left of the boot asRetry-After; a Retry pressed before the agent is up is refused asstartingand stores nothing more; - the forge's agent is not running (off, with no agent coming): Retry once it runs;
- a forge its parent lends model credit to has spent it (before the turn, or mid-answer): who can raise it (the parent forge's admin), never the raw "API Error: 402" (#16455).
Messages queued behind one that cannot start are kept too, in the order they were sent.
Retry sends the kept message again, once: the failed line is set aside and the same words start a
new turn. The page says "Your message is kept. Tap Retry under it when you are ready." (src/web/pages/talk.ts).
In the terminal's Talk (src/tui/screens/talk_chats.ts) the line shows with " · failed", and
ssh <forge> talk-again retry <turn> retries it.
What a client gets
A kept message is a send that succeeded, so every door answers it as one:
POST /api/v1/conversation/messagesanswers 202 with{ "how": "kept", "why", "message", "turn", "until" }:messageis the line,turnthe kept message's own turn.whyisresting(a spent lent credit too),busy,answering,no_account,sandbox,unauthorized,offorstarting;startingaddsRetry-After, the seconds left of the boot.untilis there only when the account said when it wakes. Withno_accountthe body also carriessaysandask, the call that asks an admin for one.- The MCP
saytool returns a result (not an error) whosesaysis the line, withkept: true,why,turnanduntil. ssh <forge> talk <words>printskept: <the line>and exits 0.- A build's first message (
POST /api/v1/builds, MCPsaywithaction: "build") answerssaid,messageandkept.
A refusal that keeps nothing stays an error: an empty or overlong message, no such conversation, more than 12 a minute, a full queue, a file already waiting, or no signed-in person.
Retry, edit and regenerate keep nothing new: one that cannot start puts the exchange back as it
was and is refused with why (the page's flash, { ok: false, message } with its status, and
ssh <forge> talk-again exiting 1), never "Asked again" (#16593).
Code: heldLine, Kept and keepUnstarted in src/crew/conversation.ts; the starting line
is src/crew/starting_line.ts. Tests: test/conversation-turn.test.ts,
test/talk-kept-message.test.ts, test/conversation-talk.test.ts, test/talk-starting.test.ts.