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
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,14 @@ In TUI chat mode there is no completion gate — the session stays open across t
81
81
- Wires `ask_operator` to an operator-gate event resolved by a modal
82
82
- Mounts the OpenTUI host via `mountRunnerHost` (`src/tui/runner-host.ts`), which mounts `mountProductHost` (`src/tui/product-host.ts`) over the shell (`src/tui/shell.ts`)
83
83
- Bridges reactor events to the OpenTUI host via a plain `EventEmitter`
84
-
-**Mid-run injection** — When a message arrives while the agent is running, it is queued in an `InjectionQueue`. On the next `inference.done` event (turn boundary), the queue is drained: each queued message is delivered via `agentProxy.deliver()` and a `"mid-run.delivered"` emitter event is fired so the badge count in the App updates. The queue is cleared on session rotation (`/clear`).
84
+
-**Mid-run injection** — Shell `session-queue` items drain at the parent
85
+
`tool.boundary` through `SessionPort.deliver`. Production `routeQueuedDelivery`
86
+
live-injects in-flight parent-boundary steers via `agentProxy.deliver`
87
+
(`Agent.deliver`) into the live reactor. Idle leftover, idle-with-fleet, and
88
+
post-interrupt steers, plus follow-ups (`kind === "queue"`), use the existing
89
+
send path. `/clear` and `/new` bump a
90
+
delivery generation and call `SessionBridge.clearQueuedDelivery()` so queued
91
+
input from the previous session cannot enter the new one.
85
92
-**Session rotation** — Uses a serial session-operation queue (`createSessionOperationQueue`, not a boolean flag) so rotation, compaction continuation, and `agentProxy.deliver` never race a concurrent rebuild. Each operation chains onto the tail, ensuring in-flight work completes before the agent is torn down.
0 commit comments