room: steer mid-turn chat to the next step boundary #1

Merged
vhaudiquet merged 2 commits from kosmos/rhema-together:room-chat-steering into main 2026-12-02 17:02:50 +00:00
2 Commits
Author SHA1 Message Date
vhaudiquet 6b2624f0ba room: advance the steer cursor after the checkpoint
ci / test (push) Successful in 59s
ci / checks (push) Successful in 55s
ci / web (push) Successful in 17s
ci / publish-edge-image (push) Skipped
ci / chart (push) Successful in 5s
ci / docker (push) Successful in 1m49s
ci / publish-edge-chart (push) Skipped
ci / checks (pull_request) Canceled after 0s
ci / test (pull_request) Canceled after 0s
ci / chart (pull_request) Canceled after 0s
ci / web (pull_request) Canceled after 0s
ci / docker (pull_request) Canceled after 0s
ci / publish-edge-image (pull_request) Canceled after 0s
ci / publish-edge-chart (pull_request) Canceled after 0s
The steering source seeded from `config.absorbed_seq`, which the runner
loaded before the boundary pass advanced the row. When the burst that
started the turn held a chat line before the mention, the first drain read
that line back, appended it a second time, and moved the row backwards,
so the next boundary pass appended the mention again.

The row now has one writer. `RoomSteering::drain` keeps the cursor in
memory, `commit` writes it after `save_session` succeeds, and the
boundary pass hands its own cursor down in the config the turn reads.
That is the order the boundary pass already uses, append then checkpoint
then advance, and the framework's contract for a steering source: a line
that comes back is deduped within the turn, a line retired too early is
gone.

A failed commit leaves the row behind, so a line can repeat, and it
reports the failure instead of swallowing it. The drain rule moves to
`steerable`, a pure function over the messages, and four tests cover it,
the cursor handoff, and the row's waits.
2026-12-02 18:01:38 +01:00
kosmos d310735c71 room: steer mid-turn chat to the next step boundary
ci / test (pull_request) Successful in 54s
ci / chart (pull_request) Successful in 4s
ci / web (pull_request) Successful in 16s
ci / docker (pull_request) Successful in 1m42s
ci / publish-edge-image (pull_request) Skipped
ci / publish-edge-chart (pull_request) Skipped
ci / checks (pull_request) Successful in 51s
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 a steering source. 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, which the drop path owns, or a
message with images, which a line cannot -- and leaves the cursor there, so
the boundary pass appends them in the log's order. What it drains advances
`absorbed_seq`, so nothing is appended twice.

A mention still drops the turn: that is the only way to stop a running
command, and this change does not touch it.
2026-12-02 13:18:14 +00:00