Repository navigation
fix(ui): release reply previews when connections retire - #145907
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check could not safely complete for this revision. ClawSweeper will not retry this unchanged revision. Next step: No contributor action is requested. Maintainers should inspect the linked workflow run. |
|
Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 3:59 AM ET / 07:59 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Control UI releases cached reply previews when a Gateway connection retires or a chat pane disconnects, with regression coverage for object collection and cache reuse. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main, and this review found no actionable patch defects. The linked issue remains open pending this PR. Priority: P2 Review scores
Verification
How this fits togetherChat panes fetch unloaded reply-source messages from the Gateway and cache them for preview rendering. Connection and pane lifecycle callbacks determine when those cached objects become obsolete. flowchart TD
A[Reply preview requested] --> B[Pane preview cache]
B --> C[Gateway message lookup]
C --> D[Check connection and request ownership]
D --> B
B --> E[Render reply preview]
F[Connection retires or pane disconnects] --> G[Clear preview cache]
G --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +57. Total +63 across 6 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep preview lifetime cleanup in the existing cache owner while preserving same-connection reuse and stale-response rejection. Do we have a high-confidence way to reproduce the issue? Yes, from source: fetch a preview, retain its pane, then retire the connection; current main invalidates reads but retains the payload in its map. The supplied regressions exercise this path, but were not rerun during this read-only review. Is this the best way to solve the issue? Yes. Clearing the existing map at both generation-retirement boundaries is a narrow repair that preserves the established cache and request-ownership contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 526477da9bc6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review Please review current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Punchcard-Session: ember-river-harbor-t4 * commit 'fdbb2455ac991202051904501438f690d22a0701': (21 commits) fix(qa): restore Telegram skill integration checks (#151632) test(e2e): follow published plugin convergence restarts (#151607) perf(tasks): skip unnecessary maintenance record copies (#151578) refactor: simplify Gateway session-name precedence (#147984) fix(ui): keep suggested task launches in the background (#151611) fix(agents): preserve subagent progress across repeated restarts (#151450) fix(diagnostics): scale memory growth pressure to the heap limit (#151355) fix(ui): release reply previews when connections retire (#145907) fix(ui): disable skeleton shimmers when motion is reduced (#151314) fix(gateway): reduce worker overhead with large session stores (#149700) improve: defer unused work during Gateway startup (#151547) improve: reduce transcript freshness-check overhead (#151606) fix(ui): keep Home from appearing twice in the sidebar (#151401) improve(gateway): reduce allocations during large session refreshes (#151565) improve: reduce temporary allocations for long provider requests (#151603) fix: keep Gateway responsive and preserve completions during SQLite contention (#151594) fix(models): renew successful empty provider catalogs (#151580) fix: reveal preserved chat branches after rewind and resend (#151598) perf(outbound): skip inert plain-text preparation scans (#149829) improve(ui): make toast feedback compact and recovery readable (#151575) ...
Closes #145906
What Problem This Solves
Control UI panes retained fetched reply-preview payloads after their Gateway connection retired or the pane disconnected, even though those payloads could no longer be used.
User Impact
Obsolete preview objects can be collected as soon as their connection or pane lifetime ends. Reply navigation, unavailable-message feedback, and reconnect recovery keep their existing behavior. This fixes object retention; it does not claim a measured allocation, RSS, or timing improvement.
Why This Change Was Made
Clear the existing reply-preview owner's map at both connection-generation retirement boundaries. Keep successful responses and failed attempts cached across viewport resets and hide/show changes, with the existing 256-entry bound and stale-response guards.
Evidence
The two reachability regressions fail on the original source through the actual connection-retirement and pane-disconnection callbacks. They verify that an unowned control can be collected while the obsolete cached payload remains reachable; the fix releases that payload before any refetch.
Final head
6dad1726711b248d23900ca5859b6caf49a9b17dintegrates main at2ef09f01deba518303f6f92ec32f0fb148d10753:The first mapped run encountered the pre-existing duplicate declaration fixed by #151417. Incorporating that existing main repair made the full check pass; this PR adds no separate fix for it. Hosted CI and the required hosted review are refreshed for this final head before landing.
Before and after
These historical synthetic captures of the unavailable-source case are byte-identical: the same feedback and usable draft remain visible. They demonstrate unchanged presentation, while the lifecycle tests establish object release. Both images were inspected and verified rendering in the originating task and this PR.