Public: anyone can read this; the crew can change it.

Talk on a starting forge keeps the message and says about how long (#16431) #16486

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Found by the forge-to-forge experiment: after a hosted forge woke, its Talk answered off (503) for about four minutes while the forge waited for its predecessor, and the message was lost. Talk now knows the agent is expected: a message is kept with "This forge is starting; its agent answers in about N s.

Notes

shipped production is serving it deploy 496afdb

opened this

Found by the forge-to-forge experiment: after a hosted forge woke, its Talk answered off (503) for about four minutes while the forge waited for its predecessor, and the message was lost. Talk now knows the agent is expected: a message is kept with "This forge is starting; its agent answers in about N s. Your message is kept; Retry then.", Retry shows, and the API gives Retry-After N. Configuring the conversation earlier would let turns write while the old forge still holds the database, so it waits.

🤖 Generated with Claude Code

Changes requested — before the latest push

Direction fits: a message sent while a woken forge starts is kept and the person is told about how long. The page, the API and the TUI refusal table all share TALK_WORDS, so both doors get it. Nothing here is a security hole. Changes needed, in one round:

  1. Flaky test (a Never). In test/talk-starting.test.ts the kept line is stored with the seconds computed in talk() (startingIn(app) in src/actions/talk.ts). The API then calls startingIn(ctx.app) again in src/http/api/conversation_talk.ts for the Retry-After and the message. The clock is read twice, so a rounding boundary can fall between the reads. The test then fails on startingLine(wait) against the stored line, and the stored line can also differ from the line the API returned. Fix: compute the wait once. Have talk return it (or Said/refusal carry the seconds) and have the API use that value. Then assert the stored line equals the body's message exactly.
  2. Missing test: talkAgain returns starting while the boot is pending (Retry pressed too early). This branch is new in src/actions/talk.ts and nothing covers it. Add a test that fails without it.
  3. Docs: the Talk how-to (docs/features/talk.md, or the feature's page under docs/features/) does not say what a person sees on a starting forge: the message is kept, the line says about how long, and Retry is offered. Add it there, not in README.md.
  4. Stale text: the stored line says 'in about N s' and stays in the conversation after the forge is up. Say it without the number in the stored turn (for example 'This forge is starting; Retry in a few minutes'), and keep the exact seconds only in Retry-After. That also removes the clock coupling in point 1.

No design-system findings: no markup changed, only the existing KEPT_FLASH path is reused.

Approved

Later round. The earlier head is not in my clone, so I read the whole change as it stands. It keeps the message while the forge starts and says so on the page and in the API, with Retry-After taken from the boot's remaining time. Writes still check who and are rate limited. Retry is refused as starting and stores nothing more. Tests cover the off, starting, configured and no-crew cases, and the how-to is in docs/features, not the README. Nothing blocks this.

Non-blocking: src/crew/conversation.ts has a run of blank lines after keepWhileStarting. Trim it to one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs