Skip to content

refactor(ui): consolidate shared UI and terminal handling - #167925

Merged
steipete merged 2 commits into
mainfrom
deslop/d23-ui-lib-tui-p3-20261007
Oct 9, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/d23-ui-lib-tui-p3-20261007

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated UI and terminal state handling makes equivalent paths harder to maintain together.

User Impact

No user-visible change. Features, text, appearance, configuration, CLI flags, protocol and persisted shapes stay the same.

Why This Change Was Made

Share mutation admission and settlement, chat-setting selection, connection diagnostics, preference projection, Markdown token traversal, and terminal cleanup. Real differences remain explicit: bulk secrets refresh per item, thinking changes synchronize their receipt, recovery keeps its async boundary, and each diagnostic retains its own result and error policy.

This third d23 pass removes 615 net production lines across 133 source files (993 added / 1,608 deleted). Tests/support add 31 lines solely to follow removed internal seams. One assertion allowance shrinks from two to one. This uses the coordinator's 500–999-line exception with the per-file coverage below; all three passes total 1,796 production lines, below the original 3% target.

Evidence

Signed candidate: 6ac394dc8abf1bd28721fe623e8df7098607151d. The conflict-only rebase onto 590a0257d137ea43828151481a2fc47f5e73783e preserved all 133 production-file patches byte-for-byte. Its sole test conflict retains main’s current case matrix and assertions while adapting four reads to the consolidated composer-state API. Independent review is complete with no accepted/actionable P0–P2 findings; one cache-invalidation finding was rejected because the shared branch still clears the projection before notification, verified by the existing storage-clear test.

  • Focused pre-rebase candidate: 30 files / 801 tests passed, 746.23 seconds with one worker. After the test-size correction, the edited chat-send file and suppression suite passed 120 tests in 151.49 seconds. The final lint corrections passed another 238 tests in 41.20 seconds. The pre-rebase assertion audit preserved all 2,359 matcher names, modifiers and expected-argument ASTs. After rebasing, the affected chat suites passed 59 tests in 27.01 seconds and the outbox suite passed 33 tests in 6.22 seconds; UI-chat typechecking and both cycle checks passed.
  • Full TUI/terminal plus CLI boundaries: 71 files / 1,419 tests passed, one existing Windows-only skip. Standalone CLI registration smoke passed all 14 tests.
  • Broad UI directories: 1,300 files; 19,079 tests passed. Two plugin-question assertions also fail at the same line on clean main 24ca81d55bce94b26cb5c494e6987c39f2276081. Two compiled-worker suites hit an artifact-build collision, and one browser suite hit its roster-readiness deadline; those three suites subsequently passed all 17 tests with the runtime build stable. The passing replay is recovery evidence, not a claimed source fix.
  • Runtime and Madge cycle checks both report zero cycles. Wrapper inventory/import closure and the lint-suppression guard passed. Core and UI production types and all seven UI test-type graphs passed.
  • SDK API comparison on pre-rebase head a940d004775725378766cb137aa0dfa89343de2a passed with no API changes. The complete pre-rebase changed-check passed on Blacksmith Testbox against frozen base 148063b38f155e4be7d7c0918ecd491712647485, including all 27 core test-type graphs, production types, lint, structural guards, zero runtime cycles, and all three Knip scans with zero unused exports. Remote run, wrapper exit 0; the one-shot lease stopped after success. The earlier local full-tree Knip attempt exceeded its unchanged 600-second limit; the remote run completed without changing limits or ignores.

Local PTY proof remains limited: the full run reported 36 failures and 22 passes; two existing built-CLI-only cases were skipped, and 83 cases were blocked by failed shared fixtures. Clean main's built CLI reproduces the terminal-alias local ready timeout with the same visible startup state. A clean-main picker probe instead reached the picker and failed during exit, so the other timing failures are not all attributed to one cause. The extra resume suite passed 26 unit cases but its real Gateway fixture missed readiness, blocking four cases. Host contention was observed; no timeout, retry, skip, assertion, or budget was changed. Hosted checks on the exact published head remain the landing gate.

File-by-file coverage of the original subsystem (384 production files)

d23 P3 original subsystem coverage

All 384 production files in ui/src/lib and src/tui have per-file decisions. The Vitest-only config-test-harness.ts is excluded. Source reads and actual trials precede this index; full reasons and differential evidence remain in the referenced detailed logs.

File Base LOC Current LOC Decision (compact)
src/tui/tui.ts 1766 1758 Applied absent-safe timer cleanup; retained connection generations, startup admission,…
src/tui/embedded-backend.ts 1387 1384 Applied one queued-run eligibility branch with the existing owned promise; retained dis…
src/tui/tui-command-handlers.ts 1013 1011 Shared synchronous current-session error reporting; original awaits and guards retained.
ui/src/lib/cron/index.ts 974 974 Read complete form, validation, status refresh, CRUD, clone and payload owner. Status a…
src/tui/gateway-chat.ts 761 758 Applied equivalent connect-error admission guard; retained shipped v4 fallback, reconne…
ui/src/lib/config/config-gateway-operations.ts 736 736 Read/write/external mutation and teardown share receipt owners but retain different dis…
ui/src/lib/sessions/index.ts 722 722 Retain capability composition, connection retirement, bootstrap and event publication o…
ui/src/lib/config/config-draft-model.ts 715 711 Migrated both form conflict call sites to the explicit form strategy and removed the re…
ui/src/lib/sessions/session-roster-refresh.ts 715 715 Retain foreground generation, queued intent priority, list publication and managed-wind…
ui/src/lib/chat/outbox-store.ts 703 699 Shared storage-event projection invalidation and notification for clear/prefix events;…
ui/src/lib/sessions/session-roster-observations.ts 699 696 Applied: one map-bucket append path removes duplicate new/existing branches while prese…
src/tui/tui-event-handlers.ts 696 696 Retained projection admission, terminal precedence, persisted history recovery and conc…
ui/src/lib/sessions/session-reconciliation.ts 692 692 Retain history/descriptor/event admission and the field-receipt producer. Similar all-a…
src/tui/tui-session-actions.ts 683 683 Mutable-selection read-owner trial 683→683 rejected; retained direct generation guards…
ui/src/lib/config/config-write-coordinator.ts 677 677 Autosave, explicit writes, patch and external mutation already use one drain/FIFO core.…
ui/src/lib/session-progress-cards.ts 676 668 Retained synchronous notification/refresh-retirement simplification. Connection, dismis…
ui/src/lib/sessions/session-row-reconcile.ts 658 658 Retain full versus partial snapshot rules, ancestor revision certification, explicit nu…
ui/src/lib/sessions/session-mutations.ts 639 636 Applied: inline two forwarding closures (background reconciliation report, single-use m…
ui/src/lib/chat/composer-draft-store.runtime.ts 638 638 Shared projection copy-policy trial grew by 2 lines; restored. Transaction completion a…
ui/src/lib/chat/commands.ts 634 634 Native/remote projection already uses toSlashCommand; reserved local names, alias trunc…
src/tui/components/chat-log.ts 617 617 Retained segmented streaming/frozen/finalized runs, live prompt slot reservation and re…
ui/src/lib/channels/index.ts 608 608 Read fully; channel read fencing, pairing authorization epoch and WhatsApp admin epoch…
ui/src/lib/session-pull-requests.ts 595 591 Simplified snapshot-array notification only; passive membership, active subscriptions,…
ui/src/lib/skills/index.ts 595 595 Read fully; common mutation owner already handles captured agent scope, recovery reload…
ui/src/lib/chat/message-normalizer.ts 593 593 Text expansion shared already; image/media source order, omitted media and directed del…
ui/src/lib/chat/outbox-recovery.ts 586 586 Transfer staging and account adoption use existing consume core; each fresh reread prov…
ui/src/lib/nodes/page-operations.ts 584 584 Read fully; shared inventory reader already exists. Device credential persistence is ca…
ui/src/lib/sessions/session-list-query.ts 553 553 Retain held-window certification, parent exclusions, owner counts, query normalization…
ui/src/lib/sessions/session-placement-recovery.ts 551 551 Retain closed validators, ownership framing, promotion compensation and paused storage…
ui/src/lib/chat/tool-cards.ts 549 543 Reuse existing readRecord object guard for content/nested text (arrays remain accepted)…
ui/src/lib/board/gateway-provider.ts 547 547 P2 transport core preserved: separate client/state generations, live refresh loop, chan…
ui/src/lib/sessions/github-publication-controller.ts 533 533 Retain shared versus personal publication custody, confirmation, account generation and…
ui/src/lib/chat/model-select-state.ts 519 517 Shared nonempty selected-entry predicate traversal; access, rejected-tier recovery and…
ui/src/lib/chat/chat-metadata-store.ts 503 500 Current-request adoption moved into begin owner; explicit revalidation strategy preserv…
src/tui/tui-formatters.ts 501 499 Applied direct canonical stripAnsi call, which already has the no-introducer fast path;…
ui/src/lib/chat/chat-types.ts 498 498 Presentation/persisted unions and accumulated stream prefix rules retained; narrowing t…
ui/src/lib/sessions/session-key.ts 480 480 Retain shared URL contract plus UI-specific aliases and opaque catalog/Matrix/Signal ca…
ui/src/lib/sessions/session-placement-startup.ts 478 471 Applied: one shared async deleteSessionPlacementDraft wrapper takes explicit recovered…
src/tui/tui-session-run-coordinator.ts 470 470 Retained per-run snapshot flags, observation identity, confirmed-stream priority, bound…
ui/src/lib/model-catalog-store.ts 460 460 Read fully; transport settlement, queued admission, publication eligibility and startup…
ui/src/lib/sessions/swarm-roster.ts 447 447 Retain independent parent detail and child membership reads, duplicate child refresh pr…
ui/src/lib/agents/display.ts 433 433 Retain model aliases/profile references, exact option order, source precedence, inherit…
ui/src/lib/sessions/grouping.ts 430 427 Applied: one map bucket append path preserves first group insertion and row order; uses…
ui/src/lib/chat/source-previews.ts 426 426 Search/page share candidate creation; only wrapped cited successful output is eligible,…
ui/src/lib/sessions/session-pending-rows.ts 424 424 Retain one shared optimistic row core, live token ownership, unbound ACK binding and di…
src/tui/tui-run-lifecycle.ts 419 413 Applied absent-safe watchdog cleanup and existing forEach timer retirement; retained co…
src/tui/tui-plugin-approvals.ts 417 417 Retained Map inventory from P2, versioned snapshot replay, expiry and stale-result reco…
ui/src/lib/agents/index.ts 416 416 Retain list revision versus per-file request identity, nullable file cache retention, d…
ui/src/lib/sessions/session-capability.ts 413 413 Retain public internal type boundary and ownership documentation. Deriving capability f…
ui/src/lib/device-pair-setup.ts 411 391 Shared access field across exact lifecycle variants; delivery-uncertain payload reuses…
ui/src/lib/sessions/session-deletions.ts 411 410 Applied: inline one-use error string forwarding. Keep batch selection claim, generation…
ui/src/lib/board/widget-sandbox-host.ts 403 403 One document host plus ticket-adopting bridge. Window channel is nonauthoritative; priv…
src/tui/components/question-prompt.ts 402 400 Applied answer-container replacement on disposal; submitted answers are copied and the…
ui/src/lib/sessions/session-row-provenance.ts 401 401 Retain field receipt/writer arbitration, sparse clone identity and read high-water mark…
src/tui/tui-questions.ts 391 391 Retained answer-unconfirmed recovery, admission/recovery lock preservation, secret-stor…
ui/src/lib/chat/tool-call-patch.ts 386 382 One text-patch traversal with explicit Codex mode shares collector/hunk state while ret…
ui/src/lib/nodes/inventory.ts 378 378 Read fully; explicit normalized projections preserve undefined properties and input pre…
ui/src/lib/model-catalog-cache.ts 377 377 Read fully; cache eviction retires publication but not transport, and full versus parti…
src/tui/commands.ts 353 352 Applied typed row-map callback instead of a separate widening variable; descriptors pre…
ui/src/lib/chat/outbox-store-projection.ts 352 352 Presence generation, attention revision and visible signature observe different updates…
ui/src/lib/chat/tool-call-view.ts 347 344 Nullable argument readers consume undefined directly; command/content/pattern/url proje…
ui/src/lib/sessions/session-managed-list-refresh.ts 347 347 Retain one pending/queued drain per managed query with pagination fences, staged primar…
ui/src/lib/chat/outbox-store-codec.ts 346 343 Remove three redundant entry aliases by using the same parameter name; durable CAS prop…
ui/src/lib/nodes/index.ts 345 340 Stored identity extends device identity; generated stored record reuses exact locally o…
src/tui/tui-task-suggestions.ts 343 343 Retained capability recheck, two-step accept, navigation hiding and retry-on-event snap…
ui/src/lib/sessions/session-group-catalog.ts 334 334 Retain one catalog mutation/read owner, legacy browser migration and explicit defaults…
ui/src/lib/config/config-write-reconciliation.ts 326 326 Pending/rejected/independent receipts, observed raw acknowledgement, recovery and teard…
ui/src/lib/toast.ts 313 311 Shared ordered timer clearing over the two owned keys; guards and update order retained…
src/tui/components/searchable-select-list.ts 310 310 Actual continue-to-else trial 310→310 rejected; retained tier/fuzzy ranking, cached hig…
ui/src/lib/session-display.ts 305 305 Read fully; persisted key formats, cloud/local project selection, derived titles and ac…
ui/src/lib/board/grid.ts 303 303 Occupancy masks, canonical ordering, drag/nudge, auto/fixed sizing and frame/chrome mar…
ui/src/lib/widget-sandbox-host.ts 301 299 Shared ordered clearing of notice/deadline timers; readiness, document delivery, retry…
ui/src/lib/chat/thinking.ts 300 300 Session/default/catalog profile precedence and runtime filtering retain unknown versus…
ui/src/lib/chat/tool-call-diff.ts 297 297 Bounded LCS retains deletion-first ties; input truncation versus preview clipping have…
ui/src/lib/sessions/reconcile.ts 280 280 Retain common row reduction adapters; history may create first membership/defaults, eve…
ui/src/lib/sessions/navigation.ts 279 279 Retain current-row exception, configured aliases, global-agent scopes and stable pinned…
ui/src/lib/sessions/session-requests.ts 275 275 Retain canonical request shaping and enriched pagination. Archive requests deliberately…
ui/src/lib/format.ts 273 273 Read fully; finite versus valid timestamp handling, relative suffix rules and formatter…
src/tui/osc8-hyperlinks.ts 271 271 Retained distinct authored/bare URL grammar and wrapped continuation matching; regex ho…
ui/src/lib/config-form-utils.ts 268 268 Read fully; schema alternatives, wildcard hints, authored empties and prototype-safe pa…
ui/src/lib/agents/roster-activity-store.ts 261 261 Retain capability-owned enriched window, visible admission and independently settled ro…
ui/src/lib/config/config-state-model.ts 259 259 Initial-state inference, request versions, read invalidation, connection epochs and edi…
ui/src/lib/sessions/session-github-publication.ts 256 256 Retain operation custody outside panes, current authority comparison, bounded active pu…
ui/src/lib/sessions/session-roster-cache.reader.ts 256 256 Applied: reuse canonical sessionRosterScope for hydration ownership instead of repeatin…
ui/src/lib/sessions/session-scoped-operations.ts 256 256 Retain committed transcript mutations versus nullable scoped reads and subscription com…
ui/src/lib/authenticated-avatar-route.ts 254 254 Read fully; credential fallthrough, bounded 503 recovery and task-delayed final release…
ui/src/lib/identity-avatar-loader.ts 252 252 Read fully; reference release, settled misses, generation retirement and view routes re…
ui/src/lib/chat/outbox-payload-store.runtime.ts 250 250 Strict write durability plus capacity, readonly complete-batch validation and tab-autho…
ui/src/lib/chat/emoji.ts 249 249 Inline lexical states retain escaped characters, backtick run lengths, tag quotes and n…
ui/src/lib/config/mcp-servers.ts 246 246 Tokenizer quote/backslash states, redacted summaries and destructive-array patch receip…
ui/src/lib/cron/runs.ts 246 246 Retained history is query-owned after settlement; active request and accepted view are…
ui/src/lib/sessions/session-permission-projection.ts 246 245 Applied: one optional permission-mode row projection removes duplicate undefined deleti…
src/tui/components/tool-execution.ts 245 245 Retained bounded Markdown/literal Code Mode output, activity precedence, image ownershi…
ui/src/lib/sessions/session-run-terminal.ts 245 245 Retain exact run ownership, overlapping runs and same-value receipt publication. Omitte…
ui/src/lib/hover-marquee.ts 244 242 Shared disconnect/reset of the three observer fields. Geometry-before-write batching, v…
ui/src/lib/cron/jobs.ts 240 233 Selected inventory loading property once for initial/append and finally reset. Exact ad…
ui/src/lib/config/runtime-config-capability.ts 239 239 Run finally ordering must publish before retiring the load, even with throwing observer…
ui/src/lib/board/widgets/browser.ts 231 231 Single request core already owns open/resume/stop/inspect; refresh-needed events and ge…
src/tui/tui-submit.ts 230 221 Applied absent-safe flush cleanup and inlined single-use scheduling; retained snapshot…
ui/src/lib/agents/identity.ts 229 229 Retain shared pending cache, per-agent failure deadlines, LRU bound and capability inva…
ui/src/lib/sessions/session-menu-navigation.ts 229 229 Retain stable export page/tail identity fences, current clipboard authority and gateway…
ui/src/lib/chat/model-ref.ts 228 228 Twin-map parameterized update loop trial grew 228→229; restored. Identity case, alias a…
ui/src/lib/sessions/session-archive-state.ts 228 228 Retain confirmed archive/restore receipts independently of pending tokens. Same-key suc…
ui/src/lib/sessions/session-placement-submit.ts 226 229 Applied: explicit recovered policy is passed to the single cleanup owner instead of sel…
src/tui/tui-backend.ts 225 225 Retained backend interface and actual Gateway/local optional capabilities; no protocol…
src/tui/tui-types.ts 217 217 Retained projection/event/state contracts, connection provenance and session metadata;…
ui/src/lib/sessions/route-navigation.ts 212 212 Retain exact/inferred route variants and markers excluded from copied href; global row…
ui/src/lib/projects.ts 207 203 Simplified live-Set notification. Auth/routing signature, non-GitHub negative aliases a…
ui/src/lib/board/provider.ts 203 203 P2 lease release flag remains sole mutation-authority lifetime. Shared transport and le…
ui/src/lib/board/widget-bridge.ts 196 196 Existing data/action request core retained. Prompt live-authority check, navigation pro…
ui/src/lib/secrets-store/index.ts 193 190 Re-evaluated P2's rejected shared runner: one direct-await mutation pipeline now handle…
ui/src/lib/board/widgets/session-progress.ts 189 189 Progress card owner and scoped roster subscription have different lifetimes; active-boa…
src/tui/components/message-images.ts 188 183 Applied one completion renderer with lazy component creation after abort check; retaine…
ui/src/lib/chat/message-extract.ts 185 185 Cached text/thinking share existing extraction owner; text-only loop intentionally obse…
ui/src/lib/session-channel.ts 185 185 Read fully; Matrix, WhatsApp, Signal and email/phone address admission deliberately dif…
ui/src/lib/sessions/session-primary-windows.ts 183 183 Retain warm presentation leases versus observed query custody; detach waits for pending…
src/tui/tui-last-session.ts 182 182 Read-only retention: canonical shared-state access, scope hash, heartbeat exclusion and…
src/tui/gateway-image-loader.ts 181 181 Retained managed-source admission, credential-bound HTTP/TLS pin, auth retry and byte l…
src/tui/tui-local-shell.ts 180 180 Retained one-time three-state consent, cleanup scope and output tails; approval settlem…
src/tui/theme/theme.ts 179 179 Retained palette, exact light-mode luminance and formatting callbacks; no visual values…
ui/src/lib/session-viewer-presence.ts 178 178 Read fully; acknowledged signature/generation differs from pending signature through su…
ui/src/lib/connection-hints.ts 172 172 Read fully; proxy reason classification, stale device-token hint and narrow fallback te…
ui/src/lib/mcp-app-message.ts 172 173 Reused existing byte decoder for binary resource attachments. Text/resource/image title…
ui/src/lib/sessions/session-roster-cache-lifecycle.ts 171 171 Retain independent boot-owner retirement and credential/profile/gateway revision fences…
src/tui/tui-session-projection.ts 170 170 Retained canonical reducer adapter, first durable identity binding and imported-message…
ui/src/lib/media/video-poster.ts 169 169 Read fully; queue admission, settled fence, compositor/seek join and owner cancellation…
ui/src/lib/sessions/session-describe.ts 168 168 Retain shared pending descriptor reads, bounded completed-cache reuse and initiating-cl…
src/tui/tui-submit-state.ts 167 167 Retained send/accepted draft phases, transition epochs and admission priority; each sta…
ui/src/lib/sessions/session-roster-cache.runtime.ts 167 167 Retain serialized lazy writes and exact scoped deletion barriers; generation retirement…
ui/src/lib/chat/chat-metadata-cache.ts 163 163 Catalog invalidation precedes metadata events; session-only and no-scope phase/reason d…
ui/src/lib/agents/tools-effective.ts 161 161 Retain exact dispatch symbols, model-sensitive query key and selected-agent correlation…
ui/src/lib/model-catalog-reader.ts 161 161 Read fully; binding identity and active controller ownership differ. Success callback e…
ui/src/lib/mcp-app-catalog.ts 158 158 Read fully; discovery cache and prepared-session identity survive different changes. Po…
ui/src/lib/chat/tool-display.ts 157 157 Canvas authority derives from sanitized hosted paths; trusted/scripting ceilings and ex…
ui/src/lib/board/widgets/report.ts 153 153 Discriminated report rendering and shared chart coordinates already centralized; chart/…
ui/src/lib/model-auth.ts 153 153 Read fully; ordinary shared reads and independent explicit refreshes have distinct timi…
ui/src/lib/native-overlay-occlusion.ts 151 149 Simplified live-Set notification; overlap geometry and modal reference ownership unchan…
ui/src/lib/sessions/session-model-overrides.ts 151 151 Retain optimistic/create overlay custody, equal-value ownership transfer and canonical…
ui/src/lib/cron/types.ts 148 148 Reviewed canonical UI-only draft/query/load types; no persisted/protocol or type-only c…
ui/src/lib/sessions/catalog-project-grouping.ts 143 143 Retain shared collector, workspace folding and actor-qualified identities; project cust…
src/tui/tui-session-events.ts 140 140 Retained exact selection versus response alias matching, incarnation checks and importe…
ui/src/lib/presence-users.ts 139 139 Read fully; payload projection cache, identity filtering, activity clock and tie sortin…
ui/src/lib/provider-quota-summary.ts 139 139 Read fully; exact window/budget grouping identity and optional output property omission…
ui/src/lib/identity-avatar.ts 138 138 Read fully; trusted origin/mount mapping and participant namespace validation remain ex…
ui/src/lib/session-pr-automation-spec.ts 133 133 Read fully; preserved all prompt bytes, identity hashing, incarnation-sensitive archive…
ui/src/lib/chat/human-mentions.ts 132 132 UTF-16 token validation and beforeinput provenance retain repeated-label ambiguity prot…
ui/src/lib/sessions/tool-overrides.ts 132 132 Retain own-property-safe keys, per-server cloned deny arrays and global web-search kill…
ui/src/lib/chat/browser-tab-preview.ts 130 130 Attempt receipts outlive cached screenshots; pending captures serialize revisions and r…
ui/src/lib/cron/form-schedule.ts 129 129 Exact decimal round-trip and retained source schedules preserve seconds/anchors/precisi…
src/tui/components/custom-editor.ts 126 126 Retained dependency-owned key decode, AltGr, exact autocomplete and raw whitespace boun…
ui/src/lib/sessions/session-roster-projection.ts 126 126 Retain indexed held-row reuse, provisional primary precedence and caller key identity.…
ui/src/lib/link-preview.ts 125 125 Read fully; connection/recovery receipt, TTL distinction and failure eviction are requi…
ui/src/lib/sessions/session-thinking-claims.ts 125 125 Retain created-value claims with separate suspension tokens and event/read clock semant…
ui/src/lib/media-file-extension.ts 124 124 Read fully; image MIME authority differs from audio/video extension fallback, and SVG a…
ui/src/lib/sessions/catalog-key.ts 124 124 Retain opaque encoded catalog/host/thread keys, bounded cursor lookup and separately ca…
ui/src/lib/chat/outbox-store-retirement.ts 122 120 Derive changed state from written revision receipts; preserve write, reread, remembered…
ui/src/lib/session-method-access.ts 121 121 Read fully; scope derivation, archive ownership and disconnected/method precedence reta…
ui/src/lib/chat/history-message-identity.ts 119 119 Durable exact submission receipts and counted overlap retain projected siblings; no eag…
ui/src/lib/mcp-app-route.ts 119 117 Combined forbidden deep-link characters in one regex with exact rejection set; namespac…
src/tui/components/filterable-select-list.ts 117 112 Applied direct ordered render array; input render, divider and list render execute in t…
src/tui/tui-stream-assembler.ts 117 117 Retained stream registration/retention, hidden thinking and empty-final fallback; final…
ui/src/lib/sessions/swarm-activity.ts 112 112 Retain bounded group/child notes and first-seen phase ranking. Implicit phase assignmen…
ui/src/lib/system-info.ts 111 111 Read fully; admission, bounded cache, current request and exposure authority recheck re…
ui/src/lib/mac-form-factor.ts 110 105 Ordered static prefix and display-name tables share lookup; exact known-model table, ma…
ui/src/lib/sessions/event-refresh-coordinator.ts 109 109 Retain canonical paced trailing refresh, bounded duration backoff and fallback timer; a…
ui/src/lib/sessions/session-mutation-refresh.ts 109 109 Retain committed previous-connection outcomes and scoped category warning ownership; un…
ui/src/lib/widget-theme.ts 109 109 Read fully; ordered theme mapping and separate document/registered frame lifetimes reta…
ui/src/lib/sessions/catalog-terminal-start.ts 107 107 Retain bounded early PTY output/exit handoff and orphan expiry; preserve connection clo…
ui/src/lib/chat/control-ui-database.runtime.ts 106 106 Request and transaction completion have different event sets; opening handle remains fe…
ui/src/lib/chat/outbox-store-draft-state.ts 106 106 Attempt/edit/commit clocks plus replacement token protect different admission stages; r…
ui/src/lib/chat/sender-label.ts 106 106 Typed participant namespace, untyped label fallback and JSON field-order normalization…
src/tui/tui-last-session-restore.ts 105 105 Retained provisional preview versus confirmed restoration and reconnect freshness; fail…
src/tui/tui-local-cli.ts 105 105 Retained cancellation admission, discarded overflow buffer and execution/JSON error pre…
ui/src/lib/keyboard-shortcut-catalog.ts 105 105 Read fully; builders already share catalog projection; stable entry order and send-pref…
src/tui/tui-browser-setup.ts 104 104 Retained bounded local-CLI field projection, fixed command args and exact operator rece…
ui/src/lib/sessions/session-event-subscription.ts 104 104 Retain acknowledged broad-observer generation, typed deadline recovery and revalidation…
ui/src/lib/sessions/unread.ts 104 104 Retain optimistic read latch through observed marker clear, activation identity and pro…
ui/src/lib/agents/tool-catalog.ts 102 102 Retain explicit Gateway field projection and fallback translation; own properties and l…
ui/src/lib/presenter.ts 102 102 Read fully; preserved exact Cron kind strings and distinct duration/context formatting…
src/tui/tui-session-picker.ts 101 101 Retained shared recent query and display/match projections used by CLI resume and TUI.
ui/src/lib/chat/composer-draft-store-codec.ts 101 101 Stored blob/question validators and model-selection repair are intentionally different…
ui/src/lib/session-pr-automation.ts 101 101 Read fully; page/revision completeness, unique declarations, create/update transport an…
src/tui/components/choice-prompt.ts 100 100 Retained shared prompt chrome, optional approval details and bounded task viewport; lay…
ui/src/lib/sessions/navigation-handoff.ts 100 100 Retain independent intent token and short-lived pathname handoff; hello identity fences…
src/tui/embedded-local-run.ts 97 97 Retained owned completion/readiness promises, cancelled-slot ancestry and maintenance t…
ui/src/lib/chat/outbox-store-payload-retirement.ts 97 97 All legacy/account custody sources validate before blob removal; incomplete sources kee…
ui/src/lib/sessions/paged-session-rows.ts 95 95 Retain page union versus managed-window replacement semantics, moving-roster retry budg…
src/tui/gateway-chat-models.ts 93 93 Retained catalog publication and request ownership; onChanged callback failures and sta…
src/tui/tui-status-summary.ts 93 90 Applied direct initial line and adjacent push grouping; exact labels, blank rows and se…
ui/src/lib/identity-avatar-context.ts 93 93 Read fully; origin, mount and credential changes invalidate old HTTP requests before no…
ui/src/lib/keyboard-shortcut-contract.ts 93 93 Read fully; typed keyboard table, modifier display and key matching remain independent…
ui/src/lib/chat/message-visibility.ts 92 84 Combine missing-record and wrong-role guards; silent assistant/synthetic repair role an…
ui/src/lib/config/config-draft-replay.ts 92 81 P2 rejected-wrapper case now uses one existing exported conflict function with explicit…
ui/src/lib/sessions/session-roster-list-reader.ts 92 92 Retain scoped facts reads without foreground query custody; reconciliation stages obser…
ui/src/lib/mcp-app-context.ts 90 85 Reused canonical non-array record guard for thumbnail metadata; src presence and thumbn…
ui/src/lib/chat/tool-output.ts 89 89 Provider execution pretty-print preserves raw copy bytes and duplicate JSON members; ca…
ui/src/lib/geolocation-lookup.ts 89 89 Read fully; definitive absence differs from unavailable transport, and eviction protect…
ui/src/lib/sessions/custom-groups.ts 89 89 Retain canonical catalog/default projection and persisted partial-order token normaliza…
src/tui/tui-auth-child.ts 87 81 Applied settlement-owned cleanup and absent-safe timer retirement; active release remai…
ui/src/lib/gateway-set-sync-lifecycle.ts 87 87 Reimplemented subscription-array scratch trial: 87 to 88 formatted lines. Rejected grow…
ui/src/lib/board/widgets/index.ts 85 85 Core widget table retains literal lazy imports, runtime translated label getters and pr…
ui/src/lib/browser-redact.ts 84 84 Read fully; ordered regex passes, PEM handling, visible token hints and shell marker pr…
ui/src/lib/board/widgets/website.ts 83 83 Activation latch and Gateway host cookie boundary retained; iframe sandbox and external…
ui/src/lib/open-external-url.ts 83 83 Read fully; immediate safe URL open and deferred user-activation window reservation use…
ui/src/lib/sessions/session-roster-cache.ts 83 83 Retain lazy read/write admission, per-scope generations and publication ordering.
ui/src/lib/sidebar-zone.ts 83 77 Consolidated same-outcome rejection guards without changing short-circuit order. Unknow…
src/tui/tui-last-session.kernel.ts 79 79 Read-only retention: worker-side read and per-pointer transactional recheck preserve re…
ui/src/lib/chat/message-normalizer-images.ts 79 79 Each image protocol keeps its source order, preferData and inline-slot/expiry presence.
ui/src/lib/chat/youtube-video.ts 78 78 Strict host/path/start parser rejects credentials, duplicate time keys and unsafe integ…
src/tui/tui-launch.ts 77 77 Retained CLI flag order, inherited stdio ownership and child bridge; appendOption alrea…
ui/src/lib/config/config-mutation-error.ts 75 75 Publication recovery outranks nested conflict, while definitive rejection separately re…
ui/src/lib/sessions/session-roster-cache-database.ts 75 75 Retain IndexedDB request versus transaction completion/error/abort contracts, blocked d…
ui/src/lib/sessions/usage.ts 75 75 Retain IANA/UTC offset date request and explicit signal argument arity.
ui/src/lib/chat/session-diff.ts 74 74 Existing unified row construction retains old/new coordinates and interhunk gap text.
ui/src/lib/chat/chat-queue-order.ts 73 73 Reorder permutes existing positions; submitted rows remain barriers and tied arrival ke…
ui/src/lib/config/config-field-discard.ts 73 73 Field intent identity, connection authority, reload and uncertain-write rejection retai…
ui/src/lib/observer-digest.ts 73 73 Read fully; exact field projection, active-run authority, revision precedence and times…
ui/src/lib/sessions/session-snooze.ts 73 73 Retain calendar tomorrow/next-Monday versus elapsed hour semantics and exact wake-time…
ui/src/lib/chat/tool-call-grouping.ts 72 72 Shared activity summary already owns count and outcome aggregation; display only locali…
ui/src/lib/platform-label.ts 72 72 Read fully; branded casing and MacIntel device-family exception remain deliberate; tabl…
ui/src/lib/assistant-identity.ts 71 71 Read fully; startup-safe avatar admission, length limits and output null defaults retai…
ui/src/lib/sessions/session-row-local-patch.ts 71 71 Retain primary-only unscoped preview versus incarnation-qualified managed descriptor up…
ui/src/lib/sessions/patch.ts 70 70 Retain protocol-derived patch shape and explicit queued dispatch, predecessor receipt a…
ui/src/lib/chat/composer-draft-retirement.runtime.ts 69 69 Deleted-draft cleanup waits for account recovery then uses captured target revisions; t…
ui/src/lib/chat/session-diff-gaps.ts 69 69 Existing direction parameter preserves up spread versus down reconstructed gap property…
ui/src/lib/gateway-methods.ts 69 69 Reimplemented shared advertisement predicate scratch trial: 69 to 71 formatted lines. R…
ui/src/lib/config/config-draft-discard.ts 68 68 Conditional drain and offline reset versus authoritative reload retain exact awaits, er…
ui/src/lib/chat/message-normalizer-attachments.ts 67 67 Attachment error versus URL payload retains distinct validated fields and insertion order.
ui/src/lib/settings-navigation.ts 67 67 Read fully; settings route ownership and locale-owned word segmentation differ from sub…
src/tui/embedded-session-reader.ts 66 66 Retained publication checks before/after canonical list read and identity-matched histo…
ui/src/lib/clipboard.ts 66 66 Read fully; current clipboard attempt owns fallback, and modal placement/deferred focus…
ui/src/lib/plugins/index.ts 66 66 Read fully; narrow typed RPC adapters preserve omitted fields and startup boundary. Sha…
ui/src/lib/sessions/session-event-observation.ts 66 66 Retain captured recipient set, late rejected-generation delivery and immutable frame/ro…
src/tui/tui-tool-activity.ts 65 65 Retained open live versus closed historical descriptors, verbose policy and explicit hi…
ui/src/lib/board/settings.ts 64 64 Session-view normalization preserves authored session keys, per-tab validation, retaine…
ui/src/lib/chat/heartbeat-display.ts 64 60 Combine missing-entry and wrong-role guards; content concatenation and visible-nontext…
ui/src/lib/config/config-patch-coordinator.ts 64 64 Failed patch closure owns retry intent; queue remains shared with dispatch/drain owner…
ui/src/lib/sessions/session-patch-row-facts.ts 64 64 Retain ACK-to-field translation; optional model/thinking choices and pin/read combinati…
src/tui/components/hyperlink-markdown.ts 63 54 Applied Markdown inheritance, removing wrapper field/forwarding; all constructor args a…
src/tui/tui-autocomplete.ts 63 63 Retained safe-value filtering and original-item identity via symbol; sanitization must…
ui/src/lib/chat/tool-approval-reviews.ts 63 63 Bounded review list, recorded outcome precedence and nonobject details retention kept.
ui/src/lib/idle-import.ts 63 63 Read fully; retained promise, retryable rejection and one online retry are separate lif…
ui/src/lib/model-provider-auth-label.ts 63 63 Read fully; provider-summary and available-credential projections differ in plan/email…
src/tui/embedded-chat-projection.ts 62 62 Retained canonical live/terminal text adapters and exact timestamp/delta shapes.
src/tui/tui-images.ts 62 62 Retained live/history source normalization and first-source deduplication; assistant la…
ui/src/lib/chat/pasted-text-excerpt.ts 62 62 Inert DOM extraction handles HTML and image alt text, unlike source preview plain Markd…
src/tui/embedded-image-loader.ts 61 61 Retained selected-session admission and managed media reads; transport differs from Gat…
ui/src/lib/agents/roster-activity.ts 61 58 Applied: common bucket append path preserves configured agent order, row identity, main…
ui/src/lib/sessions/create.ts 61 61 Retain actual create request normalization and idle/started/rejected initial-turn outco…
ui/src/lib/sessions/session-thinking-metadata.ts 61 61 Retain model/provider/runtime identity match and omitted metadata donation, with no cro…
ui/src/lib/chat/goal-operation-storage.ts 60 60 Expired/invalid notices preserve recovery meaning while account generation retires obso…
ui/src/lib/sessions/workspace.ts 60 60 Retain path basename distinction from pathDisplayName (separator-only input differs) an…
ui/src/lib/response-body.ts 59 59 Read fully; early content-length rejection, bounded streaming decoder and reader releas…
ui/src/lib/gateway-availability.ts 58 58 Read fully; typed restart/suspend/startup responses differ from nonprotocol snapshot fa…
ui/src/lib/model-runtime-label.ts 58 58 Read fully; runtime Map already removes prototype fallback ambiguity; route billing lab…
ui/src/lib/avatar.ts 57 54 Consolidated same-outcome text-avatar rejection guards and character regex; admission o…
src/tui/tui-session-info.ts 56 56 Retained defined-field copy and visible-fact comparison; null/undefined and nested seri…
ui/src/lib/chat/follow-up-mode.ts 56 53 Combine unavailable effective-mode cases; saved-versus-applied config and explicit sess…
ui/src/lib/gateway-errors.ts 56 56 Read fully; retained-class missing-scope errors differ from structural detail-code and…
ui/src/lib/sessions/child-session-data.ts 56 56 Retain managed window pagination owner and authoritative completeness errors, distinct…
ui/src/lib/sessions/session-roster-mutation-refresh.ts 56 56 Retain foreground scope-matching refresh outcome versus independent mutation read fallb…
ui/src/lib/skills-shared.ts 56 56 Read fully; existing ordered reason table and conditional translations retained; templa…
src/tui/tui-shutdown.ts 54 54 Retained parallel runtime settlement, unconditional terminal release and ordered aggreg…
ui/src/lib/chat/imported-message-display.ts 52 52 Only importer provenance authorizes complete frame removal; ordinary quoted frames and…
ui/src/lib/gateway-connection-lifecycle.ts 52 52 Read fully; transition, invalidation and disposal epoch increments are different owners…
ui/src/lib/gateway-diagnostics.ts 52 52 Read fully; request launch order and independent diagnostics catalog bypass retained.
ui/src/lib/presence-connections.ts 52 52 Read fully; diagnostic grouping includes network facts and freshest input, unlike compa…
ui/src/lib/session-attention.ts 52 52 Read fully; expiry, archived suppression and unread terminal-failure precedence retained.
ui/src/lib/config/applied-refresh.ts 51 51 Generation-fenced saturation/backoff controller already shares both completion branches…
ui/src/lib/board/mcp-app-view-cache.ts 50 50 Uses canonical promise-cache core with force-renew and grant/instance cache identity; n…
ui/src/lib/gateway-status.ts 49 49 Read fully; ordered reload/restart/suspend/startup/recovery/offline precedence retained.
src/tui/tui-waiting.ts 48 48 Retained phrase selection and exact shimmer cells; no output text change.
ui/src/lib/agents/roster-element.ts 48 48 Retain small shared roster base for subscriptions, avatar leases and navigation present…
ui/src/lib/chat/outbox-owner-registry.ts 47 47 Live attention owner and storage owner are distinct; notifications must not reenter sto…
ui/src/lib/route-preload.ts 47 47 Read fully; immediate navigation preload, delayed hover preload and thrown/rejected fai…
src/tui/components/selectors.ts 46 46 Retained current/recommended model ordering and collapsed provider rows; shared theme f…
ui/src/lib/plugin-activation.ts 46 46 Read fully; entire allow/deny array validation precedes lookup so malformed partial arr…
src/tui/components/markdown-message.ts 45 45 Retained user/assistant styles and image composition; constructor narrowing was replace…
ui/src/lib/cron/scope.ts 45 45 Two ordered simultaneous inventory projections independently supply total and next enab…
src/tui/tui-command-context.ts 44 44 Retained minimal command-controller dependency contract; no exported signature change.
ui/src/lib/chat/session-diff-split.ts 44 44 Adjacent deletion/addition pairing keeps all source rows and exact absent left/right pr…
ui/src/lib/cron/decimal.ts 44 44 BigInt millisecond projection retains accepted decimal grammar, cancellable scale and a…
ui/src/lib/json5-runtime.ts 44 44 Read fully; strict JSON fast path, retryable lazy JSON5 import and original error propa…
src/tui/tui-image-data.ts 43 43 Retained bounded data decoder and canonical image processor; prior shorter decoder had…
src/tui/tui-session-history.ts 43 43 Retained exact-history-before-qualified-global fallback with ownership checks; errors n…
ui/src/lib/navigation-click.ts 42 42 Read fully; composed ownership, native modified clicks and external HTTP-only admission…
ui/src/lib/board/provider-signals.ts 41 41 Reimplemented variadic ListenerSet trial: 41 to 41 formatted lines. Rejected zero reduc…
ui/src/lib/cron/model-suggestions.ts 41 23 Removed two local accumulator wrappers and duplicate Set dedup; canonical normalization…
ui/src/lib/sessions/session-placement-recovery-storage-key.ts 39 39 Retain UTF-16 length framing and lazy payload-validator separation for exact namespace…
ui/src/lib/worktrees/gc-worktrees.ts 39 39 Read fully; exact captured job ID and authority checks before/after poll wait retained.
src/tui/components/btw-inline-message.ts 38 38 Retained assistant Markdown versus sanitized error rendering and exact dismissal text.
ui/src/lib/shared-request-subscription.ts 38 38 Read fully; shared producer cancellation, waiter abort race and final release retain ex…
src/tui/coalesced-refresh.ts 37 37 Retained one active operation plus latest-state rerun; after-drain timing remains disti…
ui/src/lib/chat/outbox-store-scope.ts 37 37 Captured session keys never re-resolve defaults; explicit agent conflicts remain visible.
ui/src/lib/plugins/install.ts 37 37 Read fully; progress events bind to actual sent request ID and listener releases in fin…
ui/src/lib/sessions/catalog-terminal.ts 37 37 Retain lazy terminal import and route handoff with selected agent ownership.
ui/src/lib/sessions/drag.ts 37 37 Retain shared MIME protocol factory and session copyMove/text-plain variant; sessions p…
ui/src/lib/sessions/session-mutations-host.ts 37 37 Retain shared host contract composed from actual row/connection owners.
ui/src/lib/sessions/transcript-search.ts 37 37 Retain explicit roster pagination/enrichment omission so corpus scope remains authorita…
ui/src/lib/format-duration.ts 36 36 Read fully; compact, long and human outputs share duration decomposition but have disti…
ui/src/lib/board/provider-types.ts 35 35 Public BoardProvider and shared placement shapes already narrow; no type-only rearrange…
ui/src/lib/model-runtime-choice.ts 35 35 Read fully; explicit projection prevents absent runtime fields inheriting another harne…
ui/src/lib/board/widget-ticket-lifetime.ts 34 34 Weak widget identity owns receipt age; copied receipts and missing/zero TTL remain dist…
ui/src/lib/config/config-mutation-runner.ts 34 34 Existing shared external-mutation runner preserves original Error identity and refresh…
ui/src/lib/cron-status.ts 34 34 Read fully; recorded running timestamp and auto-disabled failure semantics retained; no…
ui/src/lib/skills-grouping.ts 34 34 Read fully; ordered sources, bundled priority and Other fallback retained.
src/tui/tui-snapshot-journal.ts 33 33 Retained versioned mutation replay and explicit retireApplied policy; question refresh…
ui/src/lib/cron/catalog.ts 33 33 Connection-keyed pending cache preserves actual promise identity, explicit invalidation…
ui/src/lib/timezone-suggestions.ts 33 33 Read fully; independent Intl failure boundaries and browser/UTC/configured/supported or…
ui/src/lib/gateway-retry.ts 32 32 Read fully; one timer, cancel/reset distinction and bounded backoff retained.
ui/src/lib/model-auth-request-state.ts 32 32 Read fully; lazy startup invalidation and authChanged false exception retained.
ui/src/lib/chat/selection-annotation.ts 31 31 Strict UTF-16 range and optional identity validation retain exact annotation fields.
ui/src/lib/gateway-client-kind.ts 31 31 Read fully; TUI/web/CLI/app priority resolves mixed id/mode facts deliberately.
ui/src/lib/text-direction.ts 31 31 Read fully; explicit bidi controls outrank neutral skipping and first significant chara…
ui/src/lib/agents/watch-agent-scope.ts 30 30 Retain semantic scope changes across selection-source replacements; not the selected-ag…
src/tui/components/select-list-input.ts 29 29 Retained shared input/focus/invalidation owner with exact first-line clipping.
ui/src/lib/ime.ts 28 28 Read fully; input-local grace window and non-Enter retirement retained.
ui/src/lib/session-rename.ts 28 28 Read fully; generated-dashboard fallback, manual-label idempotence and worktree exclusi…
ui/src/lib/blob-data-url.ts 27 27 Read fully; FileReader failure versus invalid result and lazy localized messages retained.
ui/src/lib/chat/current-user-identity.ts 27 27 Undefined snapshot falls back to presence; explicit unavailable snapshot does not.
ui/src/lib/cron/payload.ts 27 27 Read-model payload discrimination protects malformed rows without altering server inven…
ui/src/lib/keyboard-shortcuts.ts 27 27 Read fully; mouse coordinates and keyboard trigger resolution have distinct admission a…
ui/src/lib/chat/tool-display-icon.ts 26 26 Static map with bounded aliases already delegates to icon owner; unknown names retain p…
ui/src/lib/gateway-secret-shape.ts 26 26 Reused existing exact base64 byte decoder; setup-code prefix and advisory shape classif…
src/tui/embedded-prepared-runtime.ts 25 25 Retained latest-publication readiness loop, synchronous invalidation and rejection pres…
ui/src/lib/agents/watch-selected-agent.ts 25 25 Retain deliberate intent revision versus automatic default reconciliation within one se…
ui/src/lib/editor-links.ts 25 25 Read fully; exact editor schemes, drive segment encoding and line suffix remain shared…
ui/src/lib/provider-usage-request.ts 25 25 Read fully; cancellation propagates separately from ordinary Result failure.
ui/src/lib/sessions/session-row-equality.ts 25 25 Boolean conjunction trial rejected 25→27 (+2); preserve compact current equality expres…
ui/src/lib/plugins/capability-consent-error.ts 24 24 Read fully; lazy install-only imports and retained GatewayRequestError identity guard r…
ui/src/lib/array-order.ts 23 23 Read fully; immutable movement and undefined-element early return preserve generic arra…
ui/src/lib/select-options.ts 22 22 Read fully; trimmed key, case-insensitive dedup and original display spelling retained.
ui/src/lib/board/widget-names.ts 21 21 Both stable-name variants already use one hash core; exact normalization, truncation an…
ui/src/lib/chat/goal-draft.ts 21 21 Action-specific exact allowed keys and edit requirements protect persisted interpretation.
ui/src/lib/chat/message-display.ts 21 21 Oversized history markers and assistant thinking stripping preserve visible Markdown ru…
ui/src/lib/gateway-websocket-url.ts 21 20 Shared HTTP-to-WebSocket protocol normalization before and after URL resolution, preser…
ui/src/lib/theme-color.ts 21 21 Read fully; canvas fallback is required for modern CSS color syntax outside canonical hex.
src/tui/embedded-history-runtime.ts 20 20 Retained canonical plugin prewarm adapter and public failure receipt.
ui/src/lib/graphemes.ts 20 20 Read fully; bounded segmentation differs from fallback codepoint slice for nonpositive…
src/tui/tui-last-session.contract.ts 19 19 Read-only retention: canonical worker command and stored-key prefix unchanged.
ui/src/lib/sessions/worktree-preservation.ts 19 19 Retain distinct notice and confirmation text.
src/tui/local-run-shutdown.ts 18 18 Retained strict environment parser, finite timer clamp and generous local grace.
src/tui/tui-session-list-policy.ts 18 18 Retained canonical discovery facts and shared recent-session bounds.
ui/src/lib/board/view-types.ts 18 18 Reviewed explicit view/callback prop contracts; kept shape and optionality intact.
ui/src/lib/chat/companion-question.ts 18 18 Bounded snippet and slash command extraction have different whitespace and delimiter ru…
ui/src/lib/agents/panels.ts 17 17 Retain canonical panel IDs and guard.
ui/src/lib/bytes-base64.ts 17 17 Read fully; retained chunked encoder and direct byte decoder, now reused by two sibling…
ui/src/lib/chat/message-client-source.ts 17 17 Display labels retain first occurrence order and localized source names.
ui/src/lib/skills/clawhub-search.ts 17 17 Read fully; trimmed query with present undefined and exact limit/options preserved.
ui/src/lib/uploads.ts 17 17 Read fully; live bootstrap reading and localized failure remain shared owner.
ui/src/lib/session-model-defaults.ts 16 16 Read fully; optional runtime/model/provider comparison retained.
ui/src/lib/sessions/recover.ts 16 16 Retain successor identity validation at real recovery RPC boundary.
ui/src/lib/sessions/session-retry.ts 16 16 Retain typed retryability and bounded server retry delay, no timing changes.
src/tui/tui-overlays.ts 15 15 Retained one overlay close/focus restoration owner.
ui/src/lib/cron/run-feedback.ts 15 15 One existing reason-to-message table with exact unknown fallback retained.
ui/src/lib/cron/webhook-url.ts 15 15 Literal HTTP prefix gate is intentionally narrower than URL parser; credential/encoded-…
ui/src/lib/terminal-availability.ts 15 15 Read fully; connection/admin/advertisement gates retained.
ui/src/lib/worktrees/create-worktree.ts 15 15 Read fully; trimmed repo path and omitted optional name/baseRef retained.
ui/src/lib/chat/composer-draft-changes.ts 14 14 Minimal listener subscription plus failure-isolated notifications; no independent dupli…
ui/src/lib/mcp-app-message-content.ts 14 14 Read fully; titled text stays attachment-only and plain content order/double-newline by…
ui/src/lib/sessions/session-archive-reason.ts 14 14 Retain complete translated archive-reason mapping.
ui/src/lib/chat/reply-target.ts 13 13 Minimal optional/null reply metadata guard retains legacy accepted null values.
ui/src/lib/download.ts 13 13 Read fully; common Blob downloader and next-task URL revocation retained.
ui/src/lib/sessions/context-budget.ts 13 13 Retain positive finite Gateway prompt-budget fallback.
ui/src/lib/board/provider-helpers.ts 11 11 Empty snapshot construction and title normalization are separate small projections.
ui/src/lib/chat/canvas-widget-frame-generation.ts 11 11 Separate get/bump operations retain capability-rotation versus connection-generation di…
ui/src/lib/format-error.ts 11 11 Read fully; shared redaction with different external-text trim semantics retained.
ui/src/lib/gateway-host.ts 11 11 Read fully; localized missing host and malformed literal fallback retained.
src/tui/tui-process-terminal.ts 9 9 Retained AsyncLocalStorage callback binding across preexisting stdio lifecycle.
ui/src/lib/fnv1a.ts 9 9 Read fully; UTF-16 code-unit hash identity contract retained.
ui/src/lib/skills/status-report.ts 9 9 Read fully; narrow typed status RPC boundary used by skills owner retained.
ui/src/lib/browser-platform.ts 8 8 Read fully; desktop-mode iPad special case retained.
ui/src/lib/scroll-behavior.ts 8 8 Read fully; optional browser/matchMedia and smooth-only reduced-motion override retained.
ui/src/lib/session-goal.ts 8 8 Read fully; direct shared-owner reexports retained; caller removal lies outside assigne…
ui/src/lib/gateway-locality.ts 7 7 Read fully; bounded IPv4 octets and exact loopback names retained.
ui/src/lib/external-link.ts 5 5 Read fully; template-facing canonical target/rel helpers retained; outside-scope consum…
ui/src/lib/sessions/session-message-subscriptions.runtime.ts 5 5 Retain lazy package adapter required by startup import graph.
ui/src/lib/path-display.ts 4 4 Read fully; filesystem root-preserving final segment expression retained.
ui/src/lib/product-links.ts 2 2 Read fully; single canonical Discord destination retained.
ui/src/lib/board/types.ts 1 1 Canonical Gateway protocol type barrel; no production algorithm or duplicate owner.
ui/src/lib/session-run-state.ts 1 1 Read fully; canonical session run-state reexport retained.
ui/src/lib/sessions/session-placement-recovery-migration.runtime.ts 1 1 Retain lazy migration adapter; eager import would expand startup payload-validator graph.
ui/src/lib/strip-thinking-tags.ts 1 1 Read fully; canonical assistant-visible-text reexport retained.
ui/src/lib/uuid.ts 1 1 Read fully; canonical normalization owner reexport retained.

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui cli CLI command changes size: XL labels Oct 9, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates repeated handling in OpenClaw’s browser dashboard and terminal interface while preserving their existing behavior.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent consolidation with no established defect; incomplete runtime coverage limits the evidence rating.
Proof confidence 🦐 gold shrimp (3/6) The supplied MEMBER classification and verified prior merged area work place this internal refactor outside the external-contributor proof gate. Reported harness checks support preservation, but PTY/resume coverage remains incomplete and historical screenshots do not prove this candidate; source inspection verifies unchanged stored shapes and no migration requirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The change reduces repeated handling without adding product surface. Verified prior merged area work supports the author's ownership context, and the production reduction provides maintenance value.

Merge readiness

✅ Ready for maintainer review

This PR retains useful, distinct maintenance work. The earlier merge-conflict blocker is resolved, and no concrete correctness defect was established.

Priority: P3
Reviewed head: 6ac394dc8abf1bd28721fe623e8df7098607151d

Before merge

None.

Findings

None.

Provenance

  • ui/src/pages/chat/composer-persistence.ts: original intent not found (unknown: Recent main history and a string-history search were inspected; the latter reached an unavailable promisor blob before establishing the original reader introduction.)

Tests

  • Missing end-to-end proof: Successful terminal picker exit and Gateway-backed resume are not established by the recorded PTY runs.
Agent review details

How this fits together

The browser dashboard and terminal interface turn user actions and Gateway responses into conversation views, settings, and terminal output. Existing controllers continue to own request admission, result publication, and cleanup.

flowchart TD
  A[User actions] --> B[Browser dashboard]
  A --> C[Terminal interface]
  B --> D[Existing controllers and shared handling]
  C --> D
  D --> E[Gateway requests and responses]
  E --> D
  D --> F[Conversation views and terminal output]
Loading

Technical review

Best possible solution:

Keep the consolidation within existing owners while preserving output, request ordering, and stored preferences.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR proposes behavior-preserving consolidation rather than fixing a reported user defect.

Is this the best way to solve the issue?

Yes: the inspected changes reuse existing owners, migrate callers together, and remove redundant paths without adding a public API or stored format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 73b9d2fe2018.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction: Inspected the merge-base-to-head production changes, including paths omitted from the supplied file metadata; the patch consolidates existing behavior without adding configuration, dependencies, protocol fields, or plugin SDK surface. (6ac394dc8abf)
  • Current-main necessity: Fetched main still has separate composer snapshot/revision readers and separate chat-setting selection functions; this consolidation remains distinct work. (ui/src/pages/chat/composer-persistence.ts:108, 73b9d2fe2018)
  • Previous blocker resolved: Live GitHub reports the pinned head as non-draft and mergeable=true. The supplied verified test merge has the exact base and head parents; the body records affected post-rebase chat and outbox checks. Pending checks are not attributed failures. (6ac394dc8abf)
  • Proof source identity and limits: The fetched body matches supplied SHA-256 320b83ea541d75de5e85fe6e2c088b68e36af072cf00351f30303e8e5f3e9e07. Its evidence section reports extensive tests and explicitly inconclusive PTY/resume results; later non-table content contains no additional proof narrative. Prepared images were inspected and belong to earlier feature PRs, not this candidate. (6ac394dc8abf)
  • Markdown dependency contract: The inheritance change affirmatively depends on @earendil-works/pi-tui 0.99.2. Its published package/dist/components/markdown.js was read in memory: setText calls this.invalidate(), and the constructor assigns fields without calling subclass setters. Hyperlink cache invalidation therefore remains intact. npm metadata verifies repository ownership and package shasum 14c0213f2a7fb713592d0241c2b53aacc666f1df.
  • Stored-state compatibility: Composer readers retain the same captured-state owner; outbox codec fields and roster scope encoding remain unchanged. Device identity generation still returns exactly deviceId, publicKey, and privateKey. Preference normalization preserves stored booleans and existing defaults, so no migration is required. (ui/src/pages/chat/composer-persistence.ts:107, 6ac394dc8abf)

Likely related people:

  • Peter Steinberger: Raw commit e0eed25 adds ui/src/app/server-prefs.ts:235 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e0eed257c8b4; files: ui/src/app/server-prefs.ts)
  • Vincent Koc: Raw commit b4a89e8 adds packages/terminal-core/src/ansi-sequences.ts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b4a89e8ad2bd; files: packages/terminal-core/src/ansi-sequences.ts)
  • Phineas1500: Raw commit 331b728 adds src/tui/components/hyperlink-markdown.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 331b728b8dbe; files: src/tui/components/hyperlink-markdown.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus tests Production +992/-1607; tests/support +226/-195 The consolidation removes 615 net production lines while adapting existing behavioral coverage.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is internal maintenance with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-09T19:15:54.057Z sha a940d00 :: blocked before merge. :: none

