Merge branch 'worktree-agent-ab9de97501bc94a9c'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 23:38:04 +00:00
28 changed files with 1223 additions and 87 deletions
+22 -2
View File
@@ -120,8 +120,28 @@ data?, after?}`.
when the login cannot ask for a password (below).
- `terminal_list` → `terminals` (running and ended, oldest first; live
records carry their current title, size and `stream`).
- `terminal_input {terminal_id, data}` (UTF-8, ≤ 16 KiB, 64-request queue),
`terminal_resize {terminal_id, cols, rows}` (clamped 20–500 × 4–200).
- `terminal_input {terminal_id, data, reply?, cols?, rows?}` (UTF-8,
≤ 16 KiB, 64-request queue), `terminal_resize {terminal_id, cols, rows,
activate?}` (clamped 20–500 × 4–200).
- **Several clients on one terminal** (`terminal_viewers.go`,
`terminal_active.go`; chat terminal commands too): one *active* client
owns the PTY size and is the only one whose emulator's automatic answers
(`reply: true`: cursor position, device attributes) reach the shell, so
a query gets one answer, not one per client. The opener starts active;
typing (carrying the typist's `cols`/`rows`, applied before the input)
or focusing a terminal view (`terminal_resize` with `activate`) makes a
client active. Others' sizes are kept, not applied; when the active
connection closes the next most recent client's size is applied. The
client marks answers by what the emulator emits while drawing output
(`ChatShellTerminalSession.onReply`).
- **Input latency**: `PipelinesClient.call` sends `terminal_input`,
`terminal_resize`, `chat_shell_input` and `chat_shell_resize` at once
instead of behind the previous request's reply; the server reads them
onto a per-connection terminal lane (`terminal_lane.go`) handled in
order beside the ordinary loop, and `terminal_open` runs off the read
loop. `ChatShellInputPipe` still keeps one request in flight per
terminal (typing during it is coalesced; answers go in their own
requests).
- `terminal_output {terminal_id, after}` → `terminal` with `output`,
`output_start`, `output_end`, `stream`; subscribes the connection.
- `terminal_close {terminal_id}` → the closed record (runs off the read