Repository navigation
perf(control-ui): restore complete cached transcript rows - #186512
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR restores cached link labels, thumbnail pixels, archive notices, and avatar sources alongside saved transcript rows. Example: Reload a saved conversation containing a 480×240 image and a link titled “Synthetic linked research.”
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this maintainer-owned experiment open and retain its explicit merge hold; the cached-avatar path can issue requests before media admission. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe Control UI projects Gateway history into a bounded, account-scoped browser snapshot, then renders saved rows while live connection and route owners revalidate access. flowchart LR
A[Gateway history and metadata] --> B[Session message cache]
B --> C[Scoped IndexedDB snapshot]
C --> D[Transcript row presentation]
E[Live connection and route admission] --> F[Media reads and actions]
D --> F
Technical reviewBest possible solution: Retain the existing scoped snapshot owner and allow pre-admission avatars to use only locally available bytes, falling back when those bytes are missing. Do we have a high-confidence way to reproduce the issue? Source establishes the avatar failure path: restore a known same-origin avatar URL, retain its local hint while evicting HTTP-cache bytes, and render with mediaReadAllowed false; no runtime reproduction was executed. Is this the best way to solve the issue? Extending the existing bounded snapshot and removing superseded registration/projection paths is coherent, but a URL hint cannot substitute for cached bytes at the passive-media boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d79a7b6c371c. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +782, Tests +736, Docs +19, Other +338. Total +1875 across 75 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 28, 2026, 12:15 AM ET / 04:15 UTC. |
2a38ab5 to
ab8ddc4
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
66335a9 to
db2a7a4
Compare
db2a7a4 to
b5763c3
Compare
…penclaw#186512) After the transcript painted from cache, warm reloads kept changing rows for about a second: inline session/PR links restyled into titled chips, attached images went empty box -> skeleton -> image, notice rows were inserted and assistant avatars swapped in, shifting the thread (live Team r237/r241). The transcript snapshot owner now persists the bounded display facts these rows render with: link titles/labels, image intrinsic dimensions and, under the maintainer-approved budget, previously displayed authorized inline thumbnail bytes (<=32 thumbnails / <=8 MiB, <=256 KiB each, scoped to gateway/account/session, cleared on reset/sign-out; no tickets or credentials stored; display-only), notices from canonical facts, and avatar references through the existing avatar cache. Rows render complete in their first commit; live catch-up updates only differing facts. The notice owner now keeps one node through live catch-up (main replaced it ~29 times per load), with a node-identity regression. Results: links/images/notices/avatars stable with zero thread-height change after first paint in 11/11 reloads on both routes (5/5 confirmation on the final integration); snapshot +0.95%. Accepted tradeoffs: chat paint +22.7 ms and LoAF +24.7 ms (no cheap owner fix found in a CPU-profile pair); dashboard FCP +8 ms. Test-lines ceiling set to the exact total (+784 justified coverage, also absorbing main's prior overage) under the maintainer decision of 2026-10-28. Runtime +786 UI LOC after a 25% compression pass. Focused, native and budget tests pass; remaining CI reds (mock-exports, core lint, a file-attachment timeout that passes 4/4 on both arms) reproduce on main or are load-sensitive; autoreview clean through P2. Release-note context: Control UI chat rows reload with link titles, images, notices and avatars already in place.
What Problem This Solves
A signed-in warm reload paints cached transcript rows and then changes their inline link labels, images, archive notices, and avatars as unrelated live requests finish. The measured dashboard-deep-link evidence showed link restyling changing thread height by 58 px, a late archive notice adding 96 px, and image loading at roughly 1.3–1.6 seconds.
Why This Change Was Made
Keep bounded last-known display facts with the existing scoped, disposable transcript snapshot. Restore titled links, intrinsic image dimensions and previously displayed thumbnail bytes, canonical notice facts, and avatar sources with each retained row. Live authority still gates reads/actions. Unchanged catch-up preserves the displayed row.
The snapshot is limited to 80 rows, eight links/images per row, bounded strings, and 32 thumbnails/8 MiB globally with the existing 256 KiB inline ceiling per image. Animated/full-size originals and credential-bearing URLs are excluded. Scope, window pruning, reset and sign-out share the existing snapshot lifecycle. Projection version 10 invalidates the older disposable projection and includes main’s terminal-widget reconciliation. No Gateway protocol, configuration or server storage changes.
User Impact
Warm transcript rows show their last-known complete content while reconnecting. Missing or evicted bytes retain the existing loader. Main's header viewers/sharing and archived/read-only session hydration are retained in the same snapshot owner. Provider-policy notices also retain one DOM node as live facts update, including equal-valued snapshots and the blocked-state transition.
Evidence
Current head
b5763c39f49ae807f080adeda819d17debcdabf6, rebased cleanly ontocb5a4388f310d8b7c5d461e4f875561215260c1d. Ready PR; stop before merge. Exact-head CI is complete: the test-line gate passes with zero slack, all three UI unit shards and five of six UI browser shards pass, including the provider-notice regression. Remaining reds and matched controls are classified below. Fixed runtime retained exactly one provider-notice node in all ten loaded cases, with zero replacement/removal/missing/hidden counts. Subsequent counter-only rebases keep the implementation and regression files byte-identical. Earlier warm-reload timing/filmstrip results remain explicitly prior-head.Accepted tradeoff
The maintainer accepted the prior signed-in chat paint cost of +22.7 ms and LoAF blocking cost of +24.7 ms for complete cached rows. A matched CPU-profile pair found no cheap owner-level fix: object URL creation, title resolution and snapshot parsing were not the dominant cost. The earlier dashboard FCP increase of 184 → 192 ms (+8 ms) was also accepted with reversed-order controls (A/A 0 ms, B/A +8 ms, repeated A/B +4 ms). These are prior-head results, not a claim about this final confirmation.
Prior-head five-pair confirmation
Inspected filmstrips show zero targeted visible late link/image changes in 5/5 warm reloads on each route; baseline has one or two change batches. Both arms already have zero thread-height change. All captured frames were inspected. The paired rig shows a managed image and a session-link label; it does not independently cover a seeded PR title, archive divider, or visible transcript avatars. The extended 80-row Team fixture separately qualifies two links, two images (ticketed no-store and cacheable no-cache), a canonical notice and avatars, with zero late fact/height changes in one warm smoke; it retains two thumbnails totaling 177,520 bytes. The combined native regression covers all four kinds. It now parameterizes chat and dashboard entry routes and accepts only the approved <=0.5 px geometry residual, retaining literal-zero fact changes.
Browser Element Timing and the first captured transcript frame are separate measurements. Screencast delivery is not display-vsync; capture timestamps can precede browser paint entries. Other page transitions remain (syntax coloring, sidebar/Details, reactions and widgets); this is not a whole-page stability claim. The captured-frame median moves +4.443 ms on chat and +95.704 ms on dashboard, with overlapping IQRs and mixed pair signs; the dashboard rise is reported as inconclusive timing, not hidden as a win. Chat LoAF marginal medians rise 14.9 ms; the paired median is +8.4 ms with mixed signs.
Five interleaved A/B–B/A pairs per route, fixed AWS
c7a.4xlarge, signed-in real-Gateway rig, 80 ms RTT, no CPU profiling. Values are median [Q1, Q3]; deltas are candidate minus baseline.Chat
Selected snapshot JSON (UTF-8, excluding Blob payloads): 55,051 → 55,576 bytes (+0.954%). Thumbnail payloads: 0 / 0 bytes → 1 / 204 bytes. This measures payload size, not IndexedDB physical disk usage.
Dashboard
Selected snapshot JSON (UTF-8, excluding Blob payloads): 56,745 → 57,281 bytes (+0.945%). Thumbnail payloads: 0 / 0 bytes → 1 / 204 bytes. This measures payload size, not IndexedDB physical disk usage.
Synthetic before / after
First captured chat transcript frame on warm reload 1. The image and resolved session label are present in the candidate; the screenshots are full synthetic fixture captures, not private Team captures.
Test-lines ceiling
Maintainer decision 2026-10-28: PRs may raise
config/test-lines-baseline.txtto the exact new total for justified tests, with justification in the PR; main is reset to its real total so the ratchet is green again.This PR adds +784 net test/support lines, including three lines in the provider-notice follow-up. Existing owner tables and the combined native regression protect bounded link/image facts and retained thumbnail bytes; gateway/account/session isolation; scope/reset/sign-out, quota and window eviction; stale authority and media lifecycle; and complete warm reload of session/PR titles, ticketed/cacheable images, canonical archive notices and avatars. The follow-up extends the existing table to clone the provider notice and keeps a first-node handle through the native blocked-state update. It adds no test cases, fixture or timing wait. The table proves equal-valued publication identity; native proof covers the mounted pane lifecycle and live state transition.
pnpm check:test-lines-ratchet --base cb5a4388f310d8b7c5d461e4f875561215260c1d --no-merge-basereports 6,243,924 total / 6,243,924 ceiling / 0 slack. Main's test audit reduced the total during this follow-up. The combined value is 6,243,140 main + 784 justified lines and absorbs main's prior overage without carrying forward spare allowance. The base temporarily carried a 6,320,000 ceiling; this PR removes the remaining 76,076 lines of reserve after its own additions.Provider-notice catch-up investigation and repair
The original CI failure was
chat-provider-policy-notice.e2e.test.ts: its visibility poll passed, thennotice.boundingBox()returned null. This provider-policy card is transient composer run state; the cached canonical notices are archive/divider rows. A parent/live publication could still replace the composer card, so the mounted flow was instrumented.On one AWS c7a.4xlarge lease,
cbx_b861d553fbc5, run, both arms used the 134 actual files from CI shard 2/7, four Vitest workers and a four-CPU affinity limit, matching the failing CI worker/CPU envelope. The host has 32 GiB rather than CI's 16 GiB; these are reliability/DOM-count results, not latency measurements. Temporary identical ordering placed the ten notice repetitions first so they overlapped the other three workers; every remaining selected file ran once. Existing assertions stayed intact, with no extra await between the visibility poll and box measurement. A temporary MutationObserver/frame probe recorded node identity, removal and hidden ancestors; all instrumentation/ordering edits were restored and are absent from the PR.9b82c52749f572f0ceda1504b6463055fd5ea67c2742aa01664c441571418805545bc012b629422893f53c85b05f7dbc6a9eeee05399112f1a9edff7The null-box assertion did not reproduce in these 20 instrumented cases. The probe confirms an inherited replacement defect in both arms, including same-state swaps and all buffering→blocked updates; it does not establish a painted empty-frame gap. Synchronous replacement can invalidate a node that Playwright has just resolved even when a replacement is already present.
The view called a JSX-producing helper on reactive updates. Its identity memo did not preserve the DOM when an equal-valued notice object or another tracked display dependency changed. The repair gives shared status markup one reactive component owner and keeps the provider card in a non-keyed
Show: copy, role and tone update in place, and explicit clearing still removes it. The superseded renderer helpers and memo are deleted. No reveal gate, timer, cached transient authority or production probe is added.A one-line extension to the existing provider-state table fails all five identity cases before the repair, then all 26 tests pass with it. The native regression also retains its first element handle through the blocked update.
pnpm test ui/src/pages/chat/chat-view-notices.test.tsx --maxWorkers=1: 7.95 s wall, 26 passed (latest invocation after the private prop rename; earlier repair invocation 6.52 s). Independent review of the follow-up and subsequent complete private-prop rename is clean through P2. Earlier full-source review remains resolved through P2: the avatar finding was declined because this task explicitly reuses the existing scoped same-origin avatar URL cache; imposing WebSocket authority on that cache would change its existing HTTP behavior. Credential-bearing and unknown/cross-origin sources remain excluded.Final-head validation
Current full follow-up: +9 runtime lines / +3 test lines. Whole PR UI runtime +786 (+771 handwritten, +15 generated validator). The requested production-stat filter reports 2,785 additions / 1,285 deletions = +1,500, across 65 files. Growth implements the approved bounded display contract and retained notice-node contract.
The repaired runtime at
93f53c85b05f7dbc6a9eeee05399112f1a9edff7passed changed UI lint (0 errors/9 warnings), UI/native types, 513 focused tests/19 files, nine native tests/three files (both cached-row routes, reconnect and first-pane state), and the matched asset comparison. All ten policy repetitions passed under the same 134-file/four-worker/four-CPU workload, retaining exactly one node each and zero replacement/removal/missing/hidden counts. After immutable receipts were copied, the remaining duplicate load workload was deliberately canceled to perform the required counter refresh; no all-134-pass claim is made for that canceled fixed-runtime run. Leasecbx_f762bd6b1f53is released with no host. The completed exact-head CI is the broad final proof; its remaining failures are classified below. The notice implementation and regression files are byte-identical after rebase; updated main includes unrelated UI/test/translation changes.Prior-head broad proof remains historical: the full UI e2e run completed with 859 files passed, 2 failed, 4 skipped; 3,222 tests passed, 2 failed, 4 skipped in 5,065.04 s. It exposed the known 1/64 px geometry residual (maintainer-approved <=0.5 px tolerance, literal-zero fact assertion retained) and a QA Lab permission error reproduced on pinned main. Lease
cbx_fb465dfb4d95, run. Prior-head focused proof was 487 unit/18 files and 9 native/3 files; it is not substituted for exact-head CI.Asset budget
The complete-row feature's prior matched build measured 1,263,025 B main → 1,275,806 B candidate chat boot gzip (+12,781 B). The chat ceiling is 1,276,669 B, calibrated from a same-toolchain candidate measurement while preserving main's existing 811 B headroom. Measurement logic and all other budgets are intact. The repaired-runtime matched comparison passes: 1,261,685 B main → 1,273,889 B candidate (+12,204 B), below the cap. This is a byte-size result, not a new latency claim. The dedicated budget regression suite previously passed 42 tests; this follow-up keeps its measurement logic unchanged.
Exact-head CI
Run 40796193440 completed on exact head
b5763c39f49ae807f080adeda819d17debcdabf6. The watcher was run from the worktree root with that full SHA. Overall CI is red, with the individual results and controls below; no CI reruns or update-branch operations were used.server-shutdown.runtime.test.tsandserver.spawn-broker.test.ts, untouched by this PR. An exact-main control ata919e5ecc4f6c579e16ab21499ccda3acaa1fb07reproduced the identical 14 diagnostics, exit 1 on both arms, in leasecbx_86c617797795. Those two files, the checker and its baseline are byte-identical through the final base. Proven inherited.src/agents/tools/sessions-send-tool.admission.test.ts:722violateseslint(curly)in the newly merged Slack test. The file/config/wrapper are unchanged by this PR. A focused control on head and exact maincb5a4388f310d8b7c5d461e4f875561215260c1dreproduced the same diagnostic, exit 1 on both, in AWSc7a.xlargeleasecbx_397d2d71ee80, run. Proven inherited.chat-workspace-files.e2e.test.ts:175timed out waiting forRemove notes.mdafter choosing Attach to session. The test, workspace and composer attachment owners are unchanged by this PR. One matched focused control, with separate head/main production builds on the same AWSc7a.xlarge, passed 4/4 tests on head and 4/4 on exact main. Leasecbx_11d147673a44, run. These controls used one worker per arm, not the full CI shard load. Unreproduced; attribution remains inconclusive, not proven inherited.The final head also passes the exact ratchet on the lint-control lease. The prior counter-only AWS run passed all 26 notice unit tests; the notice implementation and both regression files remain byte-identical to the fully tested repaired runtime above. No source changes followed these controls. Independent review remains clean through P2.
All task leases, including
cbx_b861d553fbc5,cbx_f762bd6b1f53,cbx_86c617797795,cbx_397d2d71ee80andcbx_11d147673a44, are released with no host. No local Gateway was started. Do not merge automatically; the lead owns the remaining CI judgment and landing.