Reviewed October 9, 2026, 3:31 PM ET / 19:31 UTC (Revision 2).

@steipete
steipete force-pushed the deslop/d23-ui-lib-tui-p3-20261007 branch from a940d00 to 6ac394d Compare October 9, 2026 19:22
@steipete
steipete marked this pull request as ready for review October 9, 2026 19:23
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 9, 2026
@steipete

steipete commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI attribution for 6ac394dc8abf1bd28721fe623e8df7098607151d.

All executed checks outside the three UI E2E jobs below passed. Each remaining failure is inherited from main's intent-only history-prefetch change, b0fb3ac3321231f95c5ab1d64d441dad2adea35d (#167906). That commit is already an ancestor of this PR's base. The three E2E fixtures still wait for automatic prefetch before issuing pointer or keyboard navigation intent; the unchanged owner now explicitly requires that intent.

Failed job Exact observed failure Independent clean-main reproduction
checks-ui-e2e (1/9), job 113988216637 ui/src/e2e/chat-session-prefetch-gating.e2e.test.ts:73, “keeps queued warm-ups off the socket while the presented transcript reloads”: expected the first background history request, received 0. Initial transcript rendering already passed; the later gating assertions had not run. Same test and line fail with expected 1 / received 0 on clean main e19bcd6bd11e9c24608aadcc9cfc4b9b670351bd; one failed test, 38.41 seconds.
checks-ui-e2e (7/9), job 113988216724 ui/src/e2e/chat-flow.history-recovery.e2e.test.ts:348, “shows persisted user messages after opening History and scrolling mixed history”: timed out waiting for Session B's first chat.history request, before its first navigation interaction. Same test, line, request and timeout on clean main e19bcd6…; its other five cases passed.
checks-ui-e2e (8/9), job 113988216874 ui/src/e2e/session-prefetch.e2e.test.ts:51, “opens prefetched history immediately after an unrelated roster refresh”: expected 1 request, received 0, before the roster refresh or navigation. Same test and line fail with expected 1 / received 0 on clean main e19bcd6…. These two files together reported two failed / five passed tests in 48.64 seconds.
openclaw/ci-gate, job 113992525701 Aggregate failure: checks-ui-e2e finished with failure while selected. Its log identifies the UI E2E aggregate as the sole failing selected dependency; the three source failures are attributed above.

