OpenProgram Docs

Chat turn visual specification

PartCode
Componentsapps/web/components/chat/messages/
Stylesapps/web/app/styles/chat/; step colours in apps/web/app/styles/tool-tones.css
Summary sentenceTool group summary
File attribution, Undo, recoveryFile changes, Review and recovery

Message surfaces

No avatars and no speaker line. The text column lines up with the composer's edges.

SurfaceLookBehaviour
User bubbleRight-aligned, content width up to 75% (88% narrow and in split panes). 16px corners, 10px 16px padding, no border. Fill --user-msg-bg (= --bg-input), --composer-shadow.Hover deepens to --composer-shadow-focus. Code blocks and collapsed pastes inside use a --bg-primary inset. The message that set a Goal (startsGoal) opens with the target icon (16) and “Goal” in --accent-blue, weight 500, on the first line of its text.
Assistant replyFlat on the page. Blocks are separated by one --reply-gap of 22px; a heading gets half a gap more above and a third less below.No token or service-tier footer.
Queued rowBubble surface, 10px corners, above the composerA user message not yet sent
Pending sendBubble at 60% opacityA send that never reached the server says so on a line under the bubble.
Edit boxFull column, --bg-input, 23px corners, composer shadow, deeper on hover and focusKept attachments (each removable), new-attachment strip, composer input row with @ file mentions. Bottom row: paperclip (ghost round icon-sm, “Add images or files”), then Cancel (elevated sm) and Save & resend (primary sm). Esc cancels, ⌘/Ctrl+Enter saves, files can be dropped. Action row hidden.

Two marks are not avatars: a compact 18px identity line above a reply from a named non-main agent in multi-agent sessions, and the ƒ marker of a manual function run.

Action row

AspectRule
PlaceUnder every message: right under a user bubble, left under a reply at --reply-gap − 3px. Height stays 24px.
OrderTimestamp, Copy, Regenerate and Pin as chapter (assistant), Edit (user), Rewind to here (user, when later replies changed files), ‹ N / M › for sibling versions
ButtonsGhost round icon-xs (24px), 16px animated line icon, muted ink at rest, primary ink and round muted fill on hover. Hover and keyboard focus drive the icon.
LabelsHoverTip + TipBody after 1.5s, never a native title; same text as aria-label
VisibilityTransparent until the message is hovered or holds focus. Always visible on touch and on a pinned chapter.
Busy, copiedDisabled at 40% opacity. Copy shows a green check for 1.2s.
Time contract
ItemRecords
User messageLocal time on successful send
Agent reply, independent function or runtime messageStart time, when its first visible state is created
Thinking and tool steps inside an AgentThat Agent message's start time. Independent runtime and sub-agent messages keep their own.
Later updatesStreaming, terminal updates and hierarchy moves preserve the time; after reload persisted time wins.
Before the first reply contentOne temporary row, start time right after the status text, no normal footer

Execution timeline

Summary row

  • One plain-text row plus ›, no outer frame or button background, aligned to the body column. 28px tall; hover only brightens the text.
  • Sentence, then any live retry state, red “· N failed”, Stopped or Interrupted tag, and the +N −M pill. The sentence truncates to one line.
  • Reply text is always visible.
Transcript viewTool groupsSteps
normal (default)CollapsedCollapsed
thinkingOpenThinking steps open
verboseOpenAll open

Per-browser preference, one default plus one choice per conversation. A manual click wins over the view and over later streaming and terminal updates.

Step rows

Main rowNested row
Minimum height30px26px
Left padding34px30px, indented 6px
Icon box24px20px
Rail, 1pxAt 11.5px, fades over first and last 12pxAt 9.5px
  • Text: verb title (Ran, Edited, Searched the web…) at weight 500, identifying argument as a chip, first result line in muted text. No raw JSON; the side panel keeps full parameters and output.
  • The icon is the Solar Bold Duotone glyph alone, in the step's tone, on the page colour so the rail stops behind it.
  • Nesting recurses with no depth limit.
