Repository navigation
fix(ui): release closed chat panes and refresh once on reconnect - #160079
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: needs maintainer review before merge. Reviewed September 28, 2026, 3:25 AM ET / 07:25 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Control UI releases closed chat panes and their message subscriptions, refreshes chat history once after reconnect, and restores single-pane controls. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main still has the reported pane and reconnect lifecycle behavior, while the branch provides a focused repair with meaningful regression coverage. I found no blocking introduced defect. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI turns chat routes and Gateway connection updates into visible conversation panes. Each pane displays history and holds a session-message subscription, while the page saves split-layout preferences. flowchart LR
A[Chat route] --> C[Chat page]
B[Gateway connection] --> D[Pane lifecycle]
C --> E[Pane layout]
D --> F[History and subscriptions]
E --> G[Visible chat panes]
F --> G
E --> H[Saved layout]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +56, Tests +416. Total +472 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain this owner-level repair and land it through the normal exact-head review and CI gates, preserving survivor identity and saved ownerless-pane admission. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source exposes the duplicate reconnect refresh and one-shot late-release paths; the PR reports baseline-failing focused regressions, which this read-only review did not execute. Is this the best way to solve the issue? Yes. The patch repairs pane and subscription lifecycle behavior in their existing Control UI owners without adding a configuration or protocol path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a61b5214bc83. LabelsLabel changes: No label changes. Label 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)
|
|
Merged via squash.
|
What Problem This Solves
Closing an active split chat could recreate the closed session in a hidden pane, retaining its live subscription; reconnecting could also load the same startup twice.
User Impact
Closed panes release their subscriptions, the surviving chat keeps its draft and identity, and a restored single pane has normal single-pane controls. No schema, stored-session-key, configuration, or protocol change is required.
Why This Change Was Made
Keep the survivor authoritative until navigation settles, reuse bounded release retries for subscriptions acquired after disposal, and let the existing connection startup own reconnect hydration. Drag handling moves into its existing indicator module so the page stays within its source-size budget, with real-event regression coverage for cleanup.
Related: #150153.
Evidence
Focused lifecycle, close-route, retained-session, page, and attachment-handoff tests pass. The original code fails the late-release/rollback and hidden-pane/singleton-control regressions. Native staged changed-file checks against the incorporated main commit pass, including UI types, fixture type graphs, lint, formatting, i18n, line limits and dead exports. Independent Codex autoreview found no actionable P0–P2 findings.
An isolated real Gateway and browser passed reconnect, draft preservation, one startup load, and late subscription release after an injected transient unsubscribe failure. The browser client and connection stayed unchanged during release, the closed pane remained detached, and the Gateway acknowledged
subscribed: false. This is synthetic local live proof; no production deployment is claimed.One-worker test command wall times: close-route 3.00s; retained sessions 2.33s; disposal 2.47s; history 1.93s; connection lifecycle 4.44s; page plus attachment siblings 3.92s. The first CI run exposed incomplete companion/catalog fixtures and teardown that outran lazy imports. The fixtures now use normal connection snapshots, catalog admission, explicit subscription replies, and joined imports; assertions remain intact. The missing CI shell-helper fixture is supplied by the existing main fix in #160024. Subsequent focused proof passed: companion 23.90s, page/attachment siblings 40.52s, and 22 affected CI fixture cases 38.67s. The other nine UI test files passed in the preceding 35.71s group, whose sole companion fixture failure was repaired and replayed. Initial failed CI UI shard: 92.45s; CI for the published head passed; ClawSweeper completed its review without findings. Production delta: +56 lines; the broader reduction campaign is accounted separately.
Before: a saved single pane incorrectly retains split-pane close controls.
After: the same saved pane uses normal single-pane controls.