CI checked out merge 5927da4fc0b465fd687549a6ebfef544f59d0f78, with ordered parents 8eb960d42a709610f5ad5ba587efa2ddcbeca367 and the exact PR head. The three failing tests, ui/src/pages/chat/session-prefetch.ts, chat-page.ts, chat-history-request.ts, and the relevant chat-flow.test-support.ts / control-ui-e2e-suite.test-support.ts are byte-identical across the PR base, PR head, tested merge, and clean-main reproduction. None is changed by this PR. The prefetch controller initializes intent to null and only adopts it from pointer/focus events; each failure occurs before those events, so the PR's later interaction refactors are not on the failing path.

Reproduction used the existing bundled browser route and unchanged budgets:

OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --maxWorkers 3 \
  ui/src/e2e/chat-flow.history-recovery.e2e.test.ts \
  ui/src/e2e/session-prefetch.e2e.test.ts

OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --maxWorkers 3 \
  ui/src/e2e/chat-session-prefetch-gating.e2e.test.ts

The cancelled ClawSweeper dispatch (37979921355) and PR-context run (37979920949) both passed on attempt 2 after being rerun; neither cancellation is waived. No test assertion, timeout, retry, skip, ignore, or baseline was weakened. The source fix belongs with main's prefetch fixture update: express navigation intent before the existing request waits while retaining their subsequent assertions. Per the campaign rules, this PR does not absorb that unrelated main repair.