ToneSteps
GreenCommands, sub-agents
AmberFile edits
BlueReads
CyanSearches, LLM
IndigoWeb and browser
Purple, fuchsiaThinking; memory
Slate, rose, stonePlanning; media; system
OrangeOther functions
State or targetResult
RunningNormal glyph, conic sweep orbiting it (1.1s); thinking notes show the latest line
FailedRed warning triangle, red title
Underlined titleOpens details in the right panel
Icon, summary, row whitespaceOnly expands or collapses; a chevron marks expandable rows. Leaf rows do nothing.
Inline bodyThinking text and a sub-agent's own transcript open in the row, aligned to the title, one light fill
ActionsCopy on every row, Open and Cancel execution on sub-agents. Only on the hovered row (:hover on the head, so a child never reveals its ancestors) or :focus-visible; always on touch.
Motion
ElementTransition
Whole stripGrid 0fr↔1fr, 160ms, expanding downward only. Children unmount 220ms after collapse.
Step body and child timelineHeight and −3px→0 over 240ms, opacity 160ms
New step0.22s fade and slide
ChevronsRotate 90° over 160ms
Running summaryText shimmer, 1.8s
ViewportMust not jump: scroll anchoring is off in chat, and bottom following pauses 600ms after a click

Lifecycle and ownership

  • Streaming, completed and restored messages use the same ExecutionStrip, ThinkingStep and FunctionStep; completion never switches to a boxed table.
  • Without ordered blocks, stored thinking and tool records are shown in stored order. Missing interleaving is not reconstructed and no tool record is invented. Results, errors, identifiers and full-output references stay.
  • Functions started by an Agent reply belong only to that reply's timeline. Only user-invoked functions are independent runtime messages.
  • Work the agent named with a task is drawn as a task block: its steps one indent in, and under a step the reader opens the same step rows, one indent further. A reply that names no task is unchanged.

Manual function runs

The form and an exact function expression are two editors for one FunctionInvocation { name, kwargs }, sharing one converter and one HTTP submitter. Neither creates a user bubble or Agent text turn.

