Skip to content

feat(ai): unify conversation process display across Web and ACP - #352

Merged
ice-black-tea merged 15 commits into
masterfrom
feat/ai-shared-turn-process
Nov 23, 2026
Merged

ice-black-tea merged 15 commits into
masterfrom
feat/ai-shared-turn-process

Conversation

@ice-black-tea

@ice-black-tea ice-black-tea commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Implemented

  • Project root tool lifecycle into a shared, display-safe SDK type and reuse the same row/key in live Chat and committed History. Chat transport excludes raw tool arguments/results, provider diagnostic fields, and nested execution content. Direct execution diagnostics remain separate.
  • Use the existing durable SQLite admission in both local CLIs, with no extra coordinator. ACP returns a typed busy response, cancels only its own admitted execution, and replays committed history with native ACP notifications.

Local verification

  • 81 focused Python tests and 21 browser DOM scenarios passed, including two independent processes sharing a SQLite session, unrelated sessions, stable busy-receipt replay, exact cancellation, and live-to-history rendering. A matched synchronous sample had 139 SQL statements on both the old and new local compositions.
  • First CI found a stale test importing the removed private ACP mapper. The test-only follow-up aa06c908 exercises the public prompt contract and keeps terminal/EOF/cancellation/CLI coverage. 49 focused ACP and stream tests passed; replacement CI passed 15/15. Both affected test shards skipped the 16 real-protocol cases because the optional ACP dependency was absent in CI; the local ACP package run is separate, and target-client compatibility has not been verified.

Review follow-up

  • Preserve the original model-response position for each declared tool call, including metadata-only live subscriptions. Web uses the same order as committed History even when parallel results arrive in reverse order. No additional SQL, schema, or lock path was introduced by this follow-up.
  • Head 05cbedea: architecture gate and 119 focused Python tests with the optional ACP SDK present; 21 browser DOM scenarios passed. The real SDK regression releases the first-declared tool only after the second has finished, then compares live positions to committed History. Hosted CI for this exact head passed 15/15.

Cross-process milestone notices (39bc84e1)

  • Supported POSIX local CLI processes sharing the same private SQLite workspace can publish admitted occupancy, display-safe root tool progress and release to multiple Web consoles. Notification cannot grant ownership. A passive Web uses the authorized session SSE; client and event service avoid remote execution polling, including a local producer lost during subscription.
  • The Web receiver checks session, execution and event-read authority before delivering active tool hints. Already-loaded History supplies the prompt and terminal result. No extra SQL write or schema, queue service, or token mirror. Receiving a tool row itself performs no SQL.
  • Actual Linux shared-SQLite subprocesses covered local Runtime and optional real ACP SDK prompt delivery, authorized input and durable readback, and zero idle SELECT during the 1.2-second observation window. A deterministically lost terminal notice after commit did not falsely release the UI; explicit reconnect read the committed turn without re-execution. Peer tests cover two receivers, stale registration cleanup and port-reuse confidentiality. Architecture and 137 focused tests passed locally, including browser DOM contracts and admission-vs-handoff races. Hosted CI for this head is separate.
  • Notifications are best-effort; when IPC is unavailable or the producer exits before publication, Refresh reconciles from authoritative state. Live tool hints are not replayed as a second timeline. Native ACP v1 keeps normal prompt and committed-history behavior. Target editor, macOS and Windows IPC are not verified; Windows local IPC is disabled.

CI follow-up (6137a429)

  • Hosted run on 39bc84e1 failed: the notice receiver's eager import loaded execution dependencies during CLI help and during subprocess-only SQLite metrics initialization. The receiver now imports the projector at the tool-notice boundary. No SQLite, lock or storage changes were needed.
  • Keep the existing Ctrl-C exit status (130) after graceful Web shutdown even when the server returns without replaying SIGINT. Both real-subprocess variants verify clean shutdown with an open idle SSE connection.
  • Local architecture and 176 focused tests passed, including the formerly failing lightweight CLI, SQLite multiprocess and Web shutdown contracts. Hosted CI for this exact head is separate.

