OpenProgram Docs

Conversation lifecycle

Connection ready Visible transcript requested first Bounded execution recovery live deltas remain authoritative
  1. Connection ready
  2. Visible transcriptrequested first
  3. Bounded execution recoverylive deltas remain authoritative
OwnerOwns
TranscriptThe rows of each view, written only by the transcript reducer from reads, numbered updates and typed local changes; one read in flight per view; pagination, search targets, scroll anchors
ExecutionMonotonic cursors and status versions; active task and approval identity. Snapshot recovery does not simulate a new terminal event
ComposerSession-owned draft, attachments, queued entries, acknowledgement. Navigation or disconnect never clears unacknowledged input
Connection generationTimers, pending reads, fragment buffers. Obsolete responses cannot change a new connection or the visible session
ServerAuthorization, execution, cancellation, approvals. No client optimization bypasses them

Storage failures degrade persistence, not event delivery. No new execution runtime, remote service, account integration or history deletion belongs to this design.

Transcript reads

AspectRule
OwnershipOne pending initial or refresh request per session and connection. Navigation reuses it; a mutation invalidates it and keeps one replacement with the latest options
RepliesEach echoes its request ID. Expired, replaced and closed-connection replies are ignored
Deadline15 seconds; session-local loading, disconnected or failed state with a retry button; cached messages stay visible
No mergeA read replaces the server rows of the window it covers. While it runs, the server parks that view's updates and text frames and sends them after the reply, so a read never undoes newer progress. Local rows (sends, function placeholders, notices) and overlays survive it, and a local row goes when a read or update names its clientRequestId. There is no second transcript store
Invalid cursorOne cursor-free read around the reading anchor; failure is visible and retryable, and automatic paging stops
Explicit retryCursor-free anchor read keeping the branch head; a separate latest-history action when the anchor is gone
SafetyLoading transitions do not reset exponential retry delays. Read retries never repeat mutations, submissions, approvals or cancellations

Streaming

  • Text and thinking frames coalesce into one animation-frame store update and are placed by offset into every view holding their row. A numbered update or a read flushes pending text first.
  • Tools, steps, citations, status and terminal rows arrive as numbered transcript_update changes, the same rows a read draws.
  • A text frame whose offset lies past the text the row holds shows a lost frame, and an update that does not follow the view's revision shows a missed one; either way the view reads once at its anchor.
  • Connection close flushes received text before clearing which session each turn belongs to.
  • Rendering primitives: bounded history windows, measured row recycling, lazy full tool output, independent follow locks.

Recovery reads

Recovery reads request snapshot-only mode: the execution record and event cursor come from one SQLite transaction with no event bodies, since persisted streams can exceed 200 MB and the Web replay handler consumes only the snapshot. Explicit event-history clients keep full replay.

The baseline that drove this
MeasureValue
Native refresh until transcript11–14 seconds
Direct initial history request0.18–0.20 seconds
Before the first history request16 recoveries processed; five history loads in one refresh

The reconnect path sent every persisted cursor before the selected conversation, commands run serially per connection, replay snapshots entered the live update path and requested another transcript for terminal executions, and cursor storage synchronously persisted every frame. These are baseline figures, not claims about the optimized App.

Resources during chat loading

Resource polling shares the worker with transcript hydration.

ItemRule
ReuseEach resource-list request reuses one conversation graph, one predecessor index and memoized origin and branch-name results across all visible resources; the current-branch query may use one separate snapshot. They live only for that request
AuthorityVisibility, execution attribution, control reconciliation and stable branch-reference selection stay authoritative
ResultEquivalent queries take 124–147 ms instead of 5,741–5,760 ms on the affected conversation (resource query only, not page load)

Acceptance

ScenarioRequired outcomeEvidence
Open or reconnect (useWS)Visible history requested before saved execution recovery. No replay-driven transcript storm. At most one recovery in flight; duplicates coalesceControlled transport tests; native cold and warm refresh timing
Switch A → B → AThe draft survives and A opens at its latest. Late A responses cannot replace B. Cached content stays during refreshRapid switching and delayed responses
Long history, paging, jumpBounded reads and DOM, stable prepend anchor, stale cursor recovery, earliest message reachable, explicit retryLarge transcript, oldest, latest and search targets, interrupted paging
Streaming text and toolsFrame-batched; reading history is not interrupted by auto-follow. Expanded output loads on demand; completion flushes final deltasBurst and delayed deltas, output expansion, long-content render budget
Send, queue, steer, stopInput retained until acknowledgement; no duplicate on reconnect; explicit queued, sending or failed state; cancellation cannot revive the old turnDisconnect before and after ACK, active queue, retry, cancellation
Approvals and questionsWaiting is distinct from generating. Reconnect restores waits. A stale answer cannot resolve a newer generationRefresh during ask or approval; terminal cleanup
Background and nested workStatus recovers without resetting the foreground transcript or merging child historyTwo-session and nested execution tests
Errors and accessibilityVisible, keyboard-accessible recovery; no false success, infinite spinner or lost draft; reduced motion and narrow layout usableTransport faults, keyboard checks, native visual inspection
References
ReferenceBehaviorOpenProgram
Codex App ServerSeparate stored thread reads, resume, paginated turns and items, notificationsSeparate transcript and execution recovery ownership, on OpenProgram's protocol. Experimental pagination is a reference, not a dependency
Claude Code interactive modeQueued input, interrupt, editable queue, background tasks, prompt historyDrafts and attachments independent of connection and execution; delivery and approval state explicit
Claude Code checkpointingConversation and file restorationOwn branch and rewind semantics; viewing history never executes or rewinds

Observable behavior and public protocols only, not private implementation or benchmark equivalence.

Implementation status

PartStatus
ImplementedRecovery ordering, snapshot-only reads, correlated history requests, visible retry, session-scoped streaming buffers, the resource projection, failed-reply details, streaming steer interruption, stopped-turn history retention
Automated coverageBounded large-history rendering, anchor restoration, failed cursor renewal and keyboard retry, peer-session isolation, draft and attachment ownership, queue receipts, stop and steer ordering, question remounts, IME, narrow layout and reduced motion
Installed AppAcceptance is a separate release requirement
Last updated · 2026-11-25