InputClassified asResult
gui_agent(task="…", surface="browser")Exact whole input, registered function, named literalsPOST /api/function/gui_agent, one ProgramRun
Function formSchema produces the same typed kwargsSame
Please explain gui_agent(...), `gui_agent(...)`Not a complete expressionOrdinary user message to the Agent
Missing or mistyped required argumentRecognized, invalidDraft kept, form opens with errors; no fallback to chat
AspectRule
RecognizerRuns no JavaScript or Python. Strings, numbers, booleans, null and flat named arguments only; no positional arguments, attributes, variables or expressions.
SubmissionRecognition does not call sendChatMessage or write pending user text. Attachments, queuing and system decisions never become parameters. Placeholders, Project, channel, navigation and rollback stay in the shared submitter.
Layout28px ƒ marker, unframed timeline. Collapsed title, Conclusion and footer share one left edge. Footer 14px below, left-aligned, same buttons as chat, version navigation by .message-nav (◀ N/M ▶).
ExpandedDirect root children only; deeper levels open one at a time
CopyThe root call's result (error ?? output), not the argument JSON
RetrySibling branch with the same arguments
EditPrefills the form; sibling branch with edited arguments (fork_of_node anchors to the original call's predecessor)
BranchesReplace the displayed run in place; never appended at the end of the conversation
Running, nestedOne breathing-dot row. Nested runs have no footer.

Sub-agents

Live display

MomentTimeline
Parent runningExecution follows the transcript view; streaming does not decide it
Sub-agent startsA running record is added; an open timeline shows the new row
Sub-agent finishesThe row with the same stable card_id updates in place, never duplicated or deleted
Parent terminalThe manual choice stands; only the activity indicator and step status change
Expanded laterStill the same timeline row, with Open on hover or focus
Call pathLive dataRow
In chat, agent()sub_agent events by card_id into attachCardsSubAgentStep
report_workflow role calltree_update into contextTreeTreeStep child

Parent and child navigation

Call site parent branch callerId Sub-agent child branch attach.head_id Latest position parent branch backTarget Open Switch Back to main conversation
  1. Call siteparent branch, callerId
  2. Open
  3. Sub-agentchild branch, attach.head_idSwitch returns to the call site
  4. Back to main conversation
  5. Latest positionparent branch, backTarget
ControlLands
Open, on the rowThe sub-agent's newest reply. While the conversation runs its head cannot move, so the agent opens in the row instead.
Back to main conversation, top bannerParent's latest position; after reload, the originating turn with its execution expanded and the row highlighted
Switch, on the “Spawned from” card before the first messagecallerId; later parent messages are hidden

All three switch the active HEAD in one session and reload the transcript; no new tab. The backend refuses HEAD moves during execution. A legacy cross-session AttachCard only opens the target session. A report_workflow TreeStep without an attach pointer opens right-panel details only.

Message navigation

AspectRule
MarksOne per user message, 9px at rest, 10px apart, the visible one brighter. Only a chapter's mark is longer: a second length for turns with tasks read as an unexplained difference. The rail scrolls internally when long and shows no scrollbar, the app's floating thumb included: the marks are the position, and the end with hidden marks fades.
ColourA mark's colour is its place in the conversation: the wordmark's gradient runs down the whole rail, blue at the first turn and purple at the last, so the two ends are told apart. The visible and the pointed-at mark are the bright text colour; a chapter is solid purple and thicker
PositionLeft edge of the chat area beside the sidebar divider, using 100cqw of the inline-size container
PointerY maps to the nearest mark, which grows up to 36px; a preview card (truncated text, attachment chips) opens beside it. Never a full list.
Click, EnterSmooth scroll to the message and a brief highlight
Preview contentUser text and assistant summaries are untrusted Markdown: raw HTML and HTML-like math stay literal, links follow the document URL policy, attachment extraction and secret masking run first

Chapters

AspectRule
ControlPin as chapter or Unpin chapter on a reply. While pinned the bookmark is filled purple on the pressed fill and that action row stays shown.
Storedmetadata.chapter = {"pinned_at": <epoch seconds>} on the turn's user node; None or missing means unpinned. Follows the node through every branch and returns from load_session as chapter.
Protocolset_message_chapter {session_id, message_id, pinned} accepts only a user message of that session and broadcasts message_chapter_updated {session_id, message_id, chapter}. The server patches its mirror; a read takes the pin from the stored row.
Mark--accent-purple, 4px thick instead of 2.5px, 18px at rest (CHAPTER_W), never shorter on hover, full purple while the rail dims
SelectorOne more scalar in packRailRow, so rows still compare as flat strings

File-change card

Reports only exact changes from this turn. How a change is attributed: the file-management page.

PartRule
Surface--bg-input, 2xl corners, 6px padding, --composer-shadow, deeper on hover. Product sans throughout.
Header30px minimum, 20px pen icon, “N files changed” at weight 600, tinted +N −M pill (— when unknown), then actions pushed right. At card width ≤420px: “N files”, gaps 6px and 5px.
ActionsElevated xs buttons. The one executable action of Undo, Revert, Redo, Reapply, then Review. Redo reverses Undo, Reapply reverses Revert.
UnavailableThe action stays focusable with aria-disabled at 50%; its hover tip says why (edited afterwards, not recoverable, inactive branch, agent or run active, already in progress)
File listInset well: --bg-primary, lg corners, 3px padding
Rows30px, 10px side padding. FileTypeIcon (16px box, light and dark palettes), muted folder, bright name, bare green and red counts, or “renamed” / “deleted”. Hover adds --bg-hover; the whole row opens Review at that file.
OverflowThree rows, then “Show N more files” up to 20 loaded, then Collapse. Counted but unlisted files end in one “and N more files — open Review” row. The header count is file_count. A summary counting more than it lists loads the full list through review_scope.
RevertedList at 55% opacity, names struck through, “Historical original diff. These changes are no longer active.”
TurnShows
Persisted file records, or a direct file-writing toolCard mounts
No recordsNo card, no Review
Older turn, loading on entering the viewportInvisible probe; empty results stay hidden
Read failedNothing changes; the read is asked again with backoff
All writes failed“File changes in this turn did not go through.”

Review tab

ScopeSourceContainsUndo
This turnMutation journal of the turnPrimary change set; linked child sets grouped by actual producerWhen every record is recoverable and unchanged since
UnstagedGit working tree against the index, and ls-files --others --exclude-standardChanges not yet staged, untracked files included, respecting .gitignore; non-Git shows unavailableNone; Stage
StagedGit index against HEADChanges staged for the next commitNone; Unstage
BranchMutation projection of the active lineageCompleted turns and explicit reverts, restores and reapplies; no sibling branches, ordinary Bash or external writesFrom a specific turn or checkpoint only
Action or stateResultBoundary
Review, file rowOpens one deterministic r:<sessionId>:<assistantMsgId> center tab; a row also selects its pathNo inline chat diff; repeated clicks only focus or update selection
PlacementWithout a split, to the chat's right in the existing group; with a full split, a normal active tabNo replaced peers, third pane or second tab store
HeaderOne row: the scope menu with its totals; a … menu with Review with agent and File type (All, Code, Tests, Docs, Large). See Review panePage colour, hairline separators
Below 900px pane widthFile list folds into the selected file's header: full name, folder, actor, producing turn, line counts, n / N menuFrom 900px: a 260px list, name over folder
DiffNo file headers; hunks labelled by line range; long lines wrap; added or deleted files show one number column; paging belowOne bounded diff mounted at a time
PreviewRendered current Markdown, image or PDFReads the file as it is now; none for deleted files
Line comments, staging, Review with agentSee Review paneComments never edit files; findings never claim a fix
Large, binaryStatistics, reason, Open fileNo full rendering
Undo conflictReview locates conflicting filesNo force shortcut
Where this comes from: peer systems
SystemTurn or checkpointReviewUndo or rewind
CodexTurnDiffTracker uses only committed apply_patch deltas; inexact deltas clear the turn diff/diff uses Git: git diff and git ls-files --others --exclude-standardthread/revert restores conversation history only; App file Undo is not in the open-source repository
Claude CodeA checkpoint per prompt, direct edit tools only, latest 100 keptDesktop and Web: session totals, file navigation, single-file diff, line commentsCode and conversation restore separately. Bash, background sub-agents, external changes and links are not guaranteed.
ItemOpenProgram
Exact attributionAs Codex: turn statistics come only from committed mutations
Separate review surfaceAs both: chat holds summaries, Review holds navigation, content and comments
Session and repository diffsFour scopes in one tab
Checkpoint recoveryTurn-level Undo with full preflight, recorded as a new journal transaction
Not doneNo directory-scan attribution around Bash, no approximate turn diffs, no silent partial recovery
Implementation map
ScopeLocationExcluded
Mutations and recoveryprograms/tools/files/, state/store/snapshot/checkpoint/, turn finalize, runtime/conversation/rewinds/revert.pyBash directory watchers, changing user Git, inferring a turn from disk
Review protocolinterfaces/server/ws_actions/turn_files/, message metadata, Git helpersUnbounded strings, approximate fallback
Review tabcenter-tab-ids.ts, center-tabs-store.ts, center-tab-groups.ts, components/center-tabs/review/New windows, modals, a third pane
Chat cardturn-files-chips.tsx, turn-files-card.cssInline diff, file-row arrows, hover action groups

Chat math

  • Complete $$, $, \[ and \( blocks are stashed before marked and restored as escaped text after sanitizing. MarkdownText typesets after paint; the chat-area pin path calls typesetMath on the observed column.
  • Unclosed streaming math waits for the next paint with a closer. Prose without math and incomplete openers do not typeset. Invalid math does not throw.

Waiting for a reply

An empty reply shows one static “Thinking…” row with the summary row's shimmer, no › (a green raining label in the code rain style). The spinning activity mark lives on the sidebar row. Approval and terminal states suppress it; timeline, footers and pane titles add no mark.

Automatic retries

AspectRule
PlaceAfter the sentence of the reply's last tool group, joined like “· N failed”. A reply ending in text or with no group gets its own collapsed row, no leading dot.
Text“Server busy, retrying in 3s · 2/5”, “Offline, checking again in 20s”, “Reply came back incomplete, retrying 2/3”
Cause429: Rate limited. 5xx or overload: Server busy. Timeout: Timed out. Otherwise: Connection lost.
ColourOrange while answering a failure. “Hit the output limit, continuing” keeps the row's colour. Shimmer stops while waiting.
SecondsCount down from the notice, tabular figures
OpenedTimeline ends with a retry row (plug glyph, system tone, running), same sentence as title, failure in one line such as ReadTimeout: …
Eventattempt, max_attempts, reason, delay_ms, error (retry_error_text, at most 300 characters). Sent by the OpenAI-compatible and Codex adapters; shown by retry-status.tsx.
LifetimeLive only. The next streamed content clears it, so a recovered reply looks like one that never failed.

Failed replies

  • The partial answer and ordered trace stay. One terminal notice follows them, before message actions: a localized headline, technical details on request as plain text. No automatic retry is added.
  • The notice is drawn until the reader sends a newer message. After that it is left out, and a reply that is nothing but its error leaves no row: an error already answered asks nothing of the reader, and three failed tries read as three alarms above the message that went through.
  • Partial blocks and failure detail are separate fields. Node output keeps the error text for model context and non-Web consumers; the Web mapper restores the answer from ordered text blocks.
  • The node persists detail, reason, retryability and retry delay before the final failure event, so history restores the same notice. Older error output is recognized without rewriting history and does not repeat the answer.
  • Cancellation, approval, nested details, retry and branch semantics and Goal reports are unchanged. Provider taxonomy stays authoritative; no second error store.
Acceptance
  • A public turn emits text and tools, then fails: live and cold history show answer, trace and one notice.
  • Empty and older failed replies stay visible until a newer message follows them. Successful and cancelled replies gain no notice. Details work narrow and dark.
  • Regression also covers browser permission inheritance and high-level delegation. Bound-page tests supply an explicit binding and expect the stop after three failed attempts on one observation, with the concrete reason.

Transcript update ownership

PartOwner and rule
RowsThe server owns every row. A read draws a window, numbered transcript_update changes keep it current, and text frames add text to a block by offset. One reducer, apply-transcript-update.ts, applies all three, so a row drawn live is the row a reload draws.
Local rowsThe browser adds only what the server has not named yet. A pending send, a function placeholder or a notice is a typed local row, and goes when a read or update names its clientRequestId.
Fields ahead of the serverA field shown ahead of the server (Stop, a version switch, a chapter pin, a file undo, a goal result) is an overlay that ends on a stated event and never changes the row under it.
Execution treesExecution trees supplement the owning reply: a model-issued function's tree is an item of the reply's callRoots, a function run's tree a field of its row. A tree or frame for a row the view does not hold creates nothing.
Missed updateA missed update or a lost text frame makes the view read once at its anchor. A read during a stream neither loops nor shortens the reply, because the server parks that view's frames until the read's reply has gone. A branch move or structural change reads again.
Execution rootsEach execution root keeps its persisted path. Repeated calls stay distinct; a root is consumed once across text-separated groups. A completed function stays in its summary; direct runs stay standalone.

Acceptance replays recorded chats through production reducers and components and requires live to equal cold at every checkpoint: stream, partial history, completion, late trees, steers, errors, cancellation, reconnect and reload.

Queue and current-turn input

CaseRule
Send preparationReserved per draft owner across composers. A repeat with the same pending signature is ignored; a changed draft stays editable with a not-sent notice; another conversation prepares independently.
SignatureDraft text, attachment id, order and sourcePath, and thinking, toolsEnabled, toolsProfile, webSearchEnabled, fastEnabled, fastSupported. Not attachment base64 or focused/bound presentation. Permission, model, project and channel still bind late in sendChatMessage.
File mentionsOne 15-second batch deadline including response bodies; unresolved mentions keep their text
ReleaseAfter transport handoff or failure. Completion clears only an unchanged captured draft.
QueuedDispatched in order after the current turn. Session queues and editing order are independent; attachments use ordinary queue delivery.
Consumed steeringShown between the reply content around it. Its user node stays independent; the reply stores an ordered boundary shared by streaming, cancellation and history. Older records use predecessor edges, never a guessed offset.
DeliveryThe same command is asked about again when its execution or the session's run changes, or the socket reopens, without changing the waiting label, and works while the provider is silent. Pending or uncertain items cannot be resent, edited or removed. Definitive rejection keeps the queued draft; transport failure stays uncertain and is never resent.
Streaming steerAccepted text interrupts active text or reasoning, keeps emitted content, closes the request and applies the durable command before the next model request. Tool-call arguments, running tools and structured output wait for their safe point; no tool is replayed or cancelled.
Stop during pending steerKeeps the partial reply and its history position. A command rejected by cancellation stays an unsent draft with Send, never a new turn automatically. Projection may advance only the exact top-level turn from its user node to its assistant node by compare-and-set.

Sensitive text in previews

  • Known token formats and complete private-key blocks are masked in passive display; pasted previews mask before truncating.
  • Reveal is scoped to the source message, conversation and rendered prose, and never moves to another value. Explicit edit, copy and model payloads keep the original.
  • Display masking only: not password recognition or data removal.

Acceptance uses the real UserBubble with synthetic secrets: long key preview, paste expansion after reveal, content and session changes, show and hide, unchanged source.

Bounded transcript history

LayerBound
ServerOne branch view per session, shared by every connection, at most 16 in the process, rebuilt when the store says the branch moved. A view holds row ids grouped by turn, not bodies. A page projects only its selected whole turns from the store, so a row that changed after open reads fresh: a prompt and everything it owns, with tool descendants and compaction rows in place.
Cursor off the branchAnswers cursor_not_on_branch; the client reads the chat again
RollbackRead version 2 keeps its per-connection snapshots
Browser cacheFour conversations; displayed panes and in-flight requests may exceed it briefly
One transcriptSix ordinary pages, 8 MiB, with one indivisible page allowed for a large turn
EvictionOpposite the reading position, never persisted records; active updates stay; scrolling back refetches
RowsMeasured rows outside the viewport unmount and keep their height; evicted rows lose it
RequestsOne at a time; prefetch distance follows scroll direction and speed, bounded; exponential backoff; hidden panes stop; stale responses cannot overwrite a newer generation
AnchorInsertion and eviction restore the visible message and offset before paint, by message ID. Jump to latest fetches the latest window directly.
Markdown cache256-entry LRU, 8 MiB from UTF-16 source and sanitized output; an oversized entry renders but is not kept. Never bypasses sanitizing.
GraphA version 3 read sends no graph: covering and spawn origins arrive on the rows. Ordinary branch metadata omits bodies. Opening the DAG requests its layout.
Cold loadBuilding a view reads and enriches the branch once, linear in stored nodes; page reads fetch only their turns' rows
Interaction contract
  • The bottom of an intermediate window is not the latest position. Main and split panes share following, adaptive rendering and jump.
  • Jump stays available while newer history exists and after a failed request; repeated clicks share one pending intent.
  • Wheel, pointer and keyboard cancel a pending jump or restoration before the window changes. Ordinary paging still compensates for inserted rows.
  • Pane teardown saves the final anchor. Reconnecting resumes loading without an old retry delay.
Modules
ModuleResponsibility
message-list.tsxComposition and measured rows
use-chat-area-stick, use-message-viewport, use-history-windowFollowing, viewport measurement, history lifecycle
history-window, history-viewportBounded pages and anchors
session-history-loaderRequests, generation checks, state
interfaces/server/transcript/Projection, turn index, bounded reads and Find
transcript/reader.pyPage limits and the reads by turn
Acceptance
  • A synthetic source of 300,000 one-row turns: repeated bidirectional paging keeps pages, rows and measurements bounded; rapid reversals under latency keep a visible message; stale replies, reconnect, branch changes and live updates cannot corrupt the window.
  • Backend page reads do not scan or parse the whole branch once the view is built.
  • Browser tests cover an intermediate-window bottom, failed and repeated jumps, interrupted restoration, independent split panes, unmount and remount, and the saved anchor across queued animation frames.
  • Regression asserts skipped work, semantic equivalence, cache eviction and bounded retention, not timing. Timing and heap figures are synthetic and do not establish latency for large real attachments or tool output.

Implementation status

AreaOpen
Transcript update ownershipVerification pending
Sensitive text in previewsInstalled-App acceptance pending
Send preparationInstalled-App acceptance pending

Everything else on this page is implemented.

Last updated · 2026-11-25