ACP workspace discovery (74f558d1)

  • Hosted predecessor CI passed 15/15. This follow-up fixes two separately reproduced failures: a Web-created session sent an empty/relative cwd over ACP and disappeared under an absolute directory filter; a native ACP session/new with an absolute subdirectory failed.
  • The ACP boundary translates between absolute host paths and existing workspace-relative Runtime paths. Blank Web cwd means the workspace root. Matching and listing use the same effective directory. Load checks the cwd in its existing authorized History detail before emitting anything, without another SQL read or storage migration. An outside workspace path cannot create or load a session.
  • A real Python ACP SDK client against the Linux lt ai acp stdio command verifies list → load for Web default/root/nested sessions and ACP creation, with exactly one committed question/answer replay, no replay on mismatch, and rejection of outside paths including a symlink. Architecture passed; 17 targeted tests passed with the optional ACP SDK, and the dependency-absent run passed 50 with 4 expected skips. This exercises protocol stdio, not an actual editor or macOS.

Conversation display scope (78e00a68)

  • In Web Chat, show the SDK's existing thinking text verbatim (including whitespace) in the running stream and committed history; omit the section when there is no text. Reuse the existing text stream and history, without provider-specific rules, new event types, summaries, or storage changes. Continue to exclude provider signatures, raw tool payloads, and nested execution content from Chat.
  • Local architecture gate and 77 focused tests passed, covering the Web API, stream handling, DOM, and unchanged ACP behavior. Previous head CI passed 15/15; fresh CI applies to this head separately.
  • Remaining validation: session discovery, reopen/replay and contention in an actual ACP editor, and local synchronization on macOS. Keep Draft pending validation.

Trace replay compiled cache (a00416c)

Reuse the Trace store's existing admission table object for Trace pages and history association queries. No SQL shape, schema, or cache setting changed. The SQLite replay regression performs eight rounds of both reads with alternating bounds and verifies unchanged results, two initial cache misses followed by 14 hits. Architecture and 88 focused tests passed; hosted CI covers this head. This measures cache reuse, not production memory.

Web and ACP review follow-up (da245b8)

  • Restore native ACP SDK thinking (live and committed replay) and preserve workspace-free embedding with logical directories. The CLI still validates absolute directories within its configured workspace. Provider signatures and raw tool payloads are not forwarded.
  • Keep rendered answer/thinking in default Web Chat until committed history replaces the preview. Successful request details and internal identifiers stay in diagnostics; partial/gapped output retains plain-language notices.
  • Local notices exclude the sender's own registered receiver before opening a connection and decode the existing typed tool row directly. Other same-process receivers still get notices; authentication, durable admission, and SQL are unchanged.
  • Architecture and 76 focused tests passed with the optional ACP SDK, including real Linux stdio and Web DOM checks. Hosted CI for this head is separate. Real ACP editor/macOS acceptance is still outstanding.

Host turn observer (28eef70)

Expose runtime.sessions.observe_turns(handler) and SessionTurnNotice as a transport-neutral, best-effort source-side callback. The trusted host schedules its own delivery and unsubscribes with the returned function. No ownership, remote subscription or replay is inferred from a notice. No SQL or transport changes. The regression covers owned SQLite, memory, a borrowed SQL engine (SQLite in test), and built-in source coordination with a borrowed engine. Architecture and 44 focused tests passed. Hosted CI is separate.

Native snapshot and batch compilation (5bf3526)

Reuse the existing bounded family of Native message/snapshot SQL descriptors across export, restore and offline object cleanup. Repeated export hits the compile cache for both unchanged Native reads and returns the same snapshot. Group record reads use existing exact bind-budget batching without a second compilation per batch. Offline dialect tests verify the 999-bind bound with all physical owners; other shape-sensitive guards remain. No DDL, transaction or round-trip change. Architecture and 56 combined focused tests passed. Current CI.

Use the same public tool facts for live and committed conversation views.
Keep local session admission at the existing SQLite owner boundary.
Import the shared tool projection only when a receiver has a tool notice.
Keep Web shutdown graceful and report SIGINT consistently even when the
server returns without replaying the signal.
Project workspace-relative session directories into absolute ACP coordinates,
use the same logical filter, and validate incoming paths before creating or
replaying a session. Exercise the actual ACP CLI over stdio.
Reuse the existing thinking stream and committed transcript text. Remove
the unused reasoning-summary process path without changing provider or Runtime.
@ice-black-tea
ice-black-tea marked this pull request as ready for review November 23, 2026 03:08
@ice-black-tea
ice-black-tea merged commit 2da4ec0 into master Nov 23, 2026
29 checks passed
@ice-black-tea
ice-black-tea deleted the feat/ai-shared-turn-process branch November 23, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant