You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit feec7ad
Browse filesBrowse the repository at this point in the historyBrowse files
An interrupt send now stores the message at the end of the steer lane.
Before, it went to the head of the queue lane from R0 or R1, and to the
tail of the queue lane from I1. FinishInterruption delivers the whole
steer lane, so the message goes into history after the steer messages
that were queued before it.
Copy file name to clipboardExpand all lines: coderd/x/chatd/ARCHITECTURE.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,7 @@ Queued messages wait in two lanes. These rules apply to every transition that qu
134
134
- When `Create(initialMessages, initialStatus)` creates a child chat, it first locks the family's root chat row with `FOR SHARE` and fails if the root is archived, so a new child never joins an archived family.
135
135
-`SetArchived(archived)` sets or clears the archived marker for one chat.
136
136
-`SetProject(project)` sets or clears the project of one chat without changing its execution state. A move of a root chat applies it to the root and each descendant in one transaction, and fails without changing any chat if one of them isn't in `W`, `E0` or `E1`. Only the root's `project_id` changes; subagents go through `SetProject` only so that their execution state is checked too. As in a family archive, the root row is locked first, so a concurrent child creation either joins the move or waits for it. A move to the root's current project applies no transition.
137
-
-`SendMessage(m, busy_behavior)` inserts a user message directly when the chat is idle, or queues it when the chat is busy. `busy_behavior` must be `queue`, `steer` or `interrupt`. `queue` and `steer` name the lane (see [Queued message lanes](#queued-message-lanes)). Outside `E1`, a busy send with one of them stores `m` in its lane and keeps the status. From `E1`, `busy_behavior=steer` inserts the queued `steer` messages and then `m` into history, and `queue` messages stay queued. From `E1`, `busy_behavior=queue` queues `m` as a `queue` message and promotes the next messages. With `busy_behavior=interrupt`, it also requests interruption, or cancels a pending dynamic-tool action and inserts the message directly. A queued interrupt message goes into the `queue` lane.
137
+
-`SendMessage(m, busy_behavior)` inserts a user message directly when the chat is idle, or queues it when the chat is busy. `busy_behavior` must be `queue`, `steer` or `interrupt`. `queue` and `steer` name the lane (see [Queued message lanes](#queued-message-lanes)). Outside `E1`, a busy send with one of them stores `m` in its lane and keeps the status. From `E1`, `busy_behavior=steer` inserts the queued `steer` messages and then `m` into history, and `queue` messages stay queued. From `E1`, `busy_behavior=queue` queues `m` as a `queue` message and promotes the next messages. With `busy_behavior=interrupt`, it also requests interruption, or cancels a pending dynamic-tool action and inserts the message directly. A queued interrupt message goes to the end of the `steer` lane.
138
138
-`EditMessage(k, replacement)` clears queued messages, cancels or obsoletes active work, marks the truncated active-history suffix as deleted, inserts the replacement turn followed by any caller-provided suffix messages, and lands in `running`.
139
139
-`DeleteQueuedMessage(qid)` removes one queued message without changing the active history.
140
140
-`PromoteQueuedMessage(qid)` makes a queued message the next message to process in its lane. It reorders the queue, interrupts active work, cancels pending dynamic-tool action, or promotes into history immediately as required by the input state.
@@ -549,9 +549,7 @@ For `busy_behavior=interrupt`, `SendMessage(m, interrupt)` supports:
549
549
-`A0 -> SendMessage(m, interrupt) -> R0`
550
550
-`A1 -> SendMessage(m, interrupt) -> R1`
551
551
552
-
When `SendMessage(m, interrupt)` lands in `I1`, `FinishInterruption(partial?)` finalizes the interrupted suffix and then promotes every `steer` message, or the queue head if there are none. If no worker owns the chat, the same transaction applies `FinishInterruption` instead, so the promotion happens immediately and the chat lands in `R0` or `R1` without an owner. `m` goes into the `queue` lane. From `R0` or `R1`, `m` goes to the head of the `queue` lane, behind the `steer` lane, so `m` is promoted if the `steer` lane is empty. If no worker owns the chat, the response then returns `m` as `message` with `queued` set to false.
553
-
554
-
From `I1`, `m` joins the tail of the `queue` lane. The promoted messages in `messages` carry the queue IDs of older queued messages in `queued_message_id`, and `queued_message` is `m`.
552
+
When `SendMessage(m, interrupt)` lands in `I1`, `m` goes to the end of the `steer` lane. `FinishInterruption(partial?)` finalizes the interrupted suffix and then promotes every `steer` message, so `m` goes into history after the `steer` messages that were queued before it. If no worker owns the chat, the same transaction applies `FinishInterruption` instead, so the promotion happens immediately and the chat lands in `R0` or `R1` without an owner. The response then returns `m` as `message` with `queued` set to false.
0 commit comments