-
A scheduled transcript drain batches all pages admitted for the same frame so readers of several watched transcripts observe one reactive publication.
-
Transcript watch marks retain a unique view lease under the captured backend attachment and the session's native location, project and instance generation. Scalar bindings preserve that lease across catalogue hydration; hiding, session clearing and owner revocation release its visibility and memory protection. Each cleanup releases only its own lease, including after same-ID reattachment. Mounted session and child views reacquire the current attachment reactively. The acyclic visibility leaf receives authority from these producers; projection gates and the transcript LRU share its current-lease check.
-
Mermaid fences (
mermaid/mmd) use only@mermaid-js/tiny, loaded on demand and excluded from PWA precaching.lib/markdown.tspublishes a per-render token/encoded-source/completeness sidecar from actual fenced tokens alongside cached HTML; raw HTML cannot supply that provenance.markdown-mermaid.tsxconsumes the sidecar and retains source for unfinished or display-truncated fences and while streaming. Source/diagram choices remain local to the Markdown owner; copy/wrap keep the native source.mermaid-renderer.tsserializes bounded renders in one opaqueallow-scriptsiframe with network-disabled CSP; returned SVGs are image documents rather than host HTML. Keep 50,000-character/500-edge input limits, a 2M-character SVG ceiling and the initialization/render deadlines, including late-import fencing.MermaidDiagramis shared with.mmdfile previews; invalid/unsupported/oversized content keeps an actionable source fallback. Regression coverage:tests/browser/mermaid.test.ts. -
Partial live projections preserve omitted resident message runs beside their preceding shared row, with leading history before the snapshot and pending optimistic sends at the tail. Shared rows follow the incoming native order. A prompt delivered from the session inbox takes the position the native message page owns: the SDK's
session.inbox.deliveredmoves the prompt's row to the reducer's tail, so a delivery that relocates a row which is not the reducer's last owes an authoritative page read — invalidated and finished like a settlement read, shared with any in-flight read and superseded only by a newer admitted execution, and published through the instance layer's frame gates (active session, latest window) exactly as live events' projections are. The outstanding read is a retirement barrier, and a verified reconnect carries the demand: after the seeded page lands, the repair resumes immediately instead of trailing behind the quiet reconciliation. No client-side ordering state survives the delivery: the reducer itself is healed, so reconnect seeding and authoritative replacement carry the corrected order. HTTP pages can contain later steps whose events are still in transit; message IDs and wall-clock timestamps remain identity/display data rather than transcript sort keys. -
Deferred media producers emit a reference only when the canonical server parser admits its encoded identities, positions and complete path. Refused or unencodable references retain the original URI. Media reads pin the published workspace occurrence and service connection across session, message and physical ownership revalidation, including undo and digest checks. One 30-second budget covers the whole request; the decompressed native response envelope is bounded to 16 MiB before parsing, and embedded URIs to 8 MiB before decoding. Responses contain only signature-verified passive raster bytes; client close suppresses further writes.
-
The message-content popup and Chat settings share
components/transcript-visibility.tsand the semantic icons fromcomponents/message-content-icons.ts; tool presentation metadata lives independently of renderers incomponents/tool-call/tool-presentation.ts. Popup styles live instyles/components/transcript-filters.css. Popup rows show a requested state at once and keep it until the save carrying it settles. Each save re-renders the transcript, so a drag sweep (dev-docs/UI_CONVENTIONS.md) saves its rows once, on release (afterSweep). Saves run in order, each built from the preferences the previous one returned; a batch of rows is sealed as it joins the queue, so a later click never jumps ahead of a preset change nor rides along with a sweep still held. -
Transcript presets are Nothing (hides the adjustable detail categories), Minimal, Balanced and Everything (
TRANSCRIPT_PRESETS); saved Detailed choices load as Custom with their effective tool column. Chat settings shows them as buttons above the table of exact default states; the popup shows the same choice as a native select under its title. A manual row change is Custom. A preset chosen over Custom saves its rows as explicit choices intranscriptCustomPreset(transcriptPresetPatch(preset, current)), and both surfaces then offer Custom, which applies them again. Escape closes an open list before the popup. Preset names are localized in every locale; covered bytests/browser/transcript-presets.test.ts. -
On a switch to Custom, the config write preserves group and token defaults that would change, deriving them from its authoritative base only for settings without a saved choice.
-
Tool groups controls exploration and shell wrappers. Turning off the eye renders ordinary cards under each tool's visibility setting; reasoning keeps its own grouping. The chevron sets the default disclosure under each group's local override. Everything opens groups by default; the other presets keep them collapsed. Standalone cards use tool identity within each transcript row. Covered by
tests/browser/full-source-copy.test.ts. -
Status Tokens are independent of message token visibility. The non-interactive
renderStatusslot keeps the session input/output/cost chips in the header in both states; collapsed they form one ellipsized line, expanded they include reasoning and wrap beside the heading. Expanded content holds descendant-inclusive totals below the header. Keep the layout instyles/panels/status-tokens.css. -
Message token disclosures keep one row in both states: collapsed shows the input/output/cost summary chips on a single ellipsized line; expanded swaps the same row to all six chips beside the chevron, which wrap onto further lines when narrow instead of truncating (expansion exists to read every value). Messages and Status share
components/usage-metric-chips.tsxandstyles/components/usage-metrics.css; message row geometry lives instyles/messaging/message-usage.css. -
Tool-result images retain native
state.contentand render through the sharedcomponents/tool-call/output-images.tsxsurface, including MCP and specialized tools. Keep image bytes out of text projections (copy/search/speech); image styles live instyles/messaging/tool-call/images.css. -
Tool image elements use native lazy loading so only shown images load.
- Remote blob images accept only signature-verified PNG, JPEG, GIF, WebP, AVIF, BMP and ICO, with their canonical passive MIME type (
lib/passive-image.ts). Inline data images use plain fetch with credentials omitted and the same byte gate; reject externally supplied blob references. Keep SVG, HTML, unknown formats and non-image bytes out of previews. Remote blob image interactions suppress opening as a document (including linked images, middle clicks, dragging and context menus); direct navigation to an admitted blob remains passive by its verified format and MIME. Never convert an active remote response into a UI-origin blob document. Server response CSP protects server URLs; blob documents use their creator's origin, so verified bytes and canonical MIME govern their admission. Local image sources and their server CSP stay unchanged. - Explicit attachment downloads reuse an already resolved image source or fetch through the same owner/URL checks under the attachment's lifetime. Unverified bytes become an
application/octet-streamblob for the download action only; revoke the object URL after dispatch. - Transcript pages carry large tool images by reference: the UI's native message list reads (
lib/sdk-manager.ts) and history windows (fetchHistoryWindow) send thex-codenomad-media: deferredopt-in (server/src/opencode/session-media-contract.ts), and the server replaces each tool image data URI overINLINE_MEDIA_LIMIT(32 KiB) with a/api/workspaces/<id>/session-media/<session>/<message>/<part>/<index>/<sha256>path (opencode/session-media.ts). Mounted tool images, matching Markdown images and attachments selectbackendOf(instanceId)throughlib/media-source.ts. Local sources retain their exact strings and deferred-path joining contract. Remote owned session-media routes load through the selected backend's authenticated fetch into a blob URL; other same-origin HTTP sources use plain fetch with credentials omitted, and public external HTTP images retain their direct URL. Credential-bearing HTTP URLs are rejected for remote media. Attachment authority and the resource lifetime fence admission and every response/body await; replacement, unmount and revocation release blob URLs and clear displayed sources. Missing backends leave media unavailable.routes/session-media.tsserves the bytes of the owned session's native message, pinned by the digest and refused at or after an undo boundary, as an immutable sandboxed image. Single-message reads (session.message.get: pruning revisions, previews), live events, user attachments and requests without the opt-in stay whole, so revisions hash native content. - Markdown images of local file paths (
C:/…,file://, absolute or relative POSIX paths) cannot load in the renderer.lib/markdown.tsrenders them as their alt text in aspan.markdown-local-image, andcomponents/markdown.tsxswaps the label for an<img>with the source of a completed tool image of the same path already in the session's loaded messages (lib/markdown-local-images.ts: the image's file name or its single-image tool'sfilePath; Windows paths compare case-insensitively, a relative path must match one known path's end). Only blocks containing such a label read and track the session's tool parts, and only matched image sources acquire mounted media resources. Never fetch local paths through a backend route for this; an unmatched path keeps its alt text. - Bare file paths in session-bound markdown become file-reader links through the same routing, tooltips and plain-click semantics as markdown links, but only when the path resolves inside the session's worktree and a directory listing confirms the file exists (
components/markdown-bare-paths.ts: candidate extraction inlib/markdown-bare-paths.ts, one coalesced TTL-bounded parent-directory listing per worktree directory, fail closed). The pass runs after each HTML commit and re-reads the container after its listings land. Prose tokens contain every script's letters, marks and digits as file-name content: a token carrying them offers its integral reading first (the whole token as one path), falling back to boundary readings where edge letter runs glued to word characters trim as surrounding prose, edge runs whose inner neighbour is a separator are the path's own segments, and interior runs split as connectors. A reading whose literal, verified target and generated destination could disagree — a percent escape that decodes, a#fragment — stays plain, and a token rooted at a doubled separator is one URL that yields no readings; the cap counts readings (the integral probe plus every boundary piece, one file lookup each), not tokens. Inline code links only when its entire span is one literal path; the link uses the verified worktree-relative path. Fenced code, inline code with nested markup, existing links, local-image labels, paths containing spaces and unresolvable or missing paths stay as rendered; directories link only wherecanOpenLocalPathsholds. Coverage:tests/browser/markdown-bare-paths.test.ts. - Local path links follow the loopback rule (plain click in the app, Ctrl/⌘ or middle click outside) with the system as the outside.
canOpenLocalPaths(lib/workspace-open.ts) holds on local desktop windows over the local backend whose host exposes theopenLocalPathaction (Electron preload, Tauriopen_local_pathwith__CODENOMAD_LOCAL_PATHS__); elsewhere, including older hosts,file:URLs keep browser defaults and worktree paths the file reader. Worktree containment accepts both the service and the host spelling (worktreeLinkPath). There,localLinkPathturnsfile:URLs, worktree paths (in the host or service namespace; service paths at or under the worktree map onto the host directory), other absolute paths and paths relative to the session directory into absolute local paths.file:URLs, paths outside the worktree and external clicks open with the system (keep: "none"); a plain click on a worktree path asks the host to leave text files (keep: "text", the reader's own test: at most its 5 MiB read limit, no NUL byte and valid UTF-8 in the first 8 KiB) or, for an image name, every file (keep: "files") to the reader, which then opens under the click's surface gesture so any later surface change wins. Hosts check for an absolute local-disk path before any filesystem access (never UNC or device paths: off the disks they leave the path to the reader, or refuse it undernone), answeropened,kept(the reader shows it) ormissing(aNot foundnotice for every click) while other access errors fail, never read special files (FIFOs, devices) and open through the guarded default opener; Electron keeps these reads off the main thread. Failures show an error toast fenced by the backend operation. Decorated local links carry their target path before the action text (markdown.link.systemOpensforfile:URLs).markdown.tsxtakes middle clicks fromauxclick. Coverage:tests/browser/markdown-session-links.test.ts. - Remote media resolves session-media paths through the owning backend's relay and admits same-origin absolute URLs only inside that owner's namespace. Namespace comparisons use the root origin and path; the media request retains its relay authority query and header. Absolute data and public HTTP sources retain their own URL resolution and passive-image admission rules.
- Sanitized remote HTML images with
/,./or../sources become the existing local-image labels before insertion into the reading DOM. Markdown cache modes include this owner policy; aside answers and workspace Markdown pass their instance identity. Local HTML image sources retain their exact strings.
- Code Mode reads native
metadata.toolCallsintool-call/renderers/execute-data.ts; keep call-list styling instyles/messaging/tool-call/execute.css, with native image/output ownership in the shared tool shell. A completed object or array result arrives as compact JSON (with optionalWarnings:/Logs:blocks):executeOutputForRenderdisplays it indented within size and nesting-depth bounds, while copy keeps the native text; strings, errors and other output use the shared rendering. - Subagent cards (
tool-call/renderers/task.tsx) treat completed calls withmetadata.status: "running"as background launch acknowledgements.subagent-report.tsselects the latest hidden synthetic<subagent sessionID state …>or<background-result kind="subagent" sessionID state …>report within the call's delivery range: execution start (time.ran, else creation) through the next continuation of that child, ordered by creation time then message id, never list position. Every idle period reports; a continuation before any report joins the next reporting period. Arunningreport retains background ownership. Calls storing a result in their tool output show that output. The card's prompt and report panes render the subagent card pane character bound (TASK_PANE_RENDER_CHARACTER_LIMIT,dev-docs/TEXT_DISPLAY_BOUNDS.md) and its steps list mounts its newestTASK_STEP_MOUNT_LIMITrows with the gap placeholder's reveal mountingTASK_STEP_REVEAL_STEPmore; a non-following reader's window holds its anchor instead of sliding, and search navigation reveals a hit's part wholesale. Coverage:tests/browser/tool-card-bounds.test.ts. latestChildStateand the renderer'sgetHeaderStatusdrive every card of that child from launch/continuation until its newest round reports terminally; duration ends at that report's delivery time. Reports arrive through synthetic stream messages or the authoritative reconnect page. Keep settlement (hasUnsettledToolRow,hasStrandedFinishedRoundTool,refreshSettledSessionMessages) on native part status; never use the display override to trigger parent refreshes.- Deferred bodies release while the displayed child state is live or failed. Their birth check reads native part status; evaluate overrides first in a tracked render, never untracked setup. Renderer context
instanceId/sessionIduse getters across reused rows. The message store owns one report/call-time index per parent-session revision and message-id list; eviction, reload and store replacement rebuild it. Coverage:subagent-report.test.ts,tests/browser/task-copy.test.ts. - A shell call the user interrupted fails with its output so far followed by
metadata.notice, flaggedmetadata.interrupted.tool-call/renderers/bash-data.tsrenders the part before the notice like a finished call's output and the shell'sgetErrorTexthook shows only the notice under the error label; other failures keep the whole error. Covered bybash-data.test.tsandtests/browser/tool-images.test.ts. - Native websearch text is parsed conservatively by
tool-call/renderers/websearch-data.ts; unknown/oversized responses use the shared raw renderer. Recognized provider-consent Forms retain the generic schema/answer path, with layout instyles/messaging/tool-call/websearch.css. - Session lifecycle features use OpenCode V2's published signals: one
session.execution.{succeeded,failed,interrupted}per busy period (lib/native-execution-events.ts) andsession.retry.scheduledfor provider backoff. The schema-declaredsession.idle/session.statusare never published; never wire a feature only to them. A terminal event is a hint untilsession.activeconfirms settlement, which alone announces "A session finished", only for root sessions ending in success, failure or an inactivity stop. Transcript reducers retire at settlement, deferred while prompts stay parked in their inbox or a user shell or unsettled tool call still needs reconciling there. A tool part stillstreaming(rendered "pending") once a settlement drained has lost itscalledtransition:session.tool.successreduces solely from the running status (a laterfailedcan still settle it). Symmetrically, admission drops asession.tool.calledwhose newest matching part already holds a terminal status: the reducer would overwrite the settled state wholesale (flipping completed tool images back to "running" until a settlement read healed them); native tool IDs are unique per step, so a legitimate call never lands on a settled part. The SDK reducer already answers a terminal event whose transcript holds a streaming or running tool by invalidating and re-reading messages, but that refresh is dropped while the stream is not connected and never publishes its result; the terminal event therefore finishes the read itself (finishOpenCodeDataEvent: onemessage.syncthat shares the SDK's in-flight read when connected and starts it when not) and projects the reconciled page, which keeps the display window's membership. Only a newer admitted execution suppresses that publication — same-round activity such as a late terminal tool event must not leave the repair unpublished. Non-event settlement evidence finishes the same read through the same fence: the liveness activity read observing that a run the UI still believed working has settled (observeNonEventSettlement, reported bysession-api), and an authoritative inbox sync that drops an item the reducer admitted (a delivery or cancellation without events, whose user message may never be admitted either). A tool still streaming or running in a finished round once a latersession.step.startedreduced (reconcileStrandedRoundTools, hooked after both the direct emit and the queued replay, where the scan runs at the task boundary between replay chunks) lost its terminal event mid-execution: the loop feeds every tool result back before it continues, so waiting for the settlement read would keep its spinner live through later rounds (and a quickly following execution would suppress that repair). That reconcile and every settlement read share one in-flight reconciliation per transcript (settlementReadPending); covered byopencode-data-settlement.test.ts. Token/cost lines (components/message-usage.tsx) appear once per agent message: the row of an assistant message's final text (the one carrying "delete tools and reasoning") renders, once that message has native usage, the sum (sumMessageUsage) of its own usage and of every message holding a tool or reasoning part that cleanup selects (technicalCleanupParts). Reuse that selection rather than a separate projection. The line renders inside the content row, so it never shifts<Index>items or splits a technical group (whose Delete needs two tools); tool-only steps get no line. A message whose text is followed by tools also counts in the next message's line, as its tools belong to that selection. Sums cover the loaded transcript window only, like cleanup. Capture real streams withscripts/test-session-lifecycle-native.mjs. - Native transcript events reduce only through
stores/opencode-data.ts(never add another partial-part reducer), which publishes bounded snapshots throughhydrateMessages(message-v2/instance-store.ts); these per-event re-projections must not invalidate unchanged messages:hydrateMessagesreuses the residentMessageRecordobject whenever content, explicit timestamps and prompt-display metadata are unchanged, and an identical whole snapshot returns before any store write or session-revision bump. Part/info comparisons use allocation-free structural equality (partDataEqual), neverJSON.stringify. REST/history loads opt into chunked hydration (chunked: truethroughseedSessionMessagesV2): batches larger thanHYDRATE_CHUNK_SIZEcommit in chunks acrossscheduler.yield(or macrotask) boundaries, reaching exactly the single-pass state with one session-revision bump; a jump to a different window reveals its prefix progressively, a reload of the same window keeps the membership list stable while its records land, and any concurrent structural write or newer chunked snapshot fences the remaining chunks — thefalseresult routesloadMessagesinto its existing revision-conflict retry. The SDK reduce mutates rows in place, so reference identity can never prove a session unchanged — never add a reference-anchored projection skip. A session's reducer is replaced (authoritative resync after an overflow, rotation failure or reconnect; pruning invalidation) only throughreplaceTranscriptEntry, which bumps the transcript'sentryRevision; reactive readers of the reducer, such as the inbox behind queued badges (getOpenCodeSessionInbox), track it so they rebind instead of keeping the disposed reducer's last state (opencode-inbox-rebinding.test.ts,tests/browser/session-rendering.test.ts). - Event-driven projections coalesce to the frame level through
stores/opencode-projection-frame.ts: structural events reduce synchronously and in order, while pure content deltas (session.text.delta,session.reasoning.delta,session.tool.input.delta,session.tool.progress) classify at admission — drop and divergence semantics unchanged, their emit never changes the fragment counts or tool-part existence the classification reads — and reduce together in one Solid batch per frame through the transcript's content lane instores/opencode-data.ts, preserving admission order with one reducer write per frame (a bounded timer while the window is hidden; environments without a frame scheduler use a plain timer). Any structural event, reducer page read, settlement read or projection for the session reduces the buffered deltas first; a replaced reducer or collapsed queue drops them, because the authoritative page supersedes. The projection into the message store runs at most once per animation frame per session, always from the reducer's newest state. Store readers lag at most one frame. Session selection writes (writeSessionSelection) and visibility transitions flush pending pages; transcript eviction and instance teardown cancel them; destructive events (session.deleted,session.inbox.cancelled,session.revert.committed) and forced authoritative publications still project synchronously and subsume the pending frame. Projections and stream invalidation gate on watched transcripts — the active session plus any child session whose task renderer keeps its transcript visible (stores/session-transcript-visibility.ts): watched children project streamed steps like the active session instead of dropping their loaded page per event, while an event admitted while its session was watched but no longer watched at frame time invalidates the loaded page so the next activation reads authoritatively. Covered byopencode-projection-frame.test.ts,session-child-transcript-watch.test.tsandtests/browser/streaming-projection.test.ts; the content lane byopencode-data.test.ts. - Reducer page reads (the SDK's
message.syncthrough themessage.listproxy increateDataEntry) flush buffered compaction text, snapshot the session's live rows, fetch, flush again and answer with the page merged against that snapshot (stores/opencode-data-read-merge.ts), so buffered text is reduced exactly once: the page is the base and keeps its cursor, a live row new or changed since the snapshot keeps its live version (a row changed only in its roottime.completed, which SDK step boundaries stamp, takes the page's version) except for its identified content parts, such as tool calls, left unchanged since the snapshot, which take the page's version so progress on one tool never hides authority for another, while a part only the page holds joins the live row beside its page neighbours, parts pairing by ID or, for text and reasoning, by kind and ordinal (a row created during the fetch takes only identified parts), so a recovered part never crosses the fragments around it; a live row unchanged since the snapshot takes the page's structure, plus, while the page row is open, the live fragments the page does not hold yet. Every text and reasoning fragment of a row both sides hold then follows one rule by kind and ordinal (chooseFragment): in a row the stream changed during the fetch the live fragment stays unless it is owed (below) and the page holds it committed; otherwise a fragment the page holds committed (positive evidence only, below) takes the page, a live fragment the page's text only prefixes (a stream only appends, and an open fragment is persisted late, often empty, even when other kinds follow it) keeps its live text, and the page decides the rest. A fragment one side alone holds keeps that side. Rows created during the fetch and absent from the page ride along newest-first. Only events that remove or replace content (invalidatesFetchedPage: deletion, revert commit, inbox cancellation, compaction start/end/failure) restart the read; streamed text, reasoning, tool progress, compaction text and new rows merge, so a continuously streaming session completes its read in one fetch. Live versions are reconciled by the native full-text endings and the SDK's end-of-round refresh. A first latest-window load (loadMessageswith no resident rows and no stored window) merges its 200-row page the same way and commits it while live revisions advance. Every committed latest-window page then offers the session reducer its newest 20 rows, the SDK's own page size, without another read (seedOpenCodeSessionMessages), because the reducer applies streamed events only to messages it holds: an empty reducer is seeded unless the session is known idle, and a reducer holding rows (a parked inbox row, an earlier step) is reseeded when it diverged or lacks an open assistant message of the page. Reloads and history windows keep the revision checks, so a reseeding reload saw no transcript event during its fetch. Covered byopencode-data-trailing-read.test.ts,opencode-data-read-merge.test.ts,session-api-running-open.test.tsandopencode-data-divergence.test.ts. - A live event that edits an assistant message, or its text, reasoning or tool part, the reducer does not hold (its start was missed: disconnect, dropped routing, a reload) or that makes the reducer throw marks the transcript diverged (
stores/opencode-data-divergence.ts). A watched transcript with rows or a displayed page repairs at once: one authoritative read through the settlement path (completeSettlementRead, gated publication, shared with an in-flight read, rows streamed during the fetch kept by the read merge, a newer execution or replaced reducer fencing publication) reseeds the reducer, so later events apply. A missed part is settled only once a page holds that part (the tool by ID), not merely its message; text and reasoning fragments follow the obligation rules below, and an ambiguous partial-fragment delta is owed only to settlement. A burst of misses shares the pending read; each reducer gets three repair reads per execution, and a settlement (terminal event or non-event settlement evidence) of a still-diverged watched transcript owes one more beyond that budget and holds retirement until it lands. Unwatched sessions and reducers still awaiting their first page never read: their next latest page reseeds the reducer. Reconnect, overflow and rotation recovery already own authoritative replacement and skip the record. - Every live event is fitted to the reducer before it reduces (
fitLiveEvent,stores/opencode-data-fragments.ts). Native ordinals count a step's text and reasoning fragments separately from 0 with one fragment of each kind open at a time, tool IDs are unique per step, and a step restarts on its message only before producing output; the SDK edits a message's latest fragment of the event's kind. Against a row holdingcountfragments of that kind, a start for ordinalofits whencount === oand a delta or ending whencount === o + 1. More is a delivery behind an authoritative page (seed, repair or settlement read) and is dropped, as is a tool input start for a tool ID the row holds; fewer means the fragment's start was missed: the event is dropped (it would edit an earlier fragment) and records a divergence keyed by its ordinal. Each authoritative page also records the provenance of the fragments it installed exactly as fetched (the read merge kept no live version). Only positive evidence commits a fragment: its message completed, or its own ending (the native writes a text part's provider state,native, only when its ending commits, and stamps reasoning'stime.completed; reasoning carries its provider state from its start, which proves nothing); text stays open while reasoning or tool parts follow it. A committed fragment drops later deltas as redeliveries, while an open fragment holding text cannot tell a redelivered delta from a new one, so the delta applies and its fragment owes the settlement read. A fragment's obligation (missed start or ambiguity) settles only through its own full-text ending or a page that installed it committed, never because a page holds its ordinal; since the read merge gives an owed fragment's committed page content precedence even in a live-changed row, the settlement read, taken after completion, wins for it. Events without an ordinal keep the SDK's behavior. - Non-event settlement (
refreshSessionRuntimeStatus->observeNonEventSettlement) covers working runs and in-session pending prompt admissions (generationRecovery === "pending"with a livegenerationAdmissionEpoch). When a watched transcript settles without a terminal event, it reconciles throughcompleteSettlementRead(gated publication) even with no unsettled tools or divergence; when no reducer is resident, or an unwatched diverged transcript did not repair, the caller reloads watched latest-window sessions throughloadMessagesand invalidates other loaded sessions. Onsession.execution.succeeded,refreshSettledSessionMessagesalso reloads a watched latest-window session whose displayed transcript still has pending sends, ends on a user message or is loaded empty. Authoritative resyncs without a registeredonResyncedcallback publish synchronously throughpublishResyncedTranscriptPage(preserveOmitted: falseand pending-request reconciliation). Failed coalesced frame projections retry on bounded backoff (PROJECTION_RETRY_DELAYS_MS) and trigger an authoritative reload (reloadFailedProjection, or immediate reload on a failed retirement flush or synchronous projection error) when retries exhaust on a watched latest-window session; reconnect resyncs run the active session'sloadMessagesin parallel withreloadWorktrees,syncPendingRequests,refreshVolatileInstanceStateandsyncLoadedSessionInboxes(passing the pre-invalidation loaded set to inbox sync). - Manual playback and Classic share
lib/speech-playback.ts, which consumes one binary synthesis response as a Blob or via MediaSource. Each caller supplies its cancellation lifetime. - Manual playback keeps one active hook owner by callback identity. Content identity changes and disposal abort that owner's request and audio. Completion resets only the current playback controller, including when multiple mounted views share a content identity.
tests/browser/speech-lifecycle.test.tscovers recycled tool cards and playback cancellation.