Merge main into lane-pill: combine the pill overlay with main's chat-close, omni-search and status work

Brings the branch up to date with main's tip so it can be merged back without
conflict. Merged cleanly, with no conflicted path: git auto-merged
ui/PipelinesApp.kt, ui/chat/ChatListPane.kt and ui/screens/RunHistoryScreen.kt,
keeping main's changes (the omni-search panel, the one status colour, the chat
close/tool-work surfaces) alongside this item's pill overlay, its
LocalPillBottomInset clearance and the SettingsDestination templates stack.

android/README.md is main's version, not this item's: this item records its
documentation change in docs/notes/pill-overlay-and-position.md for the single
docs-fold writer instead of editing that shared document.

Checks re-run on the merged tree (macOS, JAVA_HOME=Android Studio jbr,
ANDROID_HOME=~/Library/Android/sdk, Gradle 8.11.1, --offline --no-daemon):
`gradle :app:assembleDebug :app:testDebugUnitTest` -> BUILD SUCCESSFUL, 67 result
XMLs aggregating to 627 tests, 0 failures, 0 errors, 0 skipped.
This commit is contained in:
2026-10-18 00:20:40 +01:00
68 changed files with 4782 additions and 709 deletions
+106
View File
@@ -0,0 +1,106 @@
# Finishing a chat: a server-side close that keeps the history
## What this item changed
The Pipelines server and `android/`. Before this, the only way to get a chat out
of the list was the app's device-local hide (`ChatOverrides.hidden`): the session
stayed open on the server, other clients still showed it, and nothing recorded
that the operator had finished with it.
- `internal/protocol/chat.go` adds the `chat_close` and `chat_reopen` request
types, a `ChatCloseResult` (`session_id`, `closed_at`, `interrupted`) and
additive `closed`/`closed_at` fields on the chat session; `internal/protocol/message.go`
carries `ChatClose` on the outcome envelope (the requests themselves ride on
`chat_query`, like `chat_messages`/`chat_interrupt`).
- `internal/server/chat_close.go` (new) handles both: `chat_close` stops a turn
in flight by reusing the broker interrupt the session's room owns (recording in
the reply that a turn was stopped, so a stream is never left running into
nothing), then sets `closed_at`; `chat_reopen` clears it. Both take a
`chat_query` and echo the session plus its registry row. A session id that is
not a recorded operator session — including a pipeline-owned run session — is
refused before anything is written. Nothing is deleted.
- `internal/server/chat_sessions.go` marks a listed session `closed`/`closed_at`
from the registry, so every client sees the same state and a closed session
stays listed.
- `internal/server/chat_room.go` gains `turnInFlight`, so close only interrupts a
session that actually has a turn running.
- `internal/pipeline/operator_sessions.go` adds `closed_at` to
`operator_sessions` (for a fresh database and by an idempotent
`addColumnIfMissing` migration for an existing one), plus
`CloseOperatorSession`, `ReopenOperatorSession` and `OperatorSession`, and
clears the closed state on record and on touch, so simply prompting a closed
session reopens it.
- `android/`: `data/protocol/Chat.kt`/`Message.kt` (closed fields, the two
requests), `PipelinesRepository.chatClose`/`chatReopen`, `ChatStore` (closed
state, a `closedSessions` grouping, `setQueued`/`sessionReopened`),
`ChatFormat` (a closed status label), `ChatListPane` (a `Closed` chip and
section, Close/Reopen actions, a confirmation stating that close stops a
running turn, marks the chat closed on every device and deletes nothing),
`AppViewModel` (the close/reopen actions), and the rename of the local action
to **Hide on this device** with a snackbar saying the chat stays on the server.
- Tests: `internal/protocol/chat_test.go`, `internal/server/chat_close_test.go`,
`internal/pipeline/operator_sessions_close_test.go`,
`android/.../ChatCloseTest.kt` and the closed-state cases in
`android/.../ChatProtocolTest.kt`.
No new dependency (only the already-declared material-icons-extended), the
installer and the Docker files are untouched, and no run is started from the app.
State: committed locally only, not deployed; the on-device close/second-client/
reopen check is deferred to visual review.
## Shared documents this change makes stale
The note is written here rather than edited in place; the `docs-fold` writer
should update these when it next folds notes.
- `docs/cli.md:306` — the `## Chat sessions` bullet for `chat_sessions` lists each
session's `directory`, `tag` and recency and ends "A session is never marked
`busy`". It should add that a closed session is still listed, marked
`closed: true` with its `closed_at`, so a client groups or filters it as
history rather than losing it.
- `docs/cli.md:342` — after the `chat_adopt` bullet, add two bullets:
`chat_close` takes a `chat_query` (`session_id`), stops any in-flight turn
through the same interrupt `chat_interrupt` uses (the `chat_close` result's
`interrupted` flag records that a turn was stopped), then sets `closed_at` in
the operator-session registry; it answers with the closed session as
`chat_session`, its registry row in `chat_sessions` and the `chat_close`
result; an id that is not a recorded operator session — including a
pipeline-owned run session — is refused before anything is written, and
nothing is ever deleted. And `chat_reopen` clears the state again (the inverse,
same `chat_query`); prompting a closed session also clears it.
- `android/README.md:6326` — append a dated section recording the behaviour: the
server-side close and reopen, the session and transcript surviving a close,
the `Closed` chip/section and the `Closed` status line, the Close action and
its confirmation wording, the Reopen action, the two ways a session reopens,
and the rename of the local action to **Hide on this device** (device-only,
with a snackbar saying the chat stays on the server) so the two are never
confused. Include the verification evidence and the not-verified-on-device
boundary (implementation verification is the build and the unit tests; visual
review owns the device).
- `internal/author/skill/references/operations.md:268` — the "Brokered OpenCode
chat" preamble lists the declared `chat_*` surface; add `chat_close` and
`chat_reopen`.
- `internal/author/skill/references/operations.md:307` — the `chat_sessions`
paragraph describes the `operator_sessions` shape (`session_id`, `directory`,
`title`, `tag`, `created_at`, `last_used_at`); add `closed_at` and say that a
closed session stays in the list marked `closed`/`closed_at`. Add a paragraph
documenting `chat_close`/`chat_reopen` (interrupt a running turn, record the
closed state, refuse a non-operator session, keep listing as history, reopen
explicitly or by prompting), and add a dated evidence bullet naming
`internal/server/chat_close_test.go`,
`internal/pipeline/operator_sessions_close_test.go`,
`internal/protocol/chat_test.go` and the app's `ChatCloseTest`, marking the
on-device check as not run.
## Not stale
- No packaged template names the chat surface, so `internal/author/`'s templates
need no change.
- `internal/author/install.go`'s managed file inventory needs no change: this
item adds no reference file.
- `internal/author/skill/references/SKILL.md` stays a task-directed index; the
close/reopen detail belongs in `operations.md`.
- `android/AGENTS.md` already lists `ui/chat/` and its files, and
`internal/server/AGENTS.md` already points at `internal/server/chat_*.go` and
`internal/pipeline/`'s operator-session registry, so neither area map needs a
new entry.
+65
View File
@@ -0,0 +1,65 @@
# Chat in-flight tool work
## What this item changed
`android/` only, the chat's two "working" surfaces.
- `ui/chat/ChatFormat.kt` adds `runningToolCalls` (the tool parts still
`running`, in transcript order), `toolDetail` (the command/description the
part's own input carries, from description/command/filePath/file_path/path/
pattern/query/url, one line, elided at 72 chars, `null` when absent),
`runningToolElapsedMillis` (the protocol's `time.ran`/`created` when present,
else the local per-part stamp), `runningToolStamps` (a stable start per part
across frames), `TOOL_LONG_RUNNING_MILLIS` = 60s with `toolLongRunning`, and
`sessionWorkLabel`.
- `ui/chat/ChatStore.kt`: `ChatThread.toolStartedAt` plus `runningTools` and
`toolElapsedMillis`; `history()`, the frame fold and `setRunning` maintain it.
- `ui/chat/ChatTranscript.kt`: `RunningIndicator` now also lists one line per
running call (name, detail where present, live elapsed), keyed by part id so
concurrent calls render together; a call past 60s is tinted and marked
`· long`.
- `ui/chat/ChatListPane.kt`: the session row renders
`sessionWorkLabel(session.busy, thread)`.
- `ui/chat/ChatRunningWorkTest.kt` covers it (name/detail/elapsed, clear on
completion, error state, concurrent calls, no-detail stream).
No percentage, ETA or progress bar is invented; only the reported fields (tool
name, `state.status`, `state.input`) are used.
## Shared documents this change makes stale
`android/README.md` documents the two surfaces this item changed, in the
`## Streaming replies (16 Oct 2026)` record. The note is written here rather
than edited in place; the `docs-fold` writer should update it.
- `android/README.md:4633` — the **Running indicator** bullet reads "The
transcript's indicator shows the spinner, `Working…` and the live elapsed
time (ticked once a second, never per frame, through the shared
`formatDuration`)." It should add that the indicator also lists, one line per
tool call still in flight, the call's name, the command/description the part
carries when it carries one, and that call's own live elapsed time; that a
call running 60 seconds or more is tinted and marked `· long`; that a call's
line drops out the moment it completes or errors, which is what clears the
indicator; and that no percentage, ETA or progress bar is shown. The rest of
the bullet (one-second tick, the tick loop keyed on the turn's start, the
elapsed count surviving a chat switch) is still true.
- `android/README.md:4454` — the session-list sentence "the list shows each
session's running/busy/read-only status" is now incomplete: a working session
row names what it is doing (`Running <tool>`, or `Running <n> tools` when
several run at once) instead of only `Running`, while a turn that is only
generating text still reads plain `Running`, so the two stay distinguishable;
a busy session with nothing running still reads `Busy · read-only`, and an
idle one `Idle`.
Dates, counts and capture names in those dated records are past evidence and
stay as they are; only the two behaviour statements above are now stale.
## Not stale
- No packaged OpenCode skill reference documents this app surface. The chat
references in `internal/author/skill/references/operations.md` document the
server's brokered `chat_*` protocol, which this change does not touch, and no
packaged template or `internal/author/` managed file names the app's chat
indicator or session label.
- `android/AGENTS.md` already lists `ui/chat/` and its files, so it needs no
change.
+40
View File
@@ -0,0 +1,40 @@
# docs-fold single documentation writer
## What this item changed
Per-item workflows no longer edit shared documentation themselves. The convention now
lives in `internal/author/skill/references/orchestration.md` (brief item 5, the
hard-constraint bullet, "Single documentation writer", and the "Pipeline choice"
committer bullet), the canonical committer checklist in
`internal/author/skill/references/format.md` (step 6), the bundled committer prompts in
`examples/task.md` and `examples/three-stage.md`, and the repository guideline
`AGENTS.md`.
The chosen mechanism is a **per-item note file** at `docs/notes/<slug>.md`: when a
change makes a shared document stale, the item records what changed and what should
change there, commits that note with its own change, and never edits a shared document.
The chosen **single writer** is the manual-only `docs-fold` pipeline, added as a fifth
bundled starter at `examples/docs-fold.md` and listed in `examples/catalog.go` and
`examples/README.md`. Its `fold` stage reads every note under `docs/notes/`, folds each
into the shared document it names, and deletes the consumed notes in its own commit.
## Shared documents this change makes stale
Adding the fifth starter (`docs-fold`) makes the following documents' starter counts
wrong. They were deliberately **not** edited by this item; the `docs-fold` writer should
correct them when it next folds notes.
- `README.md:191` — "To skip authoring, use **:templates**, choose one of the four
generic starters," should read "five generic starters".
- `docs/cli.md:170` — "Use `:templates` for four simple, manual-only starters: task,
review, research, and plan/implement/review." should say five starters and name
`docs-fold` (fold accumulated documentation notes, then commit locally).
- `internal/author/skill/references/operations.md:13` — "Four optional generic starters
are task, review, research and three-stage;" should read "Five optional generic
starters are task, review, research, three-stage and docs-fold;".
## Do not change
- `docs/first-version-testing.md:148` and the dated records in
`docs/installation-verification.md` describe a past fixture run at the time it ran;
they are dated evidence, not current counts, and stay as they are.