Skip to content

Chat Stream and Tools

Wijanarko Putra Rajeb edited this page Nov 19, 2026 · 35 revisions

Chat stream and tools

Message-Footer Actions (Retry / Copy / Undo / New-chat)

  • A run footer describes the run, but its actions act on the TURN. RunFooter gets the run's owner row (its last real AI message) for model/usage/duration, and resolveRunFooters now also carries the run's own boundary: runStartIndex / runUserId (the user row that opened it, -1/'' for a transcript that starts mid-run) and answerText (every non-notice row between them, joined). An omp run spans thinking → tool calls → answer, so the owner row is almost never the row a user turn sits in front of. Measured on 498 real sessions (1453 footers): Retry fired on 19.7% of footers before and 99.2% after, and the copy payload differs from the owner row's own text on 48.4% of runs (127 runs where the old copy produced nothing at all).

  • Retry re-runs the run's opening user row, and rewinds the JSONL first. The old lookup required the owner's immediate predecessor to be a user turn and returned the list unchanged otherwise — a silent no-op that still aborted the live run, so clicking mid-stream stopped the answer and did nothing else. A real omp session now posts POST /api/chat/:id/rewind for that user row before re-sending: dropping only the client's rows left the abandoned turn on disk, and the next reload brought the "retried" answer back beside its replacement. The row-before-the-owner fallback survives for a caller that still hands over an AI row id. Both omp transports share that file: harnessSupportsRewind (shared/lib/harness/rewind.ts) allows omp-rpc and omp-acp, and the endpoint tears a live ACP child down BEFORE truncating (it holds the old context and is the only other writer); the next prompt resumes the truncated file over RPC. Another ACP agent is refused in words before its child is touched — it keeps its history in its own store and ACP has no truncation.

  • Undo and Retry live together in src/client/hooks/chat/timeline/rewind-actions.ts because they share those rules plus one more: a refusal is reported. requestRewind (client/hooks/chat/timeline/rewind.ts) returns the server's own reason, reportActionError (wired to the chat's toast stack from ChatTimeline) surfaces it, and the Undo dialog keeps itself open with an inline line as well. Previously a 400 was a bare false that only stopped the modal from closing — indistinguishable from a slow request.

  • A rewind cut point is a turn, not just a user message — and not always a record IN the file. isRewindCutPoint (server/lib/omp/session/rewind-file.ts) accepts type:"message" with message.role:"user" and type:"custom_message" with customType:"skill-prompt" — omp expands /skill:<name> into a custom record and writes no user message for it, so the route's original role test refused every skill turn with entry_not_found. A builtin command (/usage, /compact, /context) goes further: it writes no entry at all, so its timeline row lives only in Kabmo overlay under a client-side id (msg-…-user). The client therefore sends that row's own startedAt, and truncateSessionBody places a cut the file cannot name at the first file turn at or after that clock (a clock past every turn cuts at the end). overlayCutClock is the requested row's clock in that case, not the file turn's, so undoing one /usage also removes the next one; the overlay prune (pruneStoredAfterCut) drops rows at or after it, plus the file turns the cut removed. Verified over every user row of all 498 sessions: 1452 cuts, 0 refusals, 0 resurrections on reload, 0 earlier rows lost.

  • A failed Undo leaves the draft alone. The composer text is restored only AFTER the rewind succeeds: restoring it first read as "undo worked" while the turn was still on screen, and had to be cleared by hand.

  • A failed Copy says so instead of doing nothing. CopyButton disables itself on an empty payload with a reason in its title/aria-label, because 8.1% of runs genuinely have no text anywhere (tool-only or aborted turns) and the old if (!text) return swallowed the click. The run footer passes its own "Nothing to copy — this run produced no text" wording.

  • New-chat from a row carries the row's attachments, and seeds the draft as a QUOTATION. onNewChat(content, attachments) seeds NewChatModal, so an image or inlined text file is not dropped from the branched chat. The draft itself goes through seedNewChatDraft (shared/lib/chat/new-chat-seed.ts): the row's text, a blank line, then ---, so the user types their instruction UNDER the quoted message instead of into the same paragraph. Two properties of that placement are load-bearing. The blank line before --- is what keeps it a thematic break — a --- directly under a line of text is a setext H2 underline, and the timeline renders every user turn as markdown, so the seeded message would come back as a heading. And the divider sits AFTER the seed, never before: omp parses a command token at the START of the prompt, so prefixing would turn a leading /usage into prose and stop it running. Do not "harden" this by fencing the seed — a fence changes exactly one thing (a command stops being a command), while protecting nothing: nothing on Kabmo's side executes that text, and a @agent mention is rewritten by translateAgentMentions whether or not it sits in a fence (measured: raw, fenced and ----prefixed seeds all rewrite the mention). It would also turn the TUI-only names (/plan, /clear, /hotkeys) from a refused-and-reported turn into literal text the model improvises around, which is the failure composer/tui-only.ts exists to prevent.

  • The New Chat modal maximizes, and its composer grows with a ceiling. A header button toggles the card between its default 42rem / 90vh and an expanded min(96vw, 1600px) / 92vh, and the composer's textarea sizes itself to its content — useAutoGrow (hooks/chat/composer/auto-grow.ts) measures scrollHeight and clamps it between 80px and a ceiling (320px, 480px expanded), scrolling past it. The chat composer grows too, but to a LINE count: CHAT_COMPOSER_MAX_LINES (7) is resolved against the textarea's own line-height plus its padding, because the same element renders at 13px everywhere except iOS, where composer-type forces 16px to stop Safari zooming the page — a px cap would be a different number of lines on each, and the max-h-40 the phone composer used to carry cut the box at 160px, one and a half lines under the ceiling. Growth is measured only while the layout does NOT own the height: a stretched composer passes enabled: false, which clears the inline height (a h-full phone box and a min-h-[38vh] desktop box keep their own sizes) and a compact one renders no textarea at all. Two failure modes are pinned here. The card's size is applied as an inline style, not h-[92vh]/max-w-[min(96vw,1600px)] — an arbitrary-value class only exists if the CSS generator emitted a rule for that exact string, and a missing rule fails silently (the toggle reported aria-pressed="true" while the card kept its content height; measured in the browser, and the dev CSS bundle does not always regenerate). And the measurement resets height to auto first, because scrollHeight reports the height the box would need AT its current size — without the reset the box never shrinks back after a deletion.

  • The seeded bytes travel through attachmentImage, which also reads a data:…;base64, preview — the load path never sets dataBase64, so a replayed image had no payload and was silently omitted from a retry or a seeded chat. attachmentHasPayload is the one predicate the composer's send guard uses, so a replayed image is not mistaken for an unreadable one.

  • Side effects that must happen EXACTLY once never sit inside a setLocalMessages updater. Undo/Retry compute the truncated list from localMessagesRef and persist outside it; the updaters that still call persistMessages are full-array overwrites of the same row, which re-applying cannot double (noted at each site). submitNewChat's any[] became Attachment[], and committed rows are normalized through toAttachmentList rather than cast.

  • The pending "new-…" view offers the same actions as the real timeline. EmptyWorkspacePrompt renders the same rows, so ChatTimeline passes onUndo / onRetry / onNewChat into it; without them the optimistic turn's footer and its user bubble drew buttons that did nothing until the omp session was adopted.

  • A FORK shows the conversation it continues, before AND after its first send. Two halves, one slice (shared/lib/chat/timeline/fork-preview.ts → forkPreviewMessages, mirroring the server's cutIndexFor: a user anchor branches BEFORE that turn, any other anchor AFTER its turn, no anchor is the tip). While composing, useForkPreview (hooks/chat/timeline/fork-preview.ts) reads /api/chat/:source?limit=all and PendingTranscript draws those rows read-only above the optimistic turn — no Undo/Fork/New-chat (they belong to the SOURCE chat) and no run footer (the model stamp would be the fork's, and it has not run). The docked branch keeps the "Fork from" picker above the transcript for exactly this reason: switching the source swaps the rows, and its rows are keyed by source id so the previous source's transcript disappears the instant the picker moves. After the send, dispatchPendingChat prepends the same slice at adoption, because the timeline cannot read it by itself — a committed fetch is skipped while a run this page dispatched owns the rows, and a cleanly finished run never re-reads the transcript. Measured before the fix: the first forked turn rendered alone and the inherited history reappeared only after a reload; measured after, in the browser on a 2-turn source, the adopted fork's timeline held 8027fe88 (the source's turn) plus the new turn, with no duplicate ids. A per-message fork needs a transcript Kabmo can read — or an agent that takes a fork point. harnessHasLocalTranscript (shared/lib/harness/transcript.ts; harnessSupportsRewind delegates to it) is that fact: omp-rpc/omp-acp write the JSONL, every other ACP agent keeps its own store and its session/fork copies the WHOLE history with no anchor. claude and codex are the exceptions: their JetBrains-maintained adapters read _meta.jetbrains.air.fork = {version: 1, messageId} and keep the history up to that message (claude-agent-acp at an assistant message, codex-acp at the turn that holds it; gate none; claude's resolver only groups ASSISTANT entries, so a user row has no fork point). forkAnchorFor (shared/lib/chat/timeline/fork-anchor.ts) therefore keeps the anchor for omp on any row and for an AIR adapter on an assistant row only; the server sends the _meta for those two and refuses an anchored request on every other ACP harness with anchor_unsupported — before this, the button silently forked the tip, handing back turns the user did not point at. An anchor id the file does not carry (a builtin command's row, stored by Kabmo only) is still anchor_not_found, and the message now says so.

  • The New Chat dialog's first send is PARKED and fired by the render that carries its pending id — never dispatched from the handler that opened the dialog. useNewChatSubmit (hooks/chat/timeline/new-chat.ts) writes new-… into the URL, parks { pendingId, text, attachments } and lets an effect call the send path once sessionId === pendingId. The previous shape (setTimeout(() => executeSend(...), 0) inside submitNewChat) captured the render the dialog was opened in, so the FIRST prompt left against the session the dialog was opened FROM — for an omp session it landed in the previous chat, no spawn ever happened, no sidebar spinner was armed (the run had no server row at all), and the new chat showed an optimistic bubble with no stream until the operator typed a second prompt, which worked because the composer's own handler reads the pending scope. The same call carries the workspace: the pending session gets a folderId (the current session's owning folder, else the composer's pick, never overwriting one already in the URL), because the first send SPAWNS in that folder's cwd and a dialog opened from a session picked in the sidebar had no folderId at all — the send would have fallen back to the simulated stream. Verified in the browser against an isolated MOCK instance: the send navigated to ?sessionId=new-…&folderId=3, issued no POST to the session the dialog was opened from, and rendered exactly one user bubble; new-chat.test.ts fails with the old dispatch restored. The parked record also carries the SOURCE chat's harness (useNewChatOpen captures activeHarness.harness at open time; executeSend passes it as composerOptions.harness) — the dialog has no harness picker, so without it a New Chat opened from an ACP answer silently spawned on omp's RPC default and the new chat was a different agent from the answer it was started from. new-chat-open.test.ts pins the capture (and its clearing on close), and the submit test pins the option on the first send.

Generating State (timeline & composer dock)

  • One "a run is in flight" state serves the whole timeline: timelineRunning = isChatRunning(streamStatusMap, sessionId, ownRun) (ChatTimeline, hooks/chat/timeline/index.ts). streamStatusMap is the provider's sessionId → streamStatus map built from the sidebar:status topic (hooks/chat/omp/session-list.tsx), and isSessionStreaming (hooks/chat/omp/session-statuses.ts) is the exact streamStatus === 'stream' test the session item's Loader2 spinner is drawn from. The docked indicator, the streaming row's marker and the withheld run footer all read timelineRunning, so they cannot disagree with the sidebar, and a run this page did not start — a second tab, a second Kabmo instance (the status row lives in the shared database and the child belongs to whichever process owns it), a scheduled task, a page that never attached to the stream because GET /api/agent/:id answers running: false for a wrapper this process does not hold — is still reported. The server row cannot cover two windows, and BOTH must be reported or a run reads as already settled while it is still starting. (1) A pending new-… chat has no omp id until the spawn answers, so no row can ever carry it. (2) A run THIS PAGE dispatched, in the beat between the send arming the optimistic rows and the stream row reaching this client over the topic — measured at ~120-250 ms, and the reason the run footer "appeared for an instant" on every prompt: with the row alone, resolveRunFooters was handed isGenerating: false for that window, settled the run, and painted a model/duration footer over the EMPTY placeholder row, then withdrew it the moment the row arrived. The second term is ownRun — the render-visible mirror of ownRunRef, armed by the send path alone (setGenerating(true, true)) and released by the same settle paths as the run — NOT the raw local flag: an ADOPTED run (the mount probe resuming a live run's UI) leaves it alone, so a run this page did not start is still reported by the server row and never by client state. The per-frame browser proof of that window (chat.e2e.ts) was removed: it sampled the DOM every animation frame and flaked on three runs, so it reported timing rather than the footer. A THIRD source must not exist, and it is what this used to have. stream-pending was a client-side mark armed by the send path and released by onAgentEnd/onPromptSettled, and its release depended on the client naming the session id it had armed: a mark armed for a pending new-… id and released under the adopted omp uuid was never released at all, and a mark re-armed by onResumeStream outlived the run it described. It forced stream into the sidebar's folders, so isSessionStreaming read it too and BOTH surfaces kept spinning over a finished turn — the reported "spinner and generating indicator run again after the stream has finished". The whole mechanism is gone (stream-overlay.ts → sidebar-overlay.ts, which now holds only the seen-strip and the title hint). The composer's own isGenerating prop stays the flag for Send-vs-queue and the model/thinking picks deferred to the next prompt — those belong to the run this client is driving — but Stop follows timelineRunning, because a run this page did not start (a second tab on the same session, a scheduled task, the goal driver's continuation, a reload that never re-attached) is still a run, the sidebar's spinner says so, and hiding Stop for it left the only control that ends a turn unavailable with nothing on screen to explain why. The press stays honest about ownership: POST /api/agent/:id answers a stop for a session this process does not hold with session_not_running (409) instead of falling through to the spawn path (LIVE_RUN_COMMANDS, rpc/constants.ts), which would resume the session FILE — a second writer on a file the owning instance is streaming — answer abort against the child it had just created, and then, on the force_reset escalation, destroy that same child. A run streaming on another instance therefore shows the rotating COOL_VERBS fallback: no frame ever named its activity here.
  • A run omp no longer owns is settled by Kabmo, on omp's own quiescence verdict (src/server/lib/omp/rpc/run-settle.server.ts). A stream row is released by a terminal agent_end, and two shapes never send one: omp ends the turn with agent_end {isTerminal:false} (a detached subagent, a background job, a queued continuation) and the continuation never arrives, or the frame stream stops for any other reason. streaming then stays true for the life of the process, and nothing reaches the row: its owner is THIS process and it is alive, so the sidebar heal's staleness half sees a live pid and its orphan half only releases rows whose run this process does NOT hold; and GET /api/agent/:id answers a busy session from local flags precisely so a get_state cannot queue behind the running turn, so the one reconciler is never called. Measured on a real stranded child: the row survived 90s of sidebar loads and the attach probe answered busy:true throughout, while the transcript was complete — the reported "finished session spins forever". The repair is a probe of get_state.isSettled (omp's own "nothing live, admitted, scheduled, queued or awaiting background work"), and it is the ONLY thing allowed to settle: anything short of true touches no flag, so a mid-run probe can never blank a live run. The clock (RunSettle) is fed by every frame, fires after RUN_SILENCE_MS (30s) of quiet, and an announced retry wait (auto_retry_start's delayMs) pushes the deadline out by the wait omp promised. On a settle it reconciles the flags through buildWebState, writes finish and emits the terminal agent_end — without that frame the clients keep isGenerating and the withheld run footer armed (verified end to end: row stream→finish at t+32s with no restart, and in the browser the indicator was replaced by the settled run footer). It is armed from the module (loadSidebarData asks each live wrapper, fire-and-forget, so the list never waits on a probe) and awaited from the attach probe, which is where the user's own click lands.
  • A provider retry is NAMED, because the run legitimately stays open across it. omp replays transient provider errors by itself (retry.enabled, retry.maxRetries, honoring the provider's retry-after) and each retry announces itself with auto_retry_start and opens a fresh agent_start — no agent_end in between, so the sidebar spinner and the indicator were correct while the timeline said nothing about why nothing moved (measured: 2m43s on a real quota wall, last visible row an error). shared/lib/chat/timeline/provider-retry.ts folds those frames: the indicator reads Retrying after a provider error 2/3 · next in 7s, and the FIRST attempt of a saga (attempt === 1) leaves one persisted notice row so a reloaded chat still records it. The phrase is sticky for the saga's duration (providerRetryVerbRef, consulted by setActivity) because otherwise the attempt's own frames name a phase — turn_start/agent_start say "Thinking…" over a request that is about to fail, which is the uninformative spinner this replaced. Two traps are pinned by tests: the saga's own agent_start re-enters the loop and onAgentStart writes the indicator directly (bypassing the mirror), so the override must publish even when the mirror already holds the phrase; and a terminal agent_end closes the saga, since it can arrive with no auto_retry_end in front of it. Never settle a retrying run: get_state.isSettled is false throughout one (verified against real omp), which is what lets the two mechanisms share one predicate.
  • A committed history fetch never lands while a run THIS page started is live; the guard is keyed on ownRunRef, never on isGeneratingRef and never on the AI placeholder. useSessionLoad (hooks/chat/timeline/session-load.ts) skips the /api/chat/:id payload entirely — no replace, no merge, no emptying — while a run THIS page dispatched is streaming, because that payload is a LAGGING snapshot: for a fresh spawn omp may not have written the session file at all (its writes are buffered until the first assistant message settles) and it never carries a segment still streaming. Keying the guard on the AI placeholder instead (isGenerating && aiPlaceholderIdRef) re-opened it mid-run, because the stream releases the placeholder at the first assistant message_end while the run continues — and both failure shapes were measured on real sessions: an empty payload emptied the list (the just-sent turn vanished), and a payload carrying the file's own copy of that turn was merged UNDER the live rows, whose ids differ (msg-…-user vs the echoed id), so the turn rendered twice. Keying it on isGeneratingRef alone was worse and is the bug this fixes: the mount probe that RESUMES a live run's generating UI (useOmpAgent → onResumeStream) sets that flag too, so merely OPENING (or reloading) a session another writer was streaming discarded its whole transcript — measured on a real 333-message run: 0 rows on screen with only a Load earlier messages button, whose click paged a window into an empty head and so appeared to do nothing. ownRunRef is claimed by the send path alone (setGenerating(true, true) in hooks/chat/timeline/send.ts) and released by setGenerating(false), so a run merely ADOPTED still loads its history and an empty payload still clears a non-pending session. session-load.test.ts pins every direction (the own-run skip, the adopted-stream load, and the idle mount's load/clear).
  • The docked indicator names the WAIT when the run's identity is not known yet, instead of drawing an empty one. A fresh spawn has no provider/model for its first seconds: a pending new-… session has no sidebar row yet, so runModel is null, and the resolved model only arrives with the spawn response (seedSession). GeneratingIndicator therefore renders Loading… when neither half resolves, rather than a bullet with nothing in front of it (• Thinking…, which is what the first prompt of a new session showed — measured in the browser: Loading... until the spawn answered, then Kenari · Deepseek-V4-1-Flash · Thinking…). One half is enough to name the run: a provider-only identity still says which account is answering. The rule lives in the SHARED component, so the chat dock, the empty-workspace view and the BTW panel cannot disagree about it.
  • A LIVE stream row is preferred, never trusted blindly — and the row itself must carry the model. Reported as "the indicator still says Loading… while the answer streams". Two independent gaps produced it. (1) runIdentityFor (hooks/chat/timeline/run-identity.ts) read liveRun ? runModel : (fallbackModel ?? runModel), so a stream row with no pair discarded the session metadata that DID name the run; it now reads liveRun ? (runModel ?? fallbackModel) : (fallbackModel ?? runModel) — the row wins when it has an answer, the metadata answers when it does not. (2) The row could genuinely have no pair: agent_start/turn_start/message_start (server/lib/omp/rpc/frame-fold.ts) are the only writers for a run whose prompt never went through the dispatcher (a queue delivery, a scheduled prompt, a resumed child), and they wrote the status alone; syncRunModel (server/lib/omp/rpc/run-model.ts) then skipped its write whenever the wrapper already knew the unchanged pair. The fold now passes host.runModel into every markStreamStatus(…, 'stream', …) (the upsert's COALESCE keeps a pair a dispatch stored), and the probe writes on every run start — markStreamModel is a live-only UPDATE whose IS NOT guard makes it a repair, and it raises stream-status only when a row actually changed. The fold's host contract moved to frame-fold-contract.ts to keep frame-fold.ts under the 350-line ceiling.
  • The pending chat's dock IS the real timeline's dock, in one frame. A fresh spawn draws the generating indicator in EmptyWorkspacePrompt (the new-… branch) for the seconds before adoption, then swaps to ComposerDock — the same row, built by two wrappers. They drifted: the pending branch kept the landing page's p-8 column and its space-y-3 stack, while the real dock used p-4 pt-1 with its rows flush (the dock's space-y-2 sat on a wrapper with a single child, so it was inert from the day it was written). Measured with the built CSS at 1200x1400: the indicator sat 141px above the pane's bottom while the spawn was in flight (Loading…) and 113px once the run streamed (Thinking…) — the row jumped 28px at the instant the identity resolved, which is exactly why the two states read as two different indicators. Both now render ComposerDockFrame (components/workspace/chat-timeline/ComposerDockFrame.tsx: padding, chat-column, phone safe-area inset, and the relative anchor), the pending transcript reserves the real scroller's p-4 pb-10 box, and the landing page (no run to report) is the only branch that keeps the centred column. Re-measured after the fix: 113px / 113px, left edge 115px in both. composer-dock-frame.test.tsx pins that the indicator is inside the frame in both identity states and that the empty chat draws no frame.
  • The run footer is withheld from the streaming row by POSITION, never by its role spelling. resolveRunFooters skips the footer while generating when ownerIndex === streamingRowIndex(messages), and the guard must not also require the row's role to be ai: that is only the LIVE mapper's spelling, while roleFor (shared/lib/omp/session/messages-map.ts → messages-parse.ts) spells the rows a JSONL load produces for omp's developer, custom and toolResult entries assistant — and a run reopened mid-flight has exactly such a row at its tail, the last entry written before the streaming answer. Gating on ai settled the footer on the row the answer was still streaming into, which is what "the AI footer already rendered while the stream was running" was. ownerIndex only ever holds a non-user, non-notice row, so no role test is needed. Pinned by run-footer.test.ts and a rendered MessageList.test.ts mount (both fail with the role test restored), plus the timelineRunning gate above: a run this page did not start used to settle its footer too, for the same reason it hid the indicator.
  • The generating indicator's mark is a spun nine-hue ring, and it is the ONE sanctioned chroma exception. It was replaced by a bare ink badge (bg-ink + Bot) for DESIGN.md §3, and that replacement carried NO motion: the comment it shipped with promised animate-pulse, but the class was never applied, so a busy row was pixel-identical to a settled one and the only sign of life left was the ellipsis. The ring is back as .generating-mark-ring (src/client/tailwind.css), NOT as the inline conic-gradient object it started as: a component-level style block re-declared the keyframes on every render of every indicator the transcript holds, and a hex in a component is invisible to the theme tests. The spin is the shared .animate-spin with animation-duration: 1.2s, which the later reduced-motion block overrides to 3s (measured in the running app: spin 1.2s normally, spin 3s under reducedMotion: reduce, dots none at 0.7 opacity) — a stopped ring reads as a stuck indicator, a slowed one still reads as working.

Timeline Mounted Window and the Jump Rail

  • The mounted row window SUBSCRIBES to the scroller NODE, and the node is state. useTimelineRowWindow (hooks/chat/timeline/row-window.ts) attaches its scroll listener and its ResizeObserver in effects, so the effect must key on the element, never on scrollRef. The timeline paints SessionSkeleton first and swaps the real body in a commit later, and a ref's identity never changes — so an effect keyed on the ref ran once, before the scroller existed, and never re-ran. Measured on a 240-message session at open: scrollTop 9804 (the tail) with rows 0–10 mounted and a 9 374 px spacer BELOW them — a blank tail. useChatTimelineScroll therefore returns scrollNode (the element as state) beside scrollRef, and TimelineBody uses its scrollNodeRef callback as the ref. A rail click then wrote scrollTop into that spacer, mounted nothing, and read as a dead control.
  • Every programmatic landing writes behavior: 'instant', because the container carries scroll-smooth. CSS scroll-behavior applies to a scrollTop ASSIGNMENT too (CSSOM-View: the setter scrolls with behavior: auto, which resolves to the computed value), so el.scrollTop = target started a smooth animation while the reveal's correction loop re-targeted it every frame — the jump was left wherever the loop stopped. Measured: the trace walked 9 804 → 6 504 px and stayed there. writeScrollTop (row-window.ts) is the one write path for the reveal and the reading-position restore.
  • A reveal owns the viewport until it settles, and a second click supersedes the first. revealRow returns a promise that resolves on the still-frames test (or its deadline) and carries a generation counter, so two rail clicks land on the SECOND turn instead of racing. useRailJump (rail-jump.ts) holds followRef off for that whole promise, not for a frame count: a paging walk can sit still at the tail for longer than any fixed hold while a window is in flight, and the next prepend then re-pinned the bottom — measured as a jump to turn #60 of 120 ending at scrollTop max.
  • A rail tick names the id its row is mounted under NOW, not the one the committed index recorded. omp echoes the user turn LATE — after the assistant segment — while the committed /turns index already carries omp's id for it. Until that echo reconciles, the composer's optimistic bubble is still msg-…-user, so the entry named a DOM id the timeline never rendered: the click paged nowhere and then sat out revealRow's 3 s deadline, which is the reported "cannot jump to the message I just sent until I reload" (reload mounts the transcript's own ids, so it works). useUserTurns merges the pair as committed-index + mounted-row-id, and only for an entry NEWER than every committed turn still mounted — that bound is what keeps two prompts that happen to share their text from re-pointing the older tick at the new row. Evidence on this install: newest session 01a1cd73…, stored overlay row msg-1794452424895-user against JSONL user row 1bfa13df for the same prompt.
  • A jump waits for a window already in flight instead of being dropped. jumpToTurn (session-pagination.ts) used to return false while loadingOlder was set, which is exactly the state a rail click arrives in when the reader is at the head of history — the click did nothing at all. It now awaits that request (bounded by PAGE_WAIT_MS) and re-checks whether the window already carries the target.
  • The reading-position anchor stands down when something else moved the viewport. row-window.ts records scrollTop with its anchor and skips the restore if the viewport has moved more than 1 px since — otherwise a rail jump landed and was then dragged back, and the reveal and the anchor restore ping-ponged the viewport between 0 and its target every frame (measured: scrollTo writes alternating 4 913 / 0 for the whole reveal).
  • The composer's growth is a LAYOUT effect, and the timeline pins a CONTAINER resize inside the delivery. useAutoGrow writes the textarea's height before paint, so the ResizeObserver delivery for the shrunken scroller runs in the same frame; useTimelineGeometryPin (hooks/chat/timeline/scroll-geometry.ts) pins that delivery synchronously, while CONTENT growth stays deferred to the next frame (the loop fix). Written after paint, the growth was painted one frame before the pin that follows it — measured while typing: the composer grew 22 px, the scroller shrank 22, and the last row's bottom sat 22 px past the scroller's edge for a frame. A scrollTop write cannot resize the container, so the synchronous path cannot re-trigger its own observer.
  • A jump re-aims with its OWN motion, and the open jump is INSTANT. createJumpLanding.start(behavior) repeats the behavior it was given: an instant jump re-aims in the same frame the tail moves, a smooth one keeps the stall counter so a continuation never reads as a second jump. The open jump is issued against an ESTIMATE that the first window's measurements invalidate within a frame, so the watch always re-aims — and re-aiming smoothly turned "open at the tail" into a ~700 ms animated scroll through the whole session, with the mounted window sliding and rows mounting/unmounting every frame (measured: scrollTop 14 109 → 16 033 over 21 frames, mounted rows 16 → 19 → 7). The row window's correction is instant too, so it may write under an instant jump (jumpBehaviorRef) and lands the open in the commit that measured the rows; under a smooth jump it still stands down. Measured after: the open paints at the tail on its first frame, zero geometry changes.
  • A bottom jump OWNS the viewport until it has LANDED, and the landing is geometry, never a timer. createJumpLanding (hooks/chat/timeline/jump-landing.ts) re-reads scrollHeight/scrollTop every frame and re-aims (smoothly) while the tail is out of reach; jumpActiveRef releases on three still frames at the tail, with a 2 s deadline. Four things made the scroll-to-bottom button read as "sometimes dead, sometimes jumping in pieces", and each is a separate rule: (1) the guard used to be a 1 000 ms setTimeout, so a long session still measuring at that moment had its jump finished by the observer's instant pin instead of by the animation — a snap mid-flight; (2) any upward scrollTop cancelled the jump, and a measurement replacing an estimate CLAMPS scrollTop up, so a layout clamp could kill a landing nobody had interrupted — only real input (wheel/touch/pointer/key, READER_INPUT_WINDOW_MS) may; (3) the content observer and the row window both wrote positions while the jump flew, and adopt restored the OLD reading anchor over the landing, undoing it (a streaming probe measured a round ending 366 px short, the button still up); (4) a smooth scrollTo is dropped when the rows it passes are replaced, and nothing re-aimed, so the viewport simply stopped where the animation died. useTimelineRowWindow now takes jumpActiveRef (writes no position while a jump lands) and jumpCountRef (a new count claims tailPinRef, so the landing is not corrected back). Verified in the browser, desktop 1440 and phone 390: one continuous landing from the head of a 400-pair session (frames 0 → 635 → 11 624 → 14 491 → 16 693, distance 0) and 8/8 clicks landing at distance 0 during a live stream.

Markdown Tables (chat timeline, editor preview, wiki)

  • Every rendered table carries its own scroll container, because a table cannot be narrowed and the timeline scroller is overflow-x-hidden. width: 100% on an auto-layout table is a FLOOR, not a ceiling — the used width is max(100%, the sum of the columns' min-content widths) — so one long unbreakable token (a path, a 64-char digest, a URL) makes the table wider than the message box it sits in, and the scroller's overflow-x-hidden then clipped its right columns with no way to reach them. Measured inside the real timeline at 1440: a 4-column table came out 1444px wide in a 776px scroller, its right edge 696px past the scroller's right edge — desktop and phone alike. The table renderer in src/shared/lib/markdown/marked.ts now wraps the BASE renderer's own output in <div class="md-table-scroll">…</div> (delegating to Renderer.prototype.table rather than rebuilding thead/tbody, so aligned cells and escaping stay marked's business), and .prose-content .md-table-scroll (src/client/tailwind.css) is that scroll container: overflow-x: auto carrying the block's vertical margin, with the table's own margin reset to 0 inside it — a scroll container is a BFC, so a child's margin cannot collapse out and would otherwise be drawn twice. The table's width: 100% is deliberately unchanged: a table that FITS keeps its full-width look (narrow table measured exactly the wrapper's width at both 1440 and 390), and only an over-wide one scrolls itself.

  • The scope is every markdown surface, not just agent output — the same renderer serves the editor's file preview (document) and the wiki reader (wikiScope), and a table inside a user's own bubble is bounded by the bubble's max-w-[92%] clamp. Verified end to end in the browser, through the real pipeline (renderMarkdown → sanitizeHtml → the rendered row), on an isolated MOCK server: at 390px the sent user row's wrapper measured clientWidth 307 / scrollWidth 1218 and a bubble-shaped probe built from MessageItem's own classes 285 / 1142, at 1440 the sent row's 598 / 1053 — and in every case scrollLeft reached the last column (911px of range on the phone, 455px on desktop) while the timeline scroller stayed at scrollWidth === clientWidth and document.documentElement.scrollWidth stayed at the viewport (390/1440). No bare .prose-content > table remains in the timeline, so nothing is left to be clipped. Cells also gained overflow-wrap: break-word, so ordinary prose wraps before a table ever needs to scroll.

  • src/shared/lib/markdown/table.test.ts pins the wrapper per table — one wrapper per table (not one around a run of them), the table as its child, and — the load-bearing half — that it survives sanitizeHtml with its class intact, since a stripped class would restore the clipping silently. It covers agent output, allowHtml document previews and prose without a table. Note the harness trait its fixtures work around: happy-dom's sanitizer path unwraps the FIRST root element of a fragment (<div>x</div> → x; Chromium keeps it, verified with DOMPurify in a real browser), so fixtures lead with a paragraph the way a message does.

  • The inline-code chip's fill is a SOLVED palette colour, never an alpha (--theme-code-fill, CODE_FILL_PERCENT in shared/lib/theme/ink-scale.ts, emitted per palette by theme/css.ts, consumed by .prose-content code.inline-code in tailwind.css). It used to be color-mix(in srgb, var(--theme-ink) 8%, transparent) — an alpha composites with whatever is painted behind the chip, so any hover tint under it changed the code's colour mid-hover, and with it the contrast between the code and its own chip. Measured in the browser on a real session: the same /Applications/Obsidian.app chip read #e4e9ed at rest and #dce2e5 with the hover tint behind it; the solved fill reads #e0e5eb in both states, with the chip's interior byte-identical (only the rounded corners still show the surface they sit on, which is their job). At rest it is within 4/255 of the old blend. It also removes lightningcss's color-mix fallback for that rule, which was background: var(--theme-ink) — a solid ink slab under ink text.

Markdown Code Blocks (the mono face, and why ASCII art skewed)

  • symbols2 is not a language subset, and dropping it broke every ASCII box in a code block. src/shared/lib/markdown/fira-code-fonts.css is a hand-trimmed replacement for @fontsource/fira-code/{400,500,600,700}.css that kept only the latin subset on the reasoning that "this console is English-only". symbols2 is the ONLY subset carrying U+2500-259F (box drawing) and U+2000-200A (the fixed-width spaces), so ─ │ ┌ ┐ └ ┘ ├ ┤ had no Fira Code face and fell through to the next family in the stack, monospace — a system face whose advance is not 0.6 em. Measured in WebKit at 12px on the running app: M 7.2px, ─/│/┌/├ 8.502px, so a ─ border overshoots its own │ corner by 1.3px per column and an agent's ASCII diagram arrives visibly skewed (the reported "ascii render di markdown tidak lurus"). With the four symbols2 faces declared, all of them measure 7.2px and a 42-column box renders every one of its 12 lines at exactly 302.4px — verified through the real .prose-content .code-block CSS on the production build, where the last character of every line starts at the same x. The faces carry upstream's unicode-range, so the 3.5 kB files are only fetched by a page that actually lays out a box-drawing glyph. font-css.server.test.ts › "it declares the box-drawing subset" pins the four faces and the range.
  • The unicode-range on the latin faces is upstream's too, and it is what makes the face choice explicit. Without it the latin face claims U+0-10FFFF and the box-drawing glyph resolves by "last declared wins" for the U+2000-200A overlap; with it each face states exactly what it covers. Neither form changes a glyph the latin subset actually contains.
  • Decorative symbols are still off-grid, and that is not fixable by a subset. ◇ ◆ ▣ ▤ ○ ● ⌕ ⚙ ☁ ✦ ⌘ are in no Fira Code subset at all, so they resolve through the system fallback. They do not break a box's borders (measured: every line of a 42-column box still ends at the same x), but a diagram that pads a line with them instead of spaces will not line up.

Tool Render Styles (card / compact / trace / minimal / tui)

  • A tool call is drawn by one of five styles, chosen in Settings → Chats → Tool Calls (toolRenderStyle in the kabmo_settings blob; default card, the style Kabmo shipped before the setting existed). The modes are card (bordered accordion), compact (one status line, facts inline), trace (vertical rail per section), minimal (a faint line read as part of the answer) and tui (omp's own terminal frame: a rounded box whose head is one status line and whose foot carries the quiet facts). The names and the copy live in shared/lib/chat/timeline/tool-render-mode.ts; the renderers live in tool-renderers/styles/, one file each, and ToolCallingSection maps mode → component with a total Record, so a mode added without a renderer is a build error rather than a silent fallback.
  • What a call SAYS is derived once, in useToolView (tool-renderers/shared/tool-view.ts): the header, the subtitle, the facts, the plugin panel, the fallback Input/Diff/Output. Four styles each deriving their own would be four copies of one fact — the way a card and a rail start disagreeing about what a call did. What a call SHOWS when opened is likewise one component, ToolBody, shared by every style.
  • Every style keeps the same expand contract. toolToggleLabel (tool-renderers/shared/toggle-label.ts) is the one wording: Expand <Title> — <subject> / Collapse …. chat.e2e.ts collects the transcript's tool rows by [aria-label^="Expand "], and mobile.e2e.ts / tool-diff-scroll.e2e.ts click /^Expand Bash/ and /^Expand Edit/; a style that invented its own wording would read as a card with no title, and the specs would pass while the accessibility tree lost the subject. styles.test.tsx mounts every style through the real section and pins the label, the intent heading, the open/close cycle and the failed-call marker; styles/Tui.test.tsx adds the terminal frame's own facts — the border takes the call state, the head ends in a bracketed outcome word, facts are ·-joined text, and a diff keeps +N green and −N red inside one statement.
  • A transcript block's open state is SESSION state, because the row it lives in can be unmounted at any moment. The timeline mounts a WINDOW of rows, and an expand is itself a window event: the block grows its row, the next measurement corrects the scroll, and the row can leave the window and come back. A block that kept its openness in a local useState came back closed — measured in the browser on a real session, one click on a thinking accordion removed and re-added every row at the window's edge (3 rows per expand on a 14-row session), and whether the block survived depended on how much content sat below it, which is why it read as "sometimes it works". Both halves are now stated once each: useToolOpenState (chat.toolOpen) and useThinkingOpenState (chat.thinkingOpen, client/hooks/chat/timeline/thinking-open.ts) persist the reader's own choice per session and per block id, and only a choice is written — a generating run still opens itself, and that default is never persisted, so a reloaded transcript does not carry a row per thought. ThinkingSection.test.tsx pins it through the rendered control: a click, a full unmount/remount of the row, and the block still open — plus a mid-run close that must stick.
  • A thinking block opens for the whole LIVE RUN, not only while its own segment streams. A warm session (the second prompt, a continuation after a tool call) delivers a thinking segment's first message_update and its message_end inside one animation frame; the coalescer flushes the update and the terminal frame in the same tick, so the block mounts already finalized with thinking.isGenerating === false and the old default (defaultOpen || isGenerating) left it collapsed for the rest of the run — the reported "thinking sometimes does not open". MessageList now computes the live run as every row after the last user turn (lastUserIdx) and passes isLiveRun down; ThinkingSection feeds isGenerating || isRunStreaming to useThinkingOpenState's autoOpen, while the pulsing dot and the body's tail-follow still read the segment's own flag. A historical block before the last user turn stays closed, and a reader's explicit close still wins (choice ?? local). Pinned by ThinkingSection.test.tsx (a finalized segment in a live run opens, in a settled run stays closed, 50 coalesced mounts all open) and MessageList.test.ts (the live-run boundary).
  • A measurement corrects the scroll in the SAME commit, and a reveal owns the viewport while it flies. useTimelineRowWindow used to capture an anchor and write it back from a second effect; that restore ran with the PRE-measurement layout, consumed the anchor, and left scrollTop state stale for the next commit, so the mounted range stepped back a row and then forward again. The correction is written inside adopt against the freshly laid-out rows (and into scrollTop state in the same commit, so the window describes the frame the reader is looking at). The other half of the rule: a running revealRow re-writes its target every frame, so adopt adopts the measurement but does not touch the position while revealingRef is set — without that guard the two traded the viewport (measured before it existed: scrollTo alternating 0 and its target for a whole animation). row-window-reveal.ts holds the reveal loop; row-window.test.ts pins that a row growing above the viewport keeps both the mounted window and the reader's row.
  • A measurement ABOVE the viewport keeps the ANCHOR, never the tail. The row window measures its overscan rows, and a measured height differs from the estimate (e.g. 350 px vs 320). Following the tail for that growth moved the viewport by the difference: measured on the demo session while a thinking block streamed, scrollTop 12 039 → 12 009 → 12 044 → 12 014 with scrollHeight following — the reported "scroll down, balik, scroll down, balik". measure() now reports whether the changed rows sat at or above the viewport top (rect.bottom <= 0); adopt() keeps the reading anchor and sets skipTailPinRef, and useTimelineGeometryPin (scroll-geometry.ts) skips one delivery for it. The content above the reader stays put and the new content grows at the bottom; the smoke probe read one up-move (the send jump) and a monotonic tail afterwards. row-window.test.ts pins the anchor and the skip flag.
  • A collapsed row still states the outcome. The card spells it as a badge (Done / Failed / Running / Skipped / Aborted); the line styles use a glyph plus an sr-only word, because aborted and skipped are distinct outcomes omp records and a bare check mark would tell the reader the model declined when the user had interrupted. A failed call takes --theme-error; a success stays in ink, so a run of ten calls does not read as ten warnings.
  • The trace rail belongs to the RUN, not to a block and not to a row. The first shape drew a segment per block, sized to that block. Measured in the browser on the 39-call sample session that produced three disconnected lines: thinking -1390 → -1356 (34px), a 256px gap across the answer text, the tool section -1100 → 368 (1468px), a 99px gap, then the notice 467 → 512 (45px). A line whose only job is "these steps are one sequence" cannot break at every piece of prose. MessageList therefore groups consecutive non-user rows into ONE relative container (data-trace-group) that draws a single TurnRail; a user row closes the group, so a second turn gets its own line. Verified after the fix: 1 rail, 41 of 41 nodes inside it, every node at x=315 and the rail at x=315, desktop and phone (x=20 on the 390px layout).
  • Each block places only its NODE, and the node sits at left-0 with no translate. The 1px rail is at gutter + 3.5px (12px transcriptGutter on desktop, 0 on a phone), so an 8px node at the block's own left-0 is centred on it. A -translate-x-[3.5px] on the node put it 3.5px left of its own rail — a real defect found by measuring, not by reading classes. The run footer is deliberately OUTSIDE the rail container: left inside, the line ran 58px past the last node (a model/duration stamp is not a step).
  • The rail must sit in a column NO content occupies, and non-block content has to reserve it. The first shape put the rail at left-[15.5px] of the run while the answer's prose starts at px-3 (12px), so the line ran 4px inside the first character: measured at 1440, the rail's own box was 315–316 and the <p>/<ul> of the answer measured 311–979. A trace BLOCK reserves the column itself (mx-3 gutter + pl-4), which is why its node and text never collided; prose, the standalone intent, the error strip, the diagnostic note and the summary card reserved nothing. traceInset (block-chrome.ts) is that fact stated once: ml-4 (16px) for transparent prose — its text then starts at 28px, exactly where a block's own content sits — and ml-5 (20px) for a boxed element, which clears the node's 8px width so no fill or left border is crossed. A phone needs neither (rail at 3.5px, content already at 12px). Verified by walking every TEXT NODE inside the trace group with Range.getClientRects and intersecting it with the rail's box: 0 text hits on desktop and 0 at 390px, while the only boxes still intersecting are the rail and its own nodes.
  • A standard Tailwind utility can be MISSING from the served dev bundle, exactly like an arbitrary one. ml-4 was present in the production build (bun run build → .ml-4{margin-left:calc(var(--spacing)*4)}) and absent from the four /_dev-assets/asset/*.css files the running dev server served, so the computed margin-left stayed 0px and the first measurement after the fix still showed the text at 311. Restarting the dev server regenerated the bundle and the inset applied. The lesson is the same as the mask: verify a layout class by MEASURING the computed style, and restart the dev server after adding a utility that was not previously used anywhere.
  • The rail tapers at both ends via an INLINE style, not an arbitrary class. It spans the run, so it necessarily starts above the first node and ends below the last (21px / 32px measured — the row's margin plus the node's 9px offset). [mask-image:…] was written first and measured as mask-image: none in the browser: the class WAS in the built bundle but the dev asset serving the page had not been regenerated, which is the silent failure the arbitrary-value rule warns about. The mask is now an inline maskImage/WebkitMaskImage, which cannot miss.
  • ThinkingSection's toggle keeps aria-expanded and NO aria-label. chat.e2e.ts collects [aria-label^="Expand "] and asserts every entry names a TOOL, so a thinking block spelling its control that way would be read as a tool card titled "Thinking". The tool rows keep the shared toolToggleLabel; the other blocks stay out of that namespace.
  • The style covers EVERY transcript block, not just tool calls. Thinking (ThinkingSection) and system notices — including task results and goal injections (SystemNotice) — were spelling the tool card's frame out themselves, so a user on compact got compact tool rows sandwiched between a thinking card and a notice card: a setting that half applied, which reads as broken. The frame, header row, icon, title, subtitle and body container now come from one table, blockChrome (shared/lib/chat/timeline/block-chrome.ts), and ThinkingSection/SystemNotice consult it. Verified live in the browser on the 39-call sample session: switching card → compact → trace → minimal moved the thinking block's frame from border 1px / radius 12px, header 48px to border 0 / radius 0, header 34px, with the transcript's rounded-xl count dropping from 44 to the 2 that belong to the composer and an icon tile.
  • ThinkingSection's toggle keeps aria-expanded and NO aria-label. chat.e2e.ts collects [aria-label^="Expand "] and asserts every entry names a TOOL, so a thinking block spelling its control that way would be read as a tool card titled "Thinking". The tool rows keep the shared toolToggleLabel; the other blocks stay out of that namespace.
  • A one-line row clips its subject and facts in ONE row, like the card's meta line. The first shape put the subtitle and the facts as siblings of the title with flex-wrap, and on a phone a long +43 −16 chip pair widened the section: measured at 390 in the real timeline, the section's scrollWidth ran to 439 (compact) / 455 (trace) against a 362 client width, clipped by the timeline's overflow-x-hidden — the same silent right-edge loss the markdown tables had. The subject and the facts now share a min-w-0 flex-1 overflow-hidden row, and the body carries the card's own overflow-hidden, so the inner panel (a NumberedCode at 415 / 327) scrolls itself and nothing widens the section. Verified at 390 for all four styles: section scrollWidth === clientWidth === 362, document.documentElement.scrollWidth === 390, zero rows over their own width.
  • Measured density at 1440 on the 39-call sample session: collapsed row height 63px (card) / 28 (compact) / 28 (trace) / 23 (minimal) / 22 (tui), and all five render the same 39 rows with the same intent headings.
  • A style is a frame, not a capability: the card's action facts and the generic body reach every style. Three facts were card-only, and each was a silent loss in the other four. A tool with no specialized panel (a custom or plugin tool) had no body at all, because the line styles gated the body on hasPanel while the card always rendered the generic Input / Diff / Output; useToolView.hasGenericBody is now the one flag, and ToolBody reads it instead of !hasBody. A result omp capped or rewrote had no Full output chip, and a reminder envelope read as an ordinary success; both now come from ToolRowActions (tool-renderers/shared/ToolRowActions.tsx), which renders NOTHING when neither applies so the card's action gap and the line styles' row gap do not shift. The chip is a button, so the line styles render the actions as a SIBLING of the row's toggle button, never inside it. The trace node also gained its warn tone: an aborted call used to fall through to the muted node, indistinguishable from a running or skipped one. Verified in the browser at 390 on the 41-call sample (38 types + a spilled result + a panel-less custom tool): all five styles render 41 rows, scrollWidth === clientWidth on every row, and the artifact chip and reminder badge are present in each. styles/parity.test.tsx pins the three facts per style.
  • tui is omp's terminal transcript, ported as TEXT — no card (tool-renderers/styles/Tui.tsx). omp writes a call as a status line (✔ Bash: bun test [done] · 599ms), and the colour carries what a box would carry with borders, so the row has no border, no fill and no radius: measured in the browser on the 39-call sample session, border 0px / background rgba(0,0,0,0) / radius 0px, collapsed row 22px at 1440. The body, when opened, hangs off a hairline rule (border-l, ml-2 pl-3) the way a terminal prints output under its command.
  • The head's three claims are three colours, and that is the load-bearing part. The outcome glyph and its [word] take the state colour (--theme-success done, --theme-error failed, --theme-info running, --theme-warning aborted/warned); the tool NAME takes --theme-info; the SUBJECT takes --theme-meta. Verified from computed styles in the live page under one-dark-pro-soft: title rgb(97,175,239) against subject rgb(129,140,248) — a single ink tone for both is the reported defect, because the line then reads as one undifferentiated string. text-meta/85 is NOT a class Tailwind generates (only .text-meta is in the bundle), so the first shape silently fell back to ink and the subject matched the name; the utility used here is the plain one.
  • The facts group clips as a UNIT. They ride the head after the outcome ([done] · 140ms · 9 lines), capped at two with the full list in the group's title. Unbounded, they widened the section on a phone — measured at 390: scrollWidth 459 / clientWidth 362, with every head's fact span overflowing its own box. With min-w-0 shrink truncate the section measures 362/362 and no row overflows, at 1440 720/720.
  • Expand/collapse and the intent heading are properties of the STYLE, not the card. tui toggles through useToolOpenState like the rest, its button carries toolToggleLabel's wording (Expand Bash — git log --oneline -5 && git status --short), ▸/▾ is the affordance, and the per-call intent heading is drawn by the SECTION — so chat.e2e.ts's [aria-label^="Expand "] collection, mobile.e2e.ts's /^Expand Bash/ click and the heading assertions hold unchanged. Verified live: 39 of 39 rows carried data-tool-row="tui", one opened row grew 22 → 330px with .code-surface present, and the heading Waiting for the restart idempotency job still rendered on a session that has one.
  • blockChrome reads frame to decide whether a block is framed, not the mode name. ThinkingSection used mode === 'card'; that is now chrome.frame !== '', the table's own fact. It matters because tui is the SECOND frameless-by-design style (frame: '') whose header still has structure — mono type, the name in --theme-info, the subject in --theme-meta — so a thinking block or a notice under tui is a coloured line over a hairline body rule, matching the tool rows beside it.
  • The composer keeps its own card frame whatever the timeline style is. expansion.test.ts pins the composer's frame to the tool card's (rounded-xl, border-ink/10, bg-paper), which is correct while the transcript draws cards; the frameless styles do not change the composer, because the composer is the input the user is looking at, not a tool call.
  • A style change applies live. The settings modal calls applyToolRenderMode when the value moves, which announces omp:tool-render-changed; useToolRenderMode is the single subscriber. The initial value comes from the primed settings snapshot, so a mounted timeline draws the stored style on its first render rather than flashing the default.

Agent Event Stream Transport

  • The live omp agent bridge (POST /api/agent/:sessionId for commands) streams events over WebSocket by default — GET /api/agent/:sessionId/ws — with SSE (/api/agent/:sessionId/events) as the fallback, selected in Settings → Chats → Streaming Transport (streamTransport in kabmo_settings; default websocket).

  • Server side is one Elysia app for dev and prod: src/server/index.ts owns the port and mounts src/server/routes/, so the agent WebSocket (src/server/routes/agent/ws.ts) is a first-class .ws() route on that same listener. Started by bun run dev (watched) and bun run start / kabmo serve (production by default; --dev runs the source entry).

  • Client side: src/shared/lib/chat/omp/{transport,socket,sse}.ts own the connections; both hand every frame to src/shared/lib/chat/omp/agent-events.ts, which folds it into Kabmo state. Keep frame handling in that folder — never fork behavior per transport. The two connectors are transport-generic (connectSocket/connectEvents take a URL); a session's BTW stream dials the same pair against /api/btw/:sessionId/* instead of adding a third flavour.

  • A spawned child streams message_update in FULL mode, because delta mode drops the tool call's identity. configureChild (src/server/lib/omp/rpc/child-config.ts, called from manager.ts initialize) sends set_event_filter {events:null, messageUpdates:"full"}, so each frame carries the whole accumulated message and the client folds it as-is. "delta" was measured ~101× smaller on the wire (108 KB / 486 frames against 10.9 MB / 2217 on a 300-word prompt), but it drops the name and id a streaming tool call needs: toolcall_delta carries ONLY {contentIndex, delta} and toolcall_start carries no block at all, so both live solely on the message_start seed — which does NOT reliably contain the block. Measured on omp 18.10.3, the same model produced a seed of [text, toolCall] on one run and [thinking] on the next, so a card rendered a bare Tool for the whole argument stream and only snapped to Write — <path> at toolcall_end, which also swapped the card id (tool-1 → call_…) and remounted it, dropping the reader's expand state. full makes the name and id readable from the first delta; the terminal frames (message_start, message_end, turn_end, agent_end) carry the full message either way. delta-accumulator.ts and partial-json.ts (the rebuild the delta projection required) are gone with it.

  • The frames that are NOT about the conversation live in transport-frames.ts. rpc_frame_error (omp dropped a frame that exceeded the transport limit — names the type, so the notice says which step is missing), extension_error (an extension threw; omp keeps the session alive, so this is the only place it surfaces) and session_settled (the session went quiet — releases the optimistic generating state without waiting for the sidebar's next poll) are folded there, and so are the frames deliberately ignored (cache_warming_*, retry_fallback_*, config_warnings_changed, ttsr_triggered, todo_reminder, todo_auto_clear, irc_message) — listing them makes the omission a decision. agent-events.ts delegates to it from its default: branch.

  • A topic's attach is bound once per SUBSCRIPTION, so a replaced SOURCE needs an explicit rebind. hub.subscribe runs the descriptor's attach when the first subscriber arrives and its cleanup when the last leaves — the topic is wired to whatever the source was at that moment. A session's omp child is routinely REPLACED while a tab stays subscribed: the idle reaper reclaims it after 10 quiet minutes (IDLE_REAP_MS), a composer access-mode change respawns it (reconcileSpawnApprovalMode), a crash destroys it, and force_reset (Stop's escalation) tears it down. Without a rebind the topic keeps pointing at the DEAD child's fanout: the subscriber holds its subscription and receives the fresh snapshot (so onResumeStream resumes the generating indicator) but no frames ever arrive — the answer looks like it never streamed until a reload re-subscribes and re-attaches. That is the reported "second prompt sometimes doesn't stream until I reload", and the spawn path is what fixes it: startRpcSession/startNewRpcSession raise the session-attached signal the moment the new child is reachable, and publishSessionState (topics.server.ts) now calls getRealtimeHub().rebind(topic) before its republishSnapshot. rebind drops the stale cleanup, re-runs attach, and is a no-op with no subscribers (a topic nobody watches must not hold a source open). Pinned by hub.server.test.ts (frames follow the replaced source; no subscribers → no attach) and topics.server.test.ts (a session-attached signal detaches once, re-attaches, and re-snapshots the subscriber).

  • Steering uses omp's steer, never abort_and_prompt. "Send Now (Steering)" on a queued row used to post abort_and_prompt, which CANCELS the running turn and starts a new one — the answer the user was watching was thrown away. Measured on omp 18.8.3 with a counting turn: steer produced one agent_start/agent_end pair with the model answering inside the same run, abort_and_prompt produced two of each. OmpAgentHandle.steerOmpRun (src/client/hooks/chat/omp/index.ts) posts steer, and because a steer creates no run boundary the interruptPendingRef guard that existed to survive abort_and_prompt's abort-then-restart is gone entirely.

  • The run's tool bookkeeping survives an arrival that is the SAME conversation, and the STREAM is what proves it. useOmpAgent clears toolResultsRef / lastToolMessageRef / the activity phrase when the session on screen is a different conversation, because they belong to one run: emptied mid-turn, every later tool_execution_update / tool_execution_end has no target to pair onto and the card freezes at Running for the rest of the session (measured in wait.e2e.ts: the settle spec read Wait Running for its whole 30s budget, and the browser trace showed refresh … last null between two progress frames of one call). isRunSwitch (client/hooks/chat/omp/run-switch.ts) is the rule, and three arrivals are NOT switches: a spawn adoption (new-… → UUID, answered by isSpawnAdoption without claiming the record the session-state provider owns), the same id again (a re-render, a metadata refresh), and a send that began with no ?sessionId= at all — a chat opened from a workspace, where the URL carries only ?folderId=. That third case is why the pending-id record is not enough on its own: no pending id ever existed, and the spawn path connects the stream BEFORE it writes the URL, so attachedSession() === sessionId is the evidence. A session merely opened from the sidebar satisfies none of them — nothing dials it until the mount probe runs, which is after this decision — so it still clears and still probes for a live run. Pinned by run-switch.test.ts.

  • The channel never gives up, because a phone freezes the tab. A backgrounded Android tab (Brave/Chrome) stops running timers, and the server's 30s protocol heartbeat (attachObserverStream, STREAM_HEARTBEAT_MS) tears the socket down because a frozen tab cannot answer a ping. Coming back, the client's backoff spent a 4-dial budget in ~7.5s — often before the radio woke from Doze — and then latched error: scheduleReconnect returned with no timer and connectIfNeeded refused to dial from error, so nothing could ever recover and only a reload repaired the stream (the reported "indicator goes red and the stream stops until I reload"). Three rules replace that, all in src/shared/lib/realtime/{connection,state}.ts (split so each file stays under the size ceiling: state.ts owns the socket slot, the status and the frame sink; connection.ts owns dial, backoff, the resume probe and teardown). The fast budget is a cadence, not a give-up — past MAX_FAILED_DIALS the channel keeps retrying at SLOW_RETRY_MS (30s), so a tab that never sees a resume event still repairs itself. A resume event resets the budget and dials at once — visibilitychange (only when !document.hidden), pageshow (a bfcache restore) and online (the radio can return before the page is visible), installed once per state object so a bun --hot re-evaluation cannot double them. A socket the browser still reports OPEN is PROBED, never trusted: a frozen tab never learns the server hung up, so wake() sends an application-level {t:'ping'} and waits WAKE_PROBE_MS (2s) for the server's pong (notePong, called from the topic layer's already-decoded pong case) — an unanswered probe closes that socket and the normal retry path takes over. Two guards are load-bearing and each was a bug first: socket.onclose returns early when host.socket !== socket, or the abandoned socket's late close nulls the LIVE dial and schedules a third; and dial() returns when nothing is wanted, or a retry scheduled before the last subscriber left opens a socket nobody reads. RealtimeStatus lost error entirely — a state meaning "stopped trying" has no way back into connecting — so a dead channel reads closed (red) while a retry is pending. And a phone's WebView delivers NONE of those events, which is why a WATCHDOG exists (resume.ts + watchdog.ts, split so each stays under the ceiling: watchdog.ts is the pure decision, resume.ts the driver that owns the interval, the listeners and the probe). Measured on the shipped Android shell: a backgrounded WebView is never reported hidden, so returning to the app fires no visibilitychange, and a socket the server reaped while the page was frozen produces no close — readyState still says OPEN. The channel therefore sat on a corpse with status === 'open', no frames, the answer frozen mid-sentence, and only a reload repaired it (the reported "websocket tidak terhubung, stream tidak lanjut, harus reload"). A running interval is the one signal a frozen page cannot fake, because a frozen page stops running it: LIVENESS_TICK_MS (5s) reads two clocks and asks watchdogAction — a tick arriving later than FREEZE_DETECT_MS means the page was SUSPENDED (treated as a resume: reset the budget, probe or re-dial), and an OPEN socket silent past IDLE_PROBE_AFTER_MS (25s, below the server's 30s reap so the question is asked BEFORE the reap) is probed even when nothing woke the page, which also catches a connection that died on a Wi-Fi→cellular handoff while the tab stayed visible. Freeze detection is gated on !document.hidden because a hidden tab is legitimately throttled to about a tick a minute and every one of those would read as a freeze; the idle probe is NOT gated, so a connection that died while the user was in another app is repaired before they return. Two further guards, each a bug first: a probe armed before a freeze keeps its deadline timer frozen with it, so probeId stays set forever and every later probe returns early — probeArmedAt is what lets an arm that outlived its own deadline be discarded; and the interval is stopped with the last subscription and on resetConnection, or a released channel keeps probing nothing. The shell says so directly as well: window.__kabmoResume() (client/lib/native/resume.ts, installed in main.tsx like __kabmoBack) is evaluated from MainActivity.onResume / ShellViewController.viewDidAppear, so the repair starts on that tick rather than at the next watchdog one — inert in a browser, and a no-op with nothing subscribed, which is why the shell may call it on every foreground. Pinned by watchdog.test.ts (the decision table, no clock needed), watchdog-wiring.test.ts (the interval reaching the probe and re-dial paths, and the stale arm), connection.test.ts (backoff and the resume probe, driven through the public subscribe path), frozen-recovery.test.ts (a REAL server and a REAL socket: the reaped socket is abandoned, re-dialed and resubscribed with no event of any kind — A/B'd, it times out with the watchdog disabled) and native/resume.test.ts (the property name both shells hardcode, and inertness when nothing is subscribed).

  • A run whose terminal frames died with the socket is recovered from the TRANSCRIPT, not from a reload. A backgrounded tab (or a frozen phone) loses the channel, the turn finishes with nobody reading, and message_end/agent_end go into a socket that no longer exists — so the timeline keeps the stream's last PARTIAL segment and its local generating flag never releases, while the SERVER's stream row settles normally (which is why the docked indicator stops but the answer stays cut off mid-sentence). client/hooks/chat/timeline/lost-run.ts (useLostRunRecovery → useReconnectSettle in client/hooks/chat/omp/reconnect.ts) repairs it on the channel's own reopen: settle the local run (release the flag, clear the placeholder/optimistic/pending-steer ids, and drop thinking.isGenerating so no accordion pulses over a finished answer), then re-read /api/chat/:id — unconditionally, because the rows on screen are the stream's snapshot and the JSONL is the only record of the rest, so session-load.ts's own guard (which keeps a LAGGING read away from a live run) does not apply. Three conditions decide whether it acts, and each was a way to destroy a healthy turn. (1) The socket must have been OPEN and then gone: a dial is not a reconnect, so a send whose connect() opens a closed channel is excluded — that is the window where the optimistic turn exists but the prompt may not be on the wire. (2) There must be evidence a run was IN FLIGHT, and it is TWO independent facts (streamRunRef || serverRunRef): the stream announced it (set by every non-owned setGenerating(true) — agent_start and the mount probe's resume — never by the send path's owned arm), or the server wrote its stream row at dispatch. The second is not redundant — a run whose very FIRST frame (agent_start) was the one lost has no stream-side mark on this client, and keying on streamRunRef alone left that case unrecoverable (the timeline kept an empty placeholder while the answer streamed into a socket that was gone). A prompt that has not reached the server has no row, so the dispatch window stays excluded either way. (3) The server must say the run is over: runIsOver (client/hooks/chat/omp/run-liveness.ts) accepts running:false, rejects busy (a live subagent, a parked dialog), a live isStreaming/isPromptRunning, a non-zero queuedMessageCount (the session WILL wake again), and requires omp's own verdict to be literally isSettled === true — the same rule the server's RunSettle applies (isSettled !== true → do not settle), because a turn can be admitted but not yet streaming and two answers to "is this run over" is how the indicator and the transcript end up disagreeing; a build that does not report the field therefore settles nothing, and an unanswered probe is no verdict at all — settling a live run throws away the streaming answer, while missing a settle costs one more reconnect. An empty transcript read leaves the rows alone AND is retried on SESSION_META_RETRY_SCHEDULE_MS, for the same reason refreshSessionMeta retries: omp buffers its transcript writes, so the turn that just finished can be missing from the file for a beat after the channel returns — one read and stop would leave the partial answer in place, which is the state this recovery exists to clear. The retry is bounded and stops at the first non-empty answer, and the placeholder ROW is deliberately not deleted before the replacement arrives (only its mark is released), because dropping the only row first would blank the transcript for the retry window and for good if omp never flushed. Pinned by lost-run.test.ts (mounted through the real useSessionLoad: the partial row is replaced by the committed turn and the flag releases; a live run, a first dial and an unanswered probe all leave it untouched), reconnect.test.ts (the trigger conditions and the once-only settle) and run-liveness.test.ts (the verdict table); tests/e2e/specs/reconnect.e2e.ts is the assembled proof of the OUTCOME (a real child streams, the channel is held unreachable past the end of the run, and the full answer appears with no reload, one row, nothing spinning) — but it is NOT the discriminator for the mechanism: verified by disabling useLostRunRecovery, the spec still passes, because the session-load effect re-running as the URL settles repairs the transcript in that shape too. The mechanism is pinned at the unit layer and each branch was A/B'd there. FAKE_OMP_PERSIST=1 makes the scripted child write its turn to the session JSONL the way omp does; without it there is nothing to read back and the spec would pass for the wrong reason. Three failures shaped the trigger, and all three are now pinned by tests. (1) A run whose very FIRST frame was the one lost had no stream-side mark, so the trigger now accepts the SERVER's stream row as independent evidence (streamRunRef || serverRunRef). (2) The client's generating flag FLICKERS false during a live run (a prompt_result folded as settled, the spawn-adoption window), so a drop landing in one of those beats was read as "nothing was running" — the evidence is now LATCHED (facts.sawRun), and a flicker cannot erase it. (3) The hook re-mounts while the CHANNEL does not — the effect is keyed on the session id, which moves mid-run when a spawn answers with omp's UUID — so local variables came back with wasOpen:false and the following drop read as a dial that never opened; the facts live in a ref outside the effect and wasOpen is reconciled from the client's own status on every render. wasOpen is read from realtimeClient.status(), never socket.readyState: the browser flips readyState to OPEN BEFORE dispatching open, and a spec gating on it fired inside the connecting window (measured).

  • Session auto-titling is ONE-SHOT per conversation, retried ONCE after the first run, and it runs on the SESSION's model (src/server/lib/omp/session/auto-title.server.ts, fired from the message_end and agent_end branches of src/server/lib/omp/rpc/frame-fold.ts; the request lifecycle is session/title-request.server.ts). omp force-sets PI_NO_TITLE=1 under --mode rpc-ui, so Kabmo asks for the title itself by sending /rename to the child. The trigger is the first settled USER message, not agent_start — omp pushes agent_start before the turn opens, so the transcript is still empty there and a /rename at that point reads messageCount: 0 and is answered "Could not generate a session title" (measured on omp 18.3.0: the user message lands ~120ms after agent_start). message_start is equally too early — omp appends the message to the agent's state on message_end, so only that frame makes get_state report it. agent_end then retries ONCE as the fallback, for the early attempt that came back empty (provider error, timeout, child gone, or the tiny model declining); it stands down when the name already landed. Never fire it beyond that: omp derives the title from the NEWEST turns and generateRenameTitle reserves a fresh title revision (cancelling any generation still in flight), so an attempt after turn two names the session after whatever the conversation had become by then. The eligibility latch is AgentSessionWrapper.autoTitlePending, seeded in applyIdentity from omp's own messageCount (a --resume child reports the messages it restored, so an existing session is ineligible from the start) and consumed by the settle attempt — the early attempt deliberately does NOT consume it, or a first-turn failure would leave the session unnamed for good. autoTitleRequested (reset at each agent_start) keeps a queued steer message from re-asking inside the same run. The fallback ALWAYS dispatches, and the two dispatches are chained. It used to stand down while the early attempt's claim window was still armed, on the assumption that generation would land — measured on a real session it had already failed 52 s earlier, so the run ended with nothing asked again and the session kept New Session - <timestamp> forever. sendTitleRequest queues behind the dispatch in flight because omp cancels a superseded rename WITHOUT emitting the frame that would release its claim. And the request runs on the conversation's own model, which is what made it work at all. omp names a session with its tiny ROLE and only appends the session's model when retry.modelFallback is on; measured here, six auto-title attempts across four fresh sessions all ran on kenari/deepseek-v4-flash (plan lapsed → 429 plan_limit_reached at ~52 s) and named nothing, while the two renames that succeeded — the manual action — ran on kenari-jatis/deepseek-v4-1-flash through withTitleModelOverride. That pin is now written for BOTH paths and held until the request's frames arrive (omp resolves the role again for the card request after a successful title, so releasing on the ack produces an uncarded title); the overlay is newest-wins rather than queued, because a title model can take a minute and a second request must not wait on the first. Claims are COUNTED, not one slot (autoTitleClaims): with a single slot the second request overwrote the first, so the first one's command_output reached the timeline as a notice row. A prompt sent after a run end waits for the dispatch (awaitTitleDispatch in session-commands.ts's prompt branch): both are separate frames on one stdin, and a prompt admitted first lets the rename name a conversation that has already moved on. The wait is the ack (~3 ms), bounded at TITLE_DISPATCH_BARRIER_MS, never the generation. A landed title republishes the sidebar (session_info_update in the fold calls publishSidebarStructure): the title is rewritten in a fixed-width slot inside the session file, so the mtime the scan cache keys on does not move — measured, the list kept the placeholder while the header already showed the name, until an unrelated tool call republished. A first message omp's low-signal filter rejects ("hi") therefore leaves the session unnamed for good — the honest outcome, since the fallback does re-ask and omp declines a second time (the rejection is a property of the opening message, not of when it is asked). omp 18.9.0 added title CARDS and Kabmo carries them through rather than stripping them: title.icons (default nf+emoji) heads a generated or renamed title with an icon and a short code — formatCardTitle emits 🧪 FLAKY: Fix flaky park tests — and sessionTitleFor returns session.name verbatim, so the sidebar renders exactly what omp's own TUI renders. No card-aware branch is needed (the prefix is part of the name omp persisted), and a user who wants plain names sets title.icons: boring, a row the panel gained with the 18.9.2 schema. The card is also why /rename now takes longer: a title with no card triggers a SECOND title-model request for the card (renameTitle → #cardIcons → generateTitle(named, cardPrompt)), which the 60 s TITLE_CLAIM_WINDOW_MS has room for.

  • A prompt_result that opened no turn is suppressed for as long as a run is in flight — dispatch included — and the RUN is the attribution, not the /rename request window. frame-fold.ts forwards that frame only when no run is in flight (promptRunning || streaming); the auto-title window (autoTitleWindowUntil) was not enough on its own, because it is armed around the /rename and omp answers that command within the same tick (measured ~3 ms on omp 18.7.0), so an ack that won the race reached the client anyway. The client folds this frame as "the run settled" (agent-events.ts → onPromptSettled), which blanks the docked indicator and drops the optimistic user mark — so the turn's own echo was appended beside the bubble it stood for, and Kabmo's copy of the conversation held msg-…-user and the echoed row side by side for one prompt (measured on real sessions; the indicator died ~450 ms into a 20 s run, and the turn rendered twice). The rule covers every auxiliary sender that answers on this frame — a Plan/Goal toggle, /reload-plugins, rename-with-ai, a peer instance's command — and the run's flags are left alone, exactly as the dispatcher leaves a non-owning command's (rpc/session-commands.ts). A builtin the operator typed while the agent is IDLE still passes through untouched: that is the case the frame exists for. The guard is the whole RUN, not its streaming half. streaming flips at agent_start, so the window between the prompt's DISPATCH and its first frame was open, and a background command answered there reached the client: measured on a fresh session (omp 18.22.2), the plan-review republish the client fires on spawn adoption (usePlanReview, hooks/chat/timeline/plan-review.ts) reached the child 43 ms after the prompt and omp answered it agentInvoked:false 160 ms BEFORE agent_start — the client settled the optimistic turn, the user echo appended a second bubble, and 57 of 58 first prompts rendered twice (49/50 with an 8 s pause before sending, 8/10 sent immediately; the pause is not the cause). promptRunning is set before the prompt is written and cleared only by a settle, so handlePromptResult now suppresses on promptRunning || streaming; a prompt that genuinely opened no turn is still settled by the dispatcher's own ack.agentInvoked === false branch (rpc/session-commands.ts), which emits its own frame. Pinned by frame-fold.test.ts (dispatch window suppressed, idle builtin forwarded).

  • A session whose RECORDED model no longer exists cannot be resumed at all — the spawn must name a model that resolves, or every command to it fails. omp --resume <file> restores the model the session's last model_change entry names, and it does NOT fall back when that model has left the registry (a provider the user disconnected or removed from models.yml, a model added to disabledProviders): the child exits(1) with error: Could not restore model <provider>/<id> before RPC comes up, so the set_model a model change posts, the get_state warmup and the prompt all answer 400 omp exited (code 1…). Reproduced deterministically on omp 18.13.1 with a copy of a real transcript whose last entry named deepseek/deepseek-flash (that provider is not in the registry at all) and confirmed for a disabled provider too (commandcode/claude-sonnet-5) — while the SAME file resumes fine once --model <a served model> is passed, which is the lever. startRpcSession therefore respawns once when the first spawn dies with omp's own sentence (isUnrestorableModelFailure, session/resumable-model.server.ts), choosing the replacement from: the model the command itself asks for (a set_model carries the operator's pick), the model the dropdown persisted (omp_selected_model), then config.yml's modelRoles.default — validated against omp models --json --kind all, the union of what omp can actually resolve (the chat picker is not that set: it filters disabled providers and per-model hides). Nothing is read on a healthy spawn, so the common path is byte-identical. The session then comes up on a model that works and the command that triggered the spawn still lands, so a model change on an old chat applies as the user intended. Pinned by resumable-model.recovery.test.ts, which drives the real spawn path against test-support/fake-omp-restore.ts (a scripted child that dies exactly this way without --model): two spawns, the second carrying --model kenari/deepseek-v4-flash, the wrapper alive and registered — plus an unrecoverable case that still reports omp's own sentence rather than swallowing it.

  • A refused send says why. executeSend rolls the optimistic bubbles back on a failure and used to leave it there: the operator's turn VANISHED with no explanation, which is the reported "the prompt failed to send". The server's reason is now reported through the same toast channel the steer path uses (reportActionError, passed down from ChatTimeline), so a dead child or a session another process owns reads as Prompt not sent: <reason> instead of nothing. Pinned by send-refusal.test.ts (the reason travels, a reasonless refusal still reports, a delivered send reports nothing), and the three send suites share their harness through send.test-util.ts.

  • An image attachment needs an outbound frame that stays on ONE line, and protocol v2 chunking is the wrong direction to reuse. negotiate_protocol is advertised by omp and answered {protocolVersion:2}, but its rpc-ui stdin loop has NO rpc_chunk handler: measured on 18.14.0 and 18.16.0, each chunk record came back {success:false,error:"Unknown command: rpc_chunk"} and the prompt was never dispatched — 6 records for a 1.32 MB image, no agent_start, no ack, and settleCommandTimeout reset the child with The OMP session stopped responding and was reset. The same payload as a single 1.32 MB line (and a 30 MB one) is accepted and acked in ~21–26 s, so encodeRpcFrameLine (src/shared/lib/omp/rpc/frame.ts) never chunks in that direction and refuses only past MAX_OUTBOUND_FRAME_BYTES (64 MiB). The decoder still reassembles chunks, because omp → Kabmo frames DO use them.

  • An image-bearing prompt gets ack budget of its own (IMAGE_PROMPT_ACK_TIMEOUT_MS, 120 s; text stays at 30 s). omp does not ack an image prompt at dispatch: it stores the bytes, downscales them and asks the vision model for a description first. Measured on 18.16.0 — a plain prompt acks in ~0 ms, a 1 MB PNG in 21 s, a 30 MB one in 26 s (size-independent, dominated by that model call). The cost of being wrong is not a late report: an ack overrun runs settleCommandTimeout, which RESETS the child and destroys the turn the operator just sent (promptAckTimeoutMs reads the payload, so the router and the BTW side question agree).

  • A refused attachment is a sentence, not a reset. validateAgentImages refuses over 20 images, over 20 MB per image or 40 MB aggregate with Images up to 20 MB are supported.; before the framing fix a >1 MiB payload had no such gate on the outbound side and instead timed out, so the two limits must stay in step with MAX_OUTBOUND_FRAME_BYTES.

  • The INBOUND ceilings are the server's, and a damaged chunk costs one frame — not the child. ready advertises maxFrameBytes / maxReassembledFrameBytes, so RpcFrameDecoder.setLimits() adopts them instead of trusting the module constants; a fault used to run dispose(0), which tore down the child's LSP servers, browser targets and prewarm slot for one lost event, and now emits one notice (capped at MAX_PROTOCOL_ERROR_NOTICES, 3) and resyncs at the next intact frame. The size of what that protects: get_available_models is 522 KB on this machine, within a factor of 2 of the ceiling, a 3000-item set_todos is 1.33 MB — measured on 18.16.0, v1 answers RPC response exceeded the transport limit while v2 delivers it as 6 chunks (chunkId rpc-1, byteLength 1331002, largest physical line 349,629 bytes) that reassemble byte-exact.

  • An aborted run is identified at message_end, not at agent_end. omp compacts an oversized terminal frame by dropping every message it already delivered through message_end (leaving messageCount), and the aborted assistant message is one of them — measured on 18.16.0, message_end (role: "assistant", stopReason: "aborted") arrives BEFORE agent_end. A settle that read only the frame reported a stopped run as finished, then titled the session, audited the goal and released the queued follow-up for a turn the operator had cancelled. 12.7% of the runs in this workstation's own store (494 of 3901) exceed the 1 MiB ceiling that triggers the trimming, so SessionFrameHost.runAborted (set in handleMessageEnd, reset at agent_start) is the primary source and agent_end.messages remains the fallback for a host that attached mid-run.

Internal-URL Reads (read xd://…, skill://, omp://)

  • read xd://<device> is the device's DOCUMENTATION, not a call, and it is the READ panel. omp's XdProtocolHandler#usage answers a read of xd:// (the listing), xd://<device> and xd://<device>/<topic> with xdevDocs — the # <name> — <title> page — and its own reader has no xd:// read card (unlike proc:// and cfg://), so it draws an ordinary read. Dispatching by device instead sent the doc page to the device's panel: read xd://lsp drew the LSP diagnostics card, read xd://mcp__codegraph_explore the MCP argument/result card, and read xd://eval/browser (the eval device's browser topic) the eval card — three panels for one class of call. isXdDocRead/xdDocPath (tool-renderers/registry.ts) gate on the READ transport plus an xd:// path, tested before xdDevice; the WRITE transport is untouched, because write xd://lsp genuinely IS a call. xdDocPath returns the FULL path — xdDevice reports eval for xd://eval/browser and the card named the wrong thing.
  • A doc read's URL is its identity, so the card shows it. toolCardSubtitle hides a bare xd:// URL because for a device CALL the URL is transport (the device names the action); for a doc READ the URL is what was read. The card was otherwise Read Done with aria-label="Expand Read" — nothing naming it. Verified in the browser: Read · xd://eval/browser · 77 lines.
  • A path with no language answers text, not javascript. getLanguageFromPath defaulted to javascript for an extensionless file, an internal URL or a web URL, so a read of one was badged JAVASCRIPT and its prose was tokenized as code. omp's own getLanguageFromPath returns undefined for the same input, and text is a Shiki SPECIAL language — always loaded, no grammar fetched, emitted escaped and uncoloured — so the badge and the tokenizer both stop claiming a language the input does not have (verified: src/x.ts still reads typescript). A read xd://<device> reached this badge only until it was given its own markdown branch (below); it now reads Markdown.
  • The read SELECTOR comes off the path first, or the language is lost with it. read may name its lines on the path itself — src/App.tsx:23-300:raw — and the extension was read off the raw string (tsx:23-300:raw, an unknown extension), so getLanguageFromPath answered text and the code surface rendered unhighlighted. Only a :N-M suffix was ever stripped; measured on a real session store, 9517 of 18128 read paths carry a selector and 1268 of those — every :raw, :img and comma list — were missed. stripReadSelector (shared/lib/fs/paths.ts) peels omp's whole grammar (:N, :N-M, :N-, :N+K, :-N, a comma list, :raw/:conflicts/:img, and a compound :1-50:raw / :raw:-60), mirroring splitPathAndSel in @oh-my-pi/pi-tui/tools/read.ts — including its trailing rule (a chunk must END in a digit, . or -, which is what rejects the in-flight :50+) and its conservatism about a bare a:1-50 filename. A URL is returned untouched: its colon can be a PORT (http://host:8080/x would otherwise lose :8080 to the line-range rule) and no fs route ever receives one. It is used by the language detector, the Read panel's /api/fs/read + /api/fs/raw path (x.png:raw read as an unknown extension, so the image sniff said "not an image") and getFileExtension. Verified in the browser on the :23-300:raw sample: badge tsx, 41 Shiki spans coloured; the plain app/types/chat.ts read still reads TYPESCRIPT with 63 coloured spans.
  • A text/markdown read renders as prose. omp draws it as the document it is (details.contentType === 'text/markdown' ? md(text) : code); the panel had no markdown branch, so read skill://diagnose rendered # Diagnose ## Steps 1. Reproduce as one code block — the file's headings, lists and links came out as literal syntax. 86 internal reads carry that content type (skill:// 11, omp:// 22+, agent://), and 38 real .md file reads do too. The source is omp's own displayContent.text, never rawContent: omp prefixes every row of the raw output with its file line number (1|# Diagnose) and a markdown parser reads that gutter as content, turning the heading into the paragraph 1|# Diagnose. The gutter-stripping parser (parsedCode.cleanCode) is only the fallback, because it needs TWO numbered rows to recognise the format — a one-row document (read xd://propose, a real payload) kept its 1| prefix through it and rendered as the paragraph 1|Write your plan's <slug> ….
  • A read xd://<device> is markdown too, even though omp tags it text/plain. The device documentation (# <name> — <label>, ## Schema, a ```ts fence) is the same prose a skill:///`omp://` read carries; only `XdProtocolHandler`'s hardcoded `contentType: "text/plain"` distinguishes it, and the panel had no branch for it — measured over every `xd://` read of a real install (220 rows, 11 distinct documents): all of them rendered as one `
    ` of literal syntax behind a `TEXT` badge, `# ast_edit — AST Edit` and `## Schema` included. `isXdDocRead` widens the markdown predicate, so the badge reads `Markdown` and the prose renders as prose (verified in the browser: badge `Markdown`, no `
    `, the card body is `.prose-content`). A FAILED doc read is excluded — `read xd://nope` answers "No such tool: …", a refusal rather than a document, and it keeps the code surface.
  • The demo dataset carries a doc read. virtual-devices-session renders read xd://eval/browser with the measured details (contentType: text/plain, totalLines, displayContent), so the badge, the URL subtitle and the prose surface are all exercised under MOCK=true. tools-session likewise carries call_01b_read_selector — a read whose path is src/App.tsx:23-300:raw — so the selector strip is exercised in the demo, not only in a test.

Image Reads (tool renderers)

  • A read of a picture answers with the picture, so the panel paints the RESULT's bytes — never a re-read of the path it names. omp's toolResult carries {type:'image', data, mimeType} beside its text note, and externalizes anything large to the content-addressed blob store (blob:sha256:<hash>; measured on this install, 421 of 435 image blocks across the session files are refs). Both parse paths now carry it: extractToolImages (src/shared/lib/omp/session/tool-images.ts) is applied by the reload pass (collectToolOutputs + the inline toolResult blocks) and by the live fold (recordToolResult, tool_execution_end), landing on ToolCallData.images.

  • The old path-only reconstruction was broken for exactly the reads people screenshot. The panel pointed /api/fs/raw?path=<target> at the tool call's path, but that route only serves paths inside the browse scope and read routinely names one outside it (/tmp/shiki96.png) — so the panel drew a broken image while the bytes sat in the transcript. readFailed (status: 'error' / isError) suppresses the fallback too: a failed read ("Path '/tmp/x.png' not found") names a picture that is not there, and pointing an <img> at it drew a broken thumbnail over an error message.

  • Blob bytes are served by GET /api/omp/blob?hash= (src/server/routes/omp/blob.ts). readBlobImage resolves the content type from the BYTES first (getImageMimeFromBytes, magic-byte table in file-kind.ts) and from the sibling extension link second, because omp stores the blob under its content hash and the extension lives only on a hardlink beside it — and because the type is not cosmetic: a 96×96 PNG read came back as a JPEG blob, and image/* is what makes the browser paint instead of download. The hash feeds a path.join against the store, so readBlob's canonical-digest guard is the security boundary (verified: ../../etc/passwd and a truncated digest both 404 before touching the filesystem). An inline payload becomes a data: URL instead — re-encoding megabytes into every session load is what the store exists to avoid.

  • A tool result's picture and a rendered diagram open into ONE full-screen surface. An eval card's screenshots went through Modal + ImageViewer — a centered max-w-4xl box with a header row and a paper footer bar over a 70vh stage — while clicking a mermaid diagram in the same timeline opened DiagramViewer: full-bleed fixed inset-0, no header, a floating pill at the bottom centre. Measured in WebKit at 1440×900, the diagram's overlay was 1440×900 at (0,0) with the pill inside it; the picture was a boxed panel of the same timeline. Both now render through common/fullscreen-viewer: it measures the drawing (offsetWidth/offsetHeight), fits it with a 112px margin and never past 100%, zooms around the cursor on wheel, drags to pan, toggles fit/100% on double-click, and owns Esc/+/-/0, the body-scroll lock and the focus handoff. common/diagram-viewer states only its SVG snapshot; common/image-viewer/fullscreen.tsx states only the <img> plus its loading overlay and its decode refusal — a second copy of the overlay is how the two previews drifted.

  • The picture is measured at its NATURAL size, so the shell needs max-width: none on it. Tailwind's preflight img { max-width: 100% } clamps the element to the stage's width before the transform is applied, so a 1440px capture measured as "viewport wide" and the fit scale compounded on that — the image opened smaller than the viewport allowed and the percent in the pill named a scale of a size that was not the file's. .fullscreen-viewer-canvas > img { display: block; max-width: none; max-height: none } keeps the measured box equal to the decoded pixels. Verified in the browser: a 1440×900 capture fitted at 88% ((900−112)/900), wheel-zoom at the cursor reached 160%, drag panned, document.body.style.overflow read hidden while open, and Esc and the pill's X both closed it and restored overflow to empty.

Injected Entries and Narration (what omp writes for the model)

  • Every injected custom_message renders, including the ones omp itself hides. omp writes prompt injections with display:false and its own transcript walk skips them; Kabmo deliberately does not, because a session's JSONL is the record a reader may want in full. So mid-run-todo-nudge ("7 todo items still open…" — 468 entries across the author's 931 session files), todo-error-reminder, plan-mode-context (6.8 KB), plan-mode-reference (27.5 KB), image-attachment-description, orchestrate-notice and eval-state-context all appear as "System Notice" cards. Measured on the author's install: 758 such entries, ~232 KB, 524 of them producing a card (the remaining 234 are system-prompt-digest, which carries only a hash and no content, so it yields no notice). noticeFromCustomMessage filters exactly two things: session_exit (runtime plumbing with no prose) and the chamber's own chamber-goal-state / chamber-plan-state mode bookkeeping.
  • display is deliberately NOT the gate, in either direction. Filtering on it would hide the goal injections (GoalNotice is the only slot for an objective and its budget), the loop guards (thinking-loop-redirect / tool-call-loop-redirect are the only record that a turn was cut short) and ultrathink-notice / xdev-mount-notice / resolve-reminder — all of them display:false in omp too. Do not "fix" the noise by adding a denylist: that decision was made and reversed, and a reader who wants the full transcript wins over a tidier one. If the volume ever needs addressing, the lever is a per-row collapse in SystemNotice (it already collapses by default), not a drop in the parser.
  • eval-state-context arrives in TWO entry shapes, and both must keep rendering. omp 18.12.0 persists it at startup via appendCustomMessageEntry (it was in-memory only before), so a resumed session that ever used eval carries it — as type:"custom_message" in some builds and as type:"message" with message.role:"custom" in others. The second shape reaches the timeline through the assistant branch of toChatMessage (messages-map.ts), not through noticeFromCustomMessage, which is why both paths are pinned separately.
  • A developer/system-role message is a NOTICE row, never assistant prose, on BOTH paths. omp writes harness nudges this way — the DSML tool-call-leak prompt ("Tool call failed: your previous response tried to invoke a tool…", injected by omp's own agent loop after it strips a leaked DeepSeek tool call), a rule violation, a compaction resume tail. The live mapper (mapper.ts) and the JSONL reload (messages-map.ts) both go through one shared rule, developerTurnNotice (src/shared/lib/chat/notice-row.ts): the text becomes notice, content stays empty, and isNoticeRow renders it as a System Notice card. The reload path once folded the role onto assistant content — roleFor does that — so the raw harness prompt, DSML markup and all, reappeared as if the model had said it after a reload (measured: 5 DSML nudge rows across this install's session files), and its text joined the run's copy payload. roleFor keeps folding developer onto assistant; the notice branch lives before that fold is used, which is what makes the two paths agree.
  • A narration thinking block is answer text, and the split lives in the shared parser. omp 18.12.0 marks prose the model addressed to the user as narration: true on a thinking block (decoded from the Anthropic/Bedrock thinking signature), and every omp surface presents it as reply text (presentNarrationAsAnswer, used by the TUI's streaming reveal, print mode and the ACP mapper). The Kabmo folded every thinking block into the collapsed "Thinking" accordion, so a reply sent between two tool calls vanished from the transcript. parseMessageBlocks (parse-message-blocks.ts) now pushes a narrated body into textParts and leaves thinking untouched — stated once, because both the live fold and the JSONL reload read it. Only the literal true promotes a block; a truthy string or a provider's own marker must not move reasoning into the reply. narration.test.ts covers the core rule, the block ordering, the text fallback and both adapters end-to-end.

Process Supervision (proc://, and the legacy hub tool)

  • proc:// is omp's device for background jobs, project services and live agents, and it is reached through the read/write TRANSPORT — so the URL, never the tool name, decides the panel. omp replaced the hub tool with it (hub last used 2026-09-24; proc:// from that same day on; 298 proc:// calls and 503 hub calls in the author's session store). The grammar is internal-urls/proc-protocol.ts: proc:// lists, proc://<id> reads status/log, write proc://<id> sends stdin (empty = Enter), write proc://<id>/kill cancels a job or stops a service, write proc://<id>/mode sets persist|session|detached. toolPanelKind (tool-renderers/registry.ts) tests procPathOf(tool) FIRST — before the xd:// device and before the tool's own name — and resolveToolKey returns proc, so write proc://x/kill is a Proc card and not the EDIT panel (which rendered the stdin payload as "Written File Preview") while read proc://x is not the READ panel (which rendered the service log as file contents under a javascript badge).

  • One reader for every result shape, in src/shared/lib/omp/session/proc.ts. Measured shapes of details.proc: {action,daemon} (stop/stdin), {action,daemon,input} (stdin), {action,daemon,mode}, {daemon,log,terminalRows} (a service read), {job,log} (a job read), {jobs,agents,daemons} (the listing), {op:'cancel',jobs,cancelled} (a job kill). The legacy hub tool carried the same keys at the TOP level of details ({op,daemon}, {jobs}, {daemons}), so procViewOf prefers the nested bag and reads through to the top level — one ProcView for both, which is why hub's PANEL_KINDS row is 'proc' and not a second panel. procOpLabel maps omp's action to the word a reader sees (stop|kill → stop, read|list → list), and procRequestOp(path, toolName) resolves the one ambiguity the path alone cannot: a bare proc://<id> is stdin on the write transport and read on the read transport.

  • panels/Proc.tsx is the body (it replaced Hub.tsx, which only ever read details.jobs/details.items). It draws the daemon fact strip (state with its own tone, pid, up/ran span, exit code, restarts, persist/detached), the stdin payload a write sent, a job row, the cancelled outcomes a kill returned, and the listing as three groups (Services / Jobs / Agents). Terminal rows are ANSI-stripped — omp hands the log back terminal-formatted (\u001b[0m\u001b[2;38;5;11m$\u001b[0m …), and the panel is not a terminal. A named process is deliberately NOT echoed as raw text under its own facts (Started kabmo: ready pid=43148 … under ready · pid 43148 is one sentence twice); a FAILED call still shows its reason.

  • The span a daemon reports is the span it RAN, not the time since it started. procUptime ends at exitedAt when the daemon exited — a service that died an hour ago has not been up for an hour. Verified in the browser against a real transcript: the card read exited · ran 16m 29s · exit 0, and the header facts read stop · exited · ran 16m 29s · exit 0.

  • A RUNNING task row carries live telemetry, and ONE formatter draws it for both cards (src/shared/lib/omp/session/job-progress.ts, omp 18.13.0). omp lifts requests, cost, contextTokens, contextWindow and stage out of a task's progress record into the job snapshot behind wait and read proc://, which is what makes its own row read … · 90 req · $18.40 · ctx 160K/1M · stage: implementing; before this the panels parsed the model and the clock and dropped every number about what a running subagent was spending. The FIELDS and their order are omp's; the token rounding is Kabmo's own (formatCompactTokens → 163.8K/1.0M) so a job row cannot disagree with the context ring beside it, and the cost cutoff IS omp's (<$0.01 below half a cent). Gated on status === 'running' for omp's own reason: a stored snapshot must never paint a live counter over a settled row. The wait row already shows the percent as a chip, so its line omits the estimate; the proc row has no chip and carries ~55%. Verified in Chromium on the demo session: expanding the card rendered 90 req · $18.40 · ctx 163.8K/1.0M · ~55% · stage: implementing.

  • A job row LEADS with the model's intent, and the command sits under it (jobSubject, same module, omp 18.15.0). omp now records the i intent of the call that started a job on the job itself, and its own /jobs rows, proc:// listing and jobs sheet print it before the command line — because bun run dev does not say what the job is for. Both Kabmo cards parsed label alone, so the purpose the model had already written was dropped. Measured with the release's own snapshotJobs, given a bash job whose call carried intent: "Start the dev server": it comes back as {id:'bg_1', type:'bash', status:'running', label:'bun run dev', intent:'Start the dev server', durationMs:42000}. jobSubject returns {primary: intent, secondary: label} so the intent is the subject and the raw command the muted line beneath it; with no intent (every task job, and every job recorded before 18.15.0) primary IS the label and there is no second line. It is one resolver because the wait card's HEADER (card-header.ts), both job rows, and the proc:// cancelled rows all name the same job — three copies is how a card and its row start naming different things.

  • Facts and phrases ride the same reader. src/shared/lib/chat/tool/proc-facts.ts (split out — summary.ts is at the size ceiling) produces the chips, and toolSummary guards its read/write branches with isProc so a proc:// write can no longer report 1 lines (the line count of its own stdin payload) or a proc:// read a file size. A cancelled job is excluded from the process count — counting it said 1 process · 1 job cancelled for a kill that found exactly one job. describeToolActivity returns Stopping <id> / Sending input to <id> / Setting mode on <id> / Reading process <id> / Listing processes, because Reading proc://kabmo-dev/kill describes a service stop as a file read.

  • A bash that launches a named service answers with details.service — the same snapshot, read by the same code. 442 real results carry it ({name, state, ready, timedOut, pid}). Bash.tsx renders it as a strip above the command (name, state, pid, span, exit code, and the read proc://<name> it can be inspected with) and bashServiceFacts gives the collapsed card its chips; without either, the only thing the card said about a live dev server was its exit code. Verified in the browser on a real session: SERVICE · tls-fixed · ready · pid 81406 · read proc://tls-fixed.

  • A minimized bash result says so, and the lossless original is one click away (src/shared/lib/chat/tool/minimized.ts, omp 18.16.0). omp's shell minimizer compresses verbose output (git, npm, cargo, …) and records the rewrite in details.meta.minimized — {filter, inputBytes, outputBytes, artifactId} — with the untouched stream saved beside the session as <id>.bash-original.log. Measured on a real child (git --no-pager log in a 60-commit repo): inputBytes: 10970, outputBytes: 3905, artifactId: "0"; the field arrives on the live bash result AND on the reloaded transcript, so both paths read it. minimizedOutputOf refuses a record missing either size rather than printing → 0 B. The chip ranks ABOVE the line count in the collapsed row, because the count describes the rewrite; a 2-fact row would otherwise fold the qualifier into +1 and hide it behind the number it qualifies. artifactRefOf reads the minimizer record FIRST and returns kind: 'bash-original' (already in ARTIFACT_KINDS, so the route and reader needed no change), with elidedBytes = inputBytes - outputBytes — a truncation record only ever names the already-rewritten stream, so preferring it would have opened the wrong file. Verified in the browser on a real 18.16.0 session: Minimized · git · 10.7 KB → 3.8 KB · the output below is the filtered rewrite above the command window, and the chip's modal at 10.7 KB · 360 lines · 6.9 KB elided inline.

  • A numbered code block is ONE component (shared/numbered-code.tsx), because six panels each stated the line box themselves and three had drifted. Read, Edit's write preview, ExcerptCode, Eval (twice), JsonCodeBlock and ArtifactBody all drew a gutter beside code, and every one of them restated the box in Tailwind classes. Measured in the browser: JsonCodeBlock was the worst — the gutter was text-[10px] and the code text-[11px], both under an inherited leading-relaxed, a RATIO, so the row boxes were 16.25px against 17.875px and each number sat 1.63px higher than its line; by line 20 the number was 30.9px above the code it labels. It backs the Bash console output, the eval result, the card's input JSON, task results and the full-output reader, so the defect was visible almost everywhere. ExcerptCode was a constant −1px for the same reason (half-leading is (box − font) / 2, so a smaller face sits higher under the same box), and Edit's write preview rendered one MORE gutter row than it had lines (81 numbers beside 80), because its … truncation marker was gutter-only — every number past the marker sat a line above its code. The component makes those unrepresentable rather than merely fixed: the box is an explicit px pair applied to both columns as inline style (never a ratio, never an arbitrary-value class a build could drop), both columns carry the same font size (a gutter is differentiated by colour and weight, never by size), and both sides are one element per line so the counts cannot disagree — a single <pre> with <br> separators and a row-per-number gutter is a pair that agrees only by coincidence, since a trailing <br>, an empty last line, or a highlight that returned fewer fragments moves one side and not the other. The gutter must not carry the tabular-nums CLASS: that class also sets font-family: 'Fira Code' (tailwind.css), which beat the code column's own utility and put the two sides in different faces — a measured 1px ink offset on every row — so the feature is set inline (fontVariantNumeric) and the family is inherited identically by both. Verified in Chromium on the demo session and on a real 195-read/72-write session at 1440 and 390: 0px ink drift and matching row counts on every gutter, against 30.9px and 81-vs-80 before. Pinned by shared/numbered-code.test.tsx (the shared box, the inline-style requirement, the row-count invariants, a blank line, a missing fragment, the … marker) and panels/Eval.test.tsx; the earlier Eval test compared the two sides' leading-[…] CLASS, which passed while JsonCodeBlock carried the same bug.

  • The highlight memo stores the SHAPE each caller asked for, because one key has two. highlight-memo.ts is keyed by (language, code), and two callers want different markup for the same code: highlightCode answers ONE inline string (structure: 'inline', no newlines) while highlightLines answers one fragment per source line. One slot for both meant the line path split the block path's string — a 7-line JSON block that had already been drawn as a block came back as a SINGLE row, so NumberedCode drew seven numbers beside one line of code. Measured on the Ubuntu gate as Expected length: 7, Received length: 1 in Eval.test.tsx, and it is a real card: the eval result's JSON is drawn by both paths, and which one ran first depended on the file order. The entry now carries block and lines separately, and the character budget counts both.

  • A virtual URL never reaches /api/fs/read. The Read panel's lazy fallback points that route at whatever path a read named, and proc://kabmo-dev is not a file: the route refused it and the panel printed // Loaded file: proc://kabmo-dev as if that were its contents. isVirtualPath (shared/lib/fs/paths.ts) gates the fetch; a bare C:\x (one colon) stays a path. Verified in the browser: zero fetches for the virtual URL, and src/x.ts still lazy-loads.

  • The demo datasets carry the real shapes. tools-session's hub sample has its measured details, and virtual-devices-session renders a proc:// read (a ready daemon with ANSI terminal rows) and a /kill (the same daemon exited) from samples/virtual-devices-proc.ts — split out because that session file is at the size ceiling. A sample without details renders as a fallback and hides every panel bug this section exists to prevent.

Blocking Tool Cards (wait, and the reload shape)

  • A tool call's card is chosen by the TOOL, never by its result — a wait with no toolResult is still a wait. A page reloaded while the call blocks reads the transcript, which holds the assistant turn's toolCall block and one tool_execution_start entry and nothing else; omp's own "Nothing to wait for: no background job or service you started is running" answer goes further and writes details: {}. waitViewOf (src/shared/lib/omp/session/wait.ts) used to require details.op, so both shapes classified as "not a wait": toolPanelKind still said wait, the panel returned nothing, and the card fell through to the generic Input/Output body — the reported "wait renders as general after a reload". The tool's own NAME is now the fallback discriminator (only wait; send/cancel/jobs stay result-only, because proc:// owns them), and the view carries reported: false so no reader claims a job list it does not have (waitFacts emits the clock alone, the panel draws no Jobs section and no "no jobs" chip).

  • The clock of a resultless call is its tool_execution_start entry, which is the only place it exists. collectToolOutputs joined that entry only for calls that HAD a result, so a reloaded call lost startedAt entirely and the panel's stopwatch had no source. It now records every start entry, and a call with no result is pending: true with output: '' as a PLACEHOLDER, not an answer.

  • pending is a claim about NOW, so only a live run may make it. The same transcript is left behind by a run whose process died, and a call stuck at running in scrollback is the spinner-forever bug. loadSessionMessages(filePath, { liveRun }) takes getLiveRunSessionIds().has(sessionId) (routes/chat/session.ts) — the same predicate GET /api/agent/:id reports as busy — and only then does the call render as running with no output. Measured over the author's store: 24 of 160,189 started calls have no result entry (11 bash, 9 eval, 1 wait, and one each of goal/edit/write), so the shape is rare but real, and a truncated copy of a real session reproduced it exactly (details: undefined, status success, empty output).

  • A fold mounted by a reload owns no rows, so a late result needs the TRANSCRIPT to find its card. toolResultsRef/lastToolMessageRef belong to a fold that streamed the call; after a reload they are empty and every tool_execution_update/tool_execution_end had no target — the reloaded card kept its resultless shape for the rest of the run. toolMessageFor (shared/lib/chat/omp/tool-results.ts) falls back to ToolResultHost.resumedToolMessage, which useOmpAgent answers from the timeline's own localMessagesRef (wired from useChatTimeline), and ADOPTS the row it finds so the next frame pairs without asking again. Both halves are pinned by wait.e2e.ts › "a reload mid-call still draws the wait": reverting the waitViewOf fallback makes the stopwatch locator never appear, and reverting the resume lookup leaves the card reading Wait Running for the whole 40 s budget (measured, both reverted one at a time).

  • A blocking wait has no 30-minute ceiling any more, and its result is a WINDOW, not a cap (src/shared/lib/omp/session/wait-idle.ts, omp 18.17.0). omp deleted WAIT_MAX_MS and the "Wait limit reached" answer: a wait now returns when its window elapses with nothing new, and the window climbs a ladder — 5 s, 10 s, 30 s, 60 s, 5 min — across back-to-back idle waits, resetting once the agent works in between. From the second rung it appends <system-notice>Nothing new after 15.0s of back-to-back waits…, which is what tells the model waiting is not progress. Neither the rung nor the streak is a field on the result, so waitIdleOf parses the prose ("No reply within 5.0s.", "No service finished within 30s.") and waitIdleLabel words the chip (idle 10s, idle 15s total). 18.18.6 changes that sentence: it appends the ladder's next rung after a semicolon ("No reply within 5.0s; a back-to-back wait allows up to 10s.") and words a job timeout as "No job finished within 30s; …". The parser accepts both the old period and the new semicolon — a regex requiring the period made both the card's idle badge and the summary's idle … fact vanish on 18.18.6, while persisted sessions still carry the old form. The card used to count down to the old cap (0:07 left of 30:00); that countdown claimed a budget omp no longer has and is gone.

  • details.waited is a LIST (omp 18.17.0), and the old single object is still read. One wake returns every message queued by then — messageResult(senderId, waited: IrcMessage[]) — while a session recorded on 18.16.0 keeps {from,to,body,ts} in its JSONL, which is what a reload reads. WaitView.waited is WaitMessage[] and messagesOf accepts both; parsing with isRecord (which refuses arrays) made the field undefined and the message block vanished silently.

  • Since omp 18.18.9 a received message is its OWN turn, not a wait result (src/shared/lib/chat/irc-notice.ts, IrcNotice.tsx). messageResult and drainPendingInbox are gone: handOffMail gives the message to the recipient session, which injects a customType: "irc:incoming" user turn, and the wait answers Wait interrupted by message. with {op:'wait', jobs:[], interrupted:true} and no waited. The turn's content is the <irc> prompt envelope (tag, "reply via write" instructions), so both transcript mappers read details.from/details.message instead and draw IrcNotice; rendering the notice text directly would print the model's prompt scaffolding. The wait card keeps its waited block only for JSONL recorded on 18.17.0–18.18.6 — measured on a real persisted entry, whose details is exactly {id, from, message}.

  • omp's embedded shell trace never enters the transcript (src/shared/lib/omp/session/shell-trace.ts, omp 18.17.0). Every bash progress frame and result carries details.trace — {units, history}, with history repeating the command's output — whether or not anyone draws it on 18.17.0. 18.18.0 gates it on display.shellVisualization (default true), so the field arrives unless an operator turns that row off; Kabmo's strip is the same either way. Measured on this machine: 40 output lines → 192 KB of frames against 19 KB on 18.16.0; 120 lines over 73 s → 242 frames / 9.2 MB; a 40 000-line result → 311 KB frames; seq 1 30000 → a 201 KB trace on the result. stripShellTrace drops it in EventFanout.emit (the one point every subscriber is reached — the session:<id> topic publishes straight to each open tab) and withoutShellTrace drops it when a transcript is read back from disk. A frame over 1 MiB is legal only because Kabmo negotiates protocol v2: measured, a 1005 KB frame arrived as 72 rpc_chunk records.

Dictation (composer mic button)

  • The mic button runs omp's OWN speech-to-text, not a second implementation. omp ships STT as a TUI feature — stt.enabled, stt.modelName, stt.submitTrigger under Interaction → Speech — with local on-device models and no API key. It is turned on by the app.stt.toggle keybinding and captures the microphone of the machine running the TUI through @oh-my-pi/pi-natives' AudioCapture.
  • None of that surface reaches a web client, which is why Kabmo drives the WORKER instead. Verified against omp 18.4.10: stream_start / stream_audio / stream_stop / stream_cancel / transcribe / download are all answered Unknown command over --mode rpc (the surface Kabmo's agent bridge uses), and no STT entry exists in get_available_commands — it is neither a slash command nor a tool. What omp does expose is omp __omp_worker_stt, and its transport is Bun IPC, not stdio: the worker is spawned with stdin/stdout set to ignore, serialization: "advanced", and frames arrive on the ipc channel. A stdio client sees a silent, unresponsive process. The Kabmo runs on Bun, so omp-stt-worker.ts spawns the same worker and speaks the same frames.
  • Frames (request/response by id): → {type:'ping', id}, {type:'transcribe', id, modelKey, audio, language}; ← {type:'pong', id}, {type:'progress', id, event}, {type:'transcription', id, text}, {type:'error', id, error}. audio is a Float32Array of normalized samples at 16 kHz, sent as structured clone over the IPC channel — NOT base64 and not an encoded file (a base64 WAV string fails with "AudioContext is not available in your environment"; a Uint8Array fails with "expects input to be a Float32Array"). The browser side captures PCM16, and src/server/routes/dictation/ws.ts converts with pcm16ToFloat32 before transcribe — so the PCM16 lives on the WIRE (browser → server), not in the worker frame. omp 18.8.x also exposes a STREAMING path (stream_start/stream_audio/stream_stop/stream_cancel with partial/segment events, segmented by the worker's endpointer) which Kabmo does not use yet: it still sends one utterance per socket, which is what omp's own TUI does (its text appears on release, not per word).
  • Model keys are omp's, and the default is deliberately NOT omp's. The four keys are whisper-base, whisper-small, whisper-large-v3-turbo, parakeet-tdt-0.6b-v3; anything else answers Unknown stt model. omp's own default is Parakeet v3, which covers 25 European languages only — so Kabmo defaults to whisper-base, the smallest MULTILINGUAL tier (~80 MB on first use). A first run that downloads 465 MB to transcribe a non-European language wrongly is the worst possible default.
  • One utterance per socket, and the audio travels in ONE frame. Streaming chunks while the user speaks buys nothing: omp's STT is not incremental (its own TUI inserts text on release), so a chunked transport would only add reordering and reassembly for a result the final decode replaces. The socket exists for the other direction — the server pushes model download progress while a first-run decode waits on a fetch.
  • The two progress numbers under the same field are different quantities, and neither is dependable enough to trust blindly. progress_total covers the whole download while progress covers a single file, so only the former may set the figure — the per-file value taken as the total jumps backwards at every file boundary. But on a real first-run fetch (omp 18.4.10, ~76 MB at ~68 KB/s) the total reached 100 within the first eight seconds and then climbed past it to 2654 while the files were still arriving, because loaded accumulates across retries while total stays fixed. summarizeProgress therefore reports a progress_total outside 0..100 as INDETERMINATE (percent null, status stays "downloading") instead of pinning a 100 that would sit on screen for the whole download and read as "finished but stuck". The route then drops frames that do not move the percent by a point or flip the phase — a single download emits hundreds of them.
  • Capture uses AudioContext + ScriptProcessorNode. The node is deprecated in favour of AudioWorklet, but it is the only capture path every target browser ships (Safari included) without serving a separate worklet module. MediaRecorder is not an option: it emits Opus/WebM, which the worker cannot decode.
  • Every shell needs its own capture wiring, and each one fails differently. The page's getUserMedia is the same call everywhere; what differs is the host, and a missing piece is silent in a different way on each platform:
    • Android WebView needs MODIFY_AUDIO_SETTINGS in the host manifest, and nothing in the app says so. RECORD_AUDIO granted plus onPermissionRequest granting RESOURCE_AUDIO_CAPTURE is not enough: Chromium's Android audio path selects a communication device before it opens the capture device, and that selection is gated on MODIFY_AUDIO_SETTINGS — a NORMAL permission, so there is no prompt, no settings row and no runtime check to fail. Without it the WebView logs Unable to select communication device! and getUserMedia({audio: true}) rejects with NotReadableError: Could not start audio source before any AudioRecord exists, which is why the app's own permission grant looks correct while the microphone never opens. Chrome declares the permission in its own manifest, so the same page records in Chrome on the same device and not in the shell.
    • macOS needs NSMicrophoneUsageDescription in the bundle (a missing key TERMINATES the app on first use, it is not a refusal) and WKUIDelegate.webView(_:requestMediaCapturePermissionFor:…). WebKit's documented default for an unimplemented delegate method is .prompt, and this shell has no prompt UI, so the request never resolves — the mic button looks dead while navigator.mediaDevices exists and the click runs. ShellUIDelegate grants microphone/camera and denies anything else; MediaCaptureWindowTests pins the selector, because a near-miss Swift signature still compiles.
    • Linux (WebKitGTK) needs WebKitSettings:enable-media-stream (default FALSE, so navigator.mediaDevices is undefined and the mic button never renders) and an answer to the permission-request signal (default: deny). configure_view sets the setting and allows only UserMediaPermissionRequest audio/video, which is bounded by the navigation policy — the webview only ever hosts the server's own origin.
    • iOS was correct from the start: ShellNavigationDelegate is both delegates, grants the capture types, and Info.plist carries both usage descriptions.
    • Windows is the one shell with no code for it: WebView2's PermissionRequested defaults to CoreWebView2PermissionState.Default, which shows WebView2's own prompt ("This file wants to use your microphone"), so capture works after Allow. Nothing in the shell grants or denies, so that is the platform's default rather than a decision this repo made. The composer used to report every non-NotAllowedError rejection as a bare "Could not open the microphone."; shared/lib/dictation/capture-failure.ts now names the DOMException, and ManifestCapturePermissionsTest pins the Android manifest (it also asserts every Manifest.permission.* the chrome client grants is declared).
  • The worker handle is anchored on globalThis for the same reason the database and terminal store are: bun --hot re-evaluates the module while the spawned worker (and the model it holds in memory) lives on, and a module-level binding would orphan the child with no handle left to kill it. It shuts down after 10 minutes idle, and /reload-engine recycles it alongside the other omp processes.
  • The WebSocket upgrade is origin-checked with the same predicate the terminal uses (server/lib/http/same-origin.ts), because dictation triggers real work — a model download and a decode — and an upgrade carries no preflight to stop a cross-origin page from asking for it.

Composer Prompt Recall (ArrowUp / ArrowDown)

  • The list is its own table, not a scan of the transcripts. A session's user turns live in omp's JSONL (or the chat_sessions overlay), so the merged list a pending new-… chat asks for would mean reading every session file on the machine. prompt_history (src/server/lib/chat/schema.server.ts) holds one indexed row per dispatched prompt, and GET /api/chat/prompt-history answers both scopes: ?sessionId= for one chat, no parameter for the merged list. Duplicates collapse to their newest occurrence (GROUP BY text), and the route is mounted BEFORE /api/chat/:sessionId — the static segment shares its position with the parameter route.
  • Recorded at the HTTP boundary, never inside the RPC dispatch. POST /api/agent/:sessionId records prompt / steer / follow_up / abort_and_prompt (the vocabulary is RECALLABLE_COMMAND_TYPES in shared/lib/chat/composer/history.ts), and POST /api/agent/new records the first prompt of a new chat under the id the child reported. The dispatch also carries Kabmo's own control prompts (/kabmo-mode …, title requests, goal kickoffs), which are not something the operator typed. A repeat of the session's newest entry is dropped, so a refused send that the queue replays does not double up.
  • The cursor rules are pure and tested (shared/lib/chat/composer/history.ts): -1 is the draft, ArrowUp enters the list at its newest entry, ArrowDown walks back to the draft, neither end wraps, and an arrow only recalls when the caret is on the list's edge of the TEXT (first line for up, last line for down) — a multi-line draft keeps its normal arrow behavior. A modified arrow (Shift/Ctrl/Cmd/Alt) and an IME composition are never consumed.
  • One GET per entry into the list, and none before it. useComposerHistory (client/hooks/chat/composer/history.ts) fetches on the first ArrowUp from the draft, so a prompt sent a second ago is the newest entry; everything after that is in memory. An emptied draft (a send) resets the cursor, so the next recall starts from the newest entry again. Verified in the browser against a temp database: ArrowUp in an open chat requested ?sessionId=smoke-session and filled the box, ArrowDown restored the typed draft, and the same key on a pending new-… chat requested the merged list and recalled a prompt from another session.

Chat Transcript Store (chat_sessions)

  • The Kabmo's copy of a conversation is an OVERLAY, not a transcript. For a session omp owns on disk the session JSONL is authoritative (loadSessionMessages → mergeOmpAttachments), and the DB row carries only what the JSONL cannot record: the user turns — the text as the user typed it, since omp delivers @agent as a task-tool delegation prompt and /skill:a b as /skill:a, plus the attachment metadata, since a text file is inlined into the prompt and its name/content/preview exist nowhere else — and the notice rows (a builtin command's output, for which omp writes no entry at all). Nothing else in the row is read: merge-stored.ts filters on role === 'user' and on a non-empty notice, and no code path reads an assistant row.
  • Only those rows are written. overlayRowsForOmpSession (src/server/lib/omp/session/merge-stored.ts) narrows what the POST handler stores, gated in src/server/routes/chat/session.ts on findSessionFileById — the session file's existence, never the id's shape: a Kabmo-created new-<ts> session has no file, and there the DB is the only copy, so it stays whole, as does an omp uuid whose file is gone. Before this the client posted its entire rendered timeline on every message_end and the server stored it verbatim — measured on the author's install at 165.6 MB of 167.9 MB of mirrored assistant rows nothing consumes, on top of re-writing a multi-megabyte array per stream segment with no body-size guard. Verified: narrowing changed the merged timeline of 0 of 260 stored sessions compared against their own files.
  • Nothing the narrowing drops is needed to place a row. A stored raw turn that no JSONL user turn relates to — a /usage or /compact turn, for which omp writes no entry at all — is positioned by its own startedAt against the merged rows' clocks (anchorIndexFor in merge-stored.ts), never by scanning the stored array for a row the JSONL carries. That scan is what made the first version of this narrowing move those turns to the END of the timeline, after answers that came later: it resolved against the mirrored rows that are exactly what gets dropped. The scan survives only as the fallback for a legacy row with no clock to read. Verified on the author's install: of the sessions holding such turns, only the ones whose anchor the scan had been supplying changed order, and they changed to the time the turn was sent. Do not "fix" the missing assistant rows — their absence is the point.
  • compactChatOverlayRows applies the same rule to rows written before it existed, called from the server bootstrap right after the "listening" banner (src/server/index.ts) and deliberately NOT from getDb(): the test suite and the CLI reach that in real mode, so a database handle must never be able to launch a rewrite of every mirrored conversation — a bun test run did exactly that, compacting a live 172 MB database. It has no marker, unlike queue_fk_removed: the guard is per-row ("does the filter actually shrink this row?"), so the pass is self-limiting — measured 762 ms for a 173 MB overlay on the first start, then one parse-and-skip of the remaining ~5 MB — whereas a marker would leave every row written by an older build uncompacted for good, and a live server keeps writing mirrors until it is restarted. Only a row whose session file exists is rewritten, so a Kabmo-created session stays whole. The rewrite makes the freed pages reusable; VACUUM on a stopped server is what returns them to the filesystem.
  • Two other writers sit deliberately outside the gate: src/shared/lib/chat/stream-service.ts is the MOCK SSE path, where the DB genuinely is the transcript, and src/server/routes/chat/root.ts's action is the pre-migration writer that no client calls (its loader's ?sessionId= branch likewise has no caller).
  • The timeline mounts a WINDOW of its rows, and the height of everything else is a spacer. Every row used to stay in the DOM for the life of the session: ?before= paging only ever PREPENDS to the same array, so a long session accumulated nodes for every page the reader had scrolled through. Measured on this machine (production bundle, WebKit, one 9.4 MB session, ten pages of history): 107 807 nodes and 891 MB of WebContent footprint before, 2 627 nodes and 251 MB after — and not one node was released when the reader scrolled away in the old build, while a reload of the same session brought it back to 11 438 nodes, which is what says the cost is the mounted rows rather than the data. shared/lib/chat/timeline/row-window.ts is the arithmetic (measured heights, prefix sums, the visible range, the scroll offset a jump lands on) and client/hooks/chat/timeline/row-window.ts is the DOM half (measuring, the anchor, the reveal). Three rules make it safe rather than merely smaller: heights are MEASURED, never assumed (a user bubble, a thinking accordion and a tool card with 1 000 lines are all one row; unmeasured rows take the measured average, and a 0 from a hidden row is not a height), a measurement must not move the reader (the anchor is the row at the top edge plus its offset, and it stands down when something else — a jump, the follow pin — moved the viewport in between), and the tail is an anchor of its own (a reader at the bottom follows the BOTTOM; a row anchor left an opened session 2 080 px short, outside scroll.ts's 100 px follow threshold, so the stream silently stopped following). Two failure modes were measured while building it: the effect that subscribes to the scroller must key on the scroll NODE as state rather than on the ref (the body is behind the full-panel skeleton, so a ref-keyed effect ran once, before the scroller existed, and the timeline mounted the first rows under a viewport scrolled to the bottom), and scrollTop assignments ANIMATE because the container carries scroll-smooth — CSSOM-View resolves the setter's behavior: auto against the element's computed scroll-behavior, so a correction loop has to write behavior: 'instant' or it never lands. MessageList keeps rendering every row when it is given no window, which is what the BTW panel and the pending-chat view want.
  • A prepend holds the ROW the reader was on, not a pixel delta. session-pagination used scrollTop += scrollHeight - prevHeight, which was exact while every row was mounted. With a window, the prepended rows are estimates until they mount and are measured, so the height keeps changing for several frames after the commit — measured: "Load earlier messages" moved the reader 10 641 px off the row they were reading. The anchor is now the row at the top edge of the viewport and its own top edge, corrected on the frames that follow, and it does nothing on a frame where that row is outside the mounted window (the window hook owns the position then; the pixel delta wrote the viewport 10 500 px away).

Follow-up Queue (delivery, ordering)

  • One delivery attempt at a time per session — the triggers used to overlap. Every trigger — the run-end timer, the 2 s retry, and a tab's POST /queue/deliver (which runs the attempt immediately, with no timer, because the failure it recovers from is a lost timer) — used to enter deliverNext (src/server/lib/queue/delivery.server.ts) independently. Two overlapping attempts claim two different heads, and each requeue then decides the order the pair comes back in. Measured on this workstation: a session with eight queued follow-ups walked from positions 0..7 to -8..-1 while the panel reordered itself between retries. deliverNext now keeps one in-flight attempt per session on globalThis (__ompQueueDeliveryInFlight) and every other caller shares it.
  • A failed dispatch puts its row back at the position it was CLAIMED from, never below the queue. requeueHeadQueueItem used to insert at MIN(position) - 1, which looks equivalent to "the head" and is not: with a second claim already in flight the first requeue lands one slot too low and the pair swaps. claimHeadQueueItem now returns the row's position (ClaimedQueueItem) and the requeue writes it back verbatim, so an overlapping pair can never permute the rest either. listQueue also orders by position, rowid — equal positions must not be returned in SQLite's arbitrary order.
  • omp's agent_busy refusal is evidence, and the wrapper keeps it. A prompt omp refuses with AgentBusyError ("already processing") proves a turn is in flight — but the dispatcher used to translate it to agent_busy and leave the wrapper reading idle, so the queue's isBusy() gate passed on every retry and dispatched at the busy child again. Measured here: 104 refusals for one session, one per retry, each one requeueing the head (the ordering symptom above). dispatchSessionCommand now sets host.streaming = true and arms host.runSettle on that refusal, so the queue parks until agent_end — or, if that frame is lost, until omp's own isSettled verdict releases the flag.

Orchestration (delegation, worker outcomes)

  • Three prompts in a transcript are written by Kabmo, and all three wear an envelope. The composer prepends an orchestration contract to a delegating message (formatDelegationPrompt), a spawned child opens with a dispatched-worker brief (dispatchedWorkerPrompt), and a finishing worker sends its coordinator a child-outcome notice (renderChildOutcomeNotice). All three travel as ordinary prompts, so omp stores them as role:"user" turns — and drawn as bubbles they were indistinguishable from something a person typed: a 1 KB contract with shell heredocs, a preamble quoting its own session id, a report from a session nobody is looking at. src/shared/lib/chat/orchestration/notice.ts owns the markers ([kabmo orchestration contract], [kabmo dispatched worker], [kabmo child outcome]), the parser and the outcome format; the server writes it, UserTurn parses it, and OrchestrationNotice draws the card. The operator's own words stay their bubble — the contract's trailing text is split out as rest, which is why a delegating turn renders as card + bubble and a notice renders as a card alone.
  • A bracketed marker, not a customType. Only a custom_message carries a customType, and these three are prompts; the marker survives omp's JSONL round trip untouched, so the live row and the reloaded row agree. The live echo is kept for a delegating turn (omp-callbacks.ts): the echo carries the CONTRACT, and keeping the optimistic text instead made the card appear only after a reload.
  • A worker's outcome is reported ONCE, at its terminal end. omp retries a transient provider failure by itself and keeps the RUN open across the attempts — auto_retry_start, a fresh agent_start, agent_end {isTerminal:false} between them, and auto_retry_end carrying finalError when the budget is spent. retry-saga.ts folds that into retrySagaOpen / retryFinalError, and settleTerminalRun reports nothing while a saga is open: a coordinator told "failed" mid-saga resent the task while the worker was still working it. runOutcomeReported is the latch that makes a second settle (a synthesized one after lost frames, or the process exit) a no-op.
  • The failure is read from omp's FLAT fields, at message_end. omp records stopReason / errorStatus / errorId / errorMessage on the message itself — there is no nested error object, and reading one is why a worker whose provider answered 400 The model agnes-2-5-flash:free is currently unavailable reached its coordinator as the bare sentence "The run ended with error". deriveTurnError (shared/lib/omp/session/turn-error.ts) is the shared read. It is captured at message_end for the same reason runAborted is: omp compacts an oversized terminal frame by dropping what message_end already delivered, and the failed assistant message is always among them. Measured end to end on a real spawn: the coordinator received status: failed with the provider's full 400 text and reported it without resending.
  • A run that ends without a terminal frame is reported, and never as a success. RunSettle's reconcile (omp answered isSettled after the frame stream stopped) and handleChildExit (the process died mid-run) both emit a synthetic agent_end straight to the fanout, which never passes through the frame fold — so the outcome a real agent_end reports was lost and the coordinator waited for a worker that had already stopped. Both now call noteRunEndedWithoutFrame (interrupted for the reconcile, failed with the stderr tail for the exit).
  • A busy refusal is not an outcome. noteRefusedPrompt used to report failed for any refused prompt, including omp's agent_busy — the run is live (often mid-retry), nothing was delivered, and Kabmo's queue re-sends. AGENT_BUSY_REFUSAL_RE is the gate.
  • The notice window is a timer, so a restart strands it. Outcomes stage in session_notices and a 2 s timer turns them into one queued_messages row; a child that finished during a restart (or a bun --hot reload) left its row with nothing to flush it. drainPendingNotices runs from runAfterListenTasks, and flushNotice logs when the parent cannot be resumed — a coordinator that never hears from a worker is otherwise indistinguishable from one that is still working.
  • The notice names the worker, not its brief. A spawned child's auto-title is derived from its first prompt, which is Kabmo's own brief — measured as title: [kabmo dispatched worker] in a real coordinator's notice. titleOf drops a title that starts with [kabmo ; the session id below it already identifies the worker.
  • omp-acp reports a provider failure as ordinary text, so its transcript is the record. Measured on a real spawn: the agent answered 400 The model agnes-2-5-flash:free is currently unavailable… as an assistant message and ended the turn with end_turn — no stopReason, no errorMessage in the envelope — while omp's own JSONL for the same turn carried stopReason: "error" and the same text. Reading only the envelope reported the worker as completed and handed its coordinator the error as if it were a report. transcriptFailure (harness/acp/turn-outcome.server.ts) reads the LAST assistant record of a harness whose transcript Kabmo can read (omp-acp only) and only when the envelope says completed; every other harness reports failure in the envelope itself, so nothing is guessed for them. A failed turn's text is no longer stored as its answer either — session_answers is what kabmo session output prints.
  • A wedged ACP turn is bounded by silence, and closed as INTERRUPTED. ACP has no get_state probe, so a turn whose agent stopped answering stayed open forever: isBusy() kept the idle reclaim away, the process lived on, and a coordinator waited for a result that could never come. TurnSilence (harness/acp/turn-silence.ts) closes it after an hour with no frame at all — a ceiling, not a detector, and six times the repo's own 10-minute background-work ceiling. It is reported as interrupted with the reason, never failed: nothing observed it fail.
  • Every harness goes through the same outcome rule, and each transport names its own ending. The omp and ACP paths share one notice format but report from different events, because neither has the other's frames: omp reports from the terminal agent_end (with retry-saga.ts holding it back across a retry saga), while ACP reports from settleAcpTurn, which reads AcpTurnEndInfo. Two ACP gaps came from inference rather than the protocol. A v1 agent answers {stopReason: 'error'} WITH whatever it had streamed, so "did it answer" reported the turn as completed — AcpTurns.finish now treats an error stop as a failure on its own. And the exit path emitted prompt_error + agent_end to clients only (reportAcpExit), so an agent that died mid-turn left its coordinator waiting forever; it now reports failed with the stderr tail, and only while a turn is open (a process exiting between turns has no outcome to report). An ACP prompt Kabmo refused itself (AcpTurns.start throwing "already processing") reports nothing, matching the omp agent_busy rule.

Clone this wiki locally