Independent current-head review found no actionable correctness defect. The conflict-only rebase preserved all 133 production patches byte-for-byte; focused affected tests, UI-chat types, runtime/Madge cycle checks, and pre-push suppression checks passed. The completed full changed-check, broader subsystem proof, and explicitly recorded local PTY limits remain in the PR body. This evidence supports the coordinator-authorized inherited-failure exception, pinned to the exact head above; it does not relabel failed hosted tests as passing.

@steipete
steipete merged commit 9394889 into main Oct 9, 2026
222 of 229 checks passed
@steipete
steipete deleted the deslop/d23-ui-lib-tui-p3-20261007 branch October 9, 2026 19:44
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…67925)

* refactor: share UI and TUI state handling

* style: align UI and terminal helpers with lint
wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Oct 18, 2026
…ried

A retried placement kept the failed attempt's start time, so the elapsed
timer in the startup status and the working indicator counted the dead
time between the failed attempt and the retry. The entry now tracks the
message creation time and the attempt start separately: Retry keeps the
message timestamp (even when a rejected send rotates the message id) and
restarts only the attempt clock, and the attempt-start override is scoped
to the placement turn so an ordinary send still counts its acknowledgment
wait from the message time.

Rebased onto main after the shared-UI consolidation (openclaw#167925), the cloud
snapshot startup progress (openclaw#170895), and the progress-totals fix
(openclaw#172492): the retry regression tests moved into
session-placement-startup.stop.test.ts with the rest of the placement
Retry suite, and the snapshot startStatus payload is preserved alongside
the reset attempt clock.

Co-Authored-By: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant