Commit Graph
1 Commits
Author SHA1 Message Date
kosmos 0a3c7b7b45 room: steer mid-turn chat to the next step boundary
ci / checks (push) Successful in 51s
ci / test (push) Successful in 1m1s
ci / chart (push) Successful in 5s
ci / web (push) Successful in 18s
ci / docker (push) Successful in 6s
ci / publish-edge-image (push) Successful in 11s
ci / publish-edge-chart (push) Successful in 4s
A message posted without a mention while the agent worked waited for the
next turn, so the model read it only once the work the line was about was
finished. The spec's turn rules already promised the mid-turn half ("the
next step of the running turn"); the runner implemented the turn-boundary
half only.

The turn now hands the framework's steering hook a source over the room's
`absorbed_seq` cursor. The driver drains it between two steps and appends
one User-role message per drain, so the line lands in the history without
the step in flight dying. The drain stops at the first line it cannot
carry, a mention (the drop path owns that one) or a message with images (a
line of text cannot hold them), and leaves the cursor there, so the
boundary pass appends them in the log's order.

The row has one writer. `drain` carries the cursor in memory only, and
`commit` writes it after `save_session` succeeds, which is the order the
boundary pass already uses: append, checkpoint, advance. The boundary pass
hands its own cursor to the turn in the config the turn reads, so the
first drain never reads back what that pass just appended. A line retired
too early would be gone, one that comes back is deduped within the turn.

A mention still drops the turn: that is the only way to stop a running
command, and this change does not touch it.

Co-authored-by: Kosmos <kosmos@vhaudiquet.fr>
2026-12-02 17:02:49 +00:00