Repository navigation
fix(ui): keep chat rename and reactions usable while reconnecting - #178176
Conversation
Read the session-owned retained presentation when the live roster is cleared on disconnect. Keep header rename and reaction controls reachable for the same recovery identity without changing dispatch authority or introducing another outbox. Cover rendered controls, identity retirement and stop, optimistic rename and reaction state, and shared deferred replay after reconnect.
|
🦞👀 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 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89018118d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesKeep chat rename and reaction controls available during reconnect by consuming the session owner’s retained presentation. Example: Rename a conversation to “Renamed offline” while the Gateway reconnects.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main gap in reconnect behavior. The earlier findings are resolved, and no remaining actionable defect was found; exact-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI chat pane receives session roster publications and Gateway connection updates, then projects session metadata into its header, transcript controls, and recovery behavior. flowchart TD
A[Gateway connection] --> B[Session capability]
B --> C[Retained session presentation]
C --> D[Chat pane and history refresh]
D --> E[Rename and reaction controls]
E --> F[Existing deferred intent queue]
F --> A
Technical reviewBest possible solution: Use the session owner’s paired presentation in both chat consumers while preserving its canonical-list fence and existing mutation paths. Do we have a high-confidence way to reproduce the issue? Current-main source shows chat consuming the live roster that the session owner clears on disconnect, and the supplied before capture shows the resulting missing controls; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete production repair: both consumers use the existing presentation owner without duplicating reconnect policy, state, or dispatch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e41793e3ef6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +308. Total +312 across 8 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 HistoryReview history (1 earlier review cycle)
Reviewed October 20, 2026, 5:11 AM ET / 09:11 UTC (Revision 2). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4844fc5fb9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keep chat roster metadata and rename/reaction controls behind the session owner presentation fence while reconnect startup publishes provisional rows. Use the same paired presentation for history refreshes, preserving live loading/errors and scoped history. Cover descriptor and chat.startup publication before the canonical list, plus canonical archive behavior. Addresses the review finding on #178176.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26e7fbe8c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const decideApproval = vi.fn(); | ||
| const context: ApplicationContext = { | ||
| ...createInitializationContext(), | ||
| ...createInitializationContext(createGatewayBrowserClientFixture()), |
There was a problem hiding this comment.
Update the owner presentation in this fixture
When this test reaches the second publications iteration, pane.applySessionsState(...) no longer copies the argument's result; the changed implementation reads context.sessions.presentation. This fixture pins that presentation to the one-row “Unrelated pane title” result, so connecting the Gateway here never exposes the requester row and waitForSolid continues seeing “New session” instead of the expected derived title. Publish each test row through the session owner's presentation, as the session-presentation fixture now does.
AGENTS.md reference: ui/AGENTS.md:L14-L18
Useful? React with 👍 / 👎.
|
@clawsweeper re-review The reconnect presentation fence is fixed in 26e7fbe, and both inline findings are resolved. The latest commit, 0e4f144, corrects the remaining synthetic owner fixtures exposed by CI. All 85 tests in the four affected files pass, the exact UI-chat typecheck and targeted lint/format checks pass, and isolated Codex autoreview is scoped-clean. The PR body contains the current proof. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Align the generated-title fixture with #178176, which intentionally keeps header rename available while the same Gateway identity reconnects. Share the sidebar's queued-rename assertions with the header, including the optimistic title, exact target identity, and single reconnect replay. Keep the Sessions page disconnect behavior unchanged. The original header case passes on 7a0c15b's parent and fails after it. Native focused proof: 8 tests passed. The unchanged cold-load case also passed five native runs, including the hourly head and concurrent load. Affected UI-e2e typecheck, scoped lint, format and P2 review passed.
…enclaw#178176) * fix(ui): retain chat metadata controls while reconnecting Read the session-owned retained presentation when the live roster is cleared on disconnect. Keep header rename and reaction controls reachable for the same recovery identity without changing dispatch authority or introducing another outbox. Cover rendered controls, identity retirement and stop, optimistic rename and reaction state, and shared deferred replay after reconnect. * test(ui): align offline chat fixtures with context ownership * fix(ui): retain chat controls until reconnect list arrives * test(ui): build reconnect fixture row directly * fix(ui): honor retained session presentation in chat Keep chat roster metadata and rename/reaction controls behind the session owner presentation fence while reconnect startup publishes provisional rows. Use the same paired presentation for history refreshes, preserving live loading/errors and scoped history. Cover descriptor and chat.startup publication before the canonical list, plus canonical archive behavior. Addresses the review finding on openclaw#178176. * test(ui): publish session owner state in chat fixtures
Align the generated-title fixture with openclaw#178176, which intentionally keeps header rename available while the same Gateway identity reconnects. Share the sidebar's queued-rename assertions with the header, including the optimistic title, exact target identity, and single reconnect replay. Keep the Sessions page disconnect behavior unchanged. The original header case passes on f88c469's parent and fails after it. Native focused proof: 8 tests passed. The unchanged cold-load case also passed five native runs, including the hourly head and concurrent load. Affected UI-e2e typecheck, scoped lint, format and P2 review passed.
What Problem This Solves
#177558 lets session renames, icon/color/category changes and reactions queue while the Gateway reconnects for the same client identity. In a real browser those controls were unreachable exactly when they should queue. As soon as the connection dropped, the chat header title stopped being a "Rename session" button ("Connect to the Gateway to change sessions.") and every reaction picker disappeared (20 Add reaction controls went to 0 on a ten-message chat).
Why It Happened
The session owner deliberately clears its live roster result on disconnect and keeps a same-identity retained presentation (including deferred metadata) for exactly this case (
ui/src/lib/sessions/index.ts). Chat copied the cleared live result intostate.sessionsResult, so the header lost its session row and the reaction renderer lost the data it gates on. The deferred admission inreadSessionMethodAccesswas never reached.Solution
Chat reads roster data and its paired agent identity exclusively from the session owner's presentation in both
chat-pane-context.tsandchat-state-refresh.ts. The owner mirrors live data normally and retains the complete roster across reconnect until the canonical-list revision advances, including when startup or descriptor reconciliation publishes provisional rows first. The header submit already routes throughsessions.patch, which reaches the existing deferred-intent owner, so no second queue or submit path was added. The owner still retires the presentation on identity change, offline-recovery retirement and stop, and the controls disappear with it.User Impact
On a flaky link you can rename the session from the chat header and react to messages while it reconnects. Both apply immediately, count in the footer status ("Reconnecting… · 1 queued") and reach the Gateway on reconnect. Sidebar rename and icon/color/category were already reachable and are unchanged. Category creation and lifecycle actions stay connection-gated.
Evidence
pnpm test ui/src/pages/chat/chat-pane-offline-metadata.test.ts ui/src/pages/chat/chat-pane-session-presentation.test.ts ui/src/pages/chat/chat-pane-reactions.test.ts ui/src/lib/sessions/session-offline-metadata.test.ts ui/src/pages/chat/components/chat-pane-header.test.tsx ui/src/app/app-shell-view.test.ts --maxWorkers=1: 6 files, 107 tests passed. The new render-level regression failed before the fix.pnpm tsgo:ui, oxfmt andgit diff --checkclean. Codex autoreview: scoped-clean.Before, while reconnecting (no rename button, no reaction picker):
After, rename while reconnecting (title applied, 1 queued):
After, reaction while reconnecting (applied, 1 queued):
Captures are synthetic (mock model, isolated state) and cropped to exclude avatars.
CI repair
The first CI run caught two fixture issues: the new regression assigned readonly context fields, and the approval-title test marked its pane connected while its Gateway fixture remained stopped. The fixtures now construct a fresh context and provide a connected Gateway respectively; production code and every assertion are unchanged.
--maxWorkers=1(130.73 seconds including two cold test shards).node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.ui-chat.json --noEmitpassed. Formatting andgit diff --checkpassed.Reconnect review follow-up
The inline review identified a second gap: hello marks the Gateway connected before the canonical session list returns. The initial follow-up retained presentation until a live result existed; the final repair below extends that to the owner canonical-list fence. A render-level regression holds the list request open, verifies rename and reaction controls after hello, then verifies the returned canonical title. It failed on the previous head at the missing rename-button assertion and passes with the fix.
The new connected rendering exposed an incomplete test response for
session.members.listEvidence; the fixture now provides its complete typed response. No assertions were removed or relaxed.--maxWorkers=1(59.25 seconds wall time across two test shards; the new delayed-list case took 52 ms).git diff --checkpassed.The final CI lint pass flagged
no-map-spreadin the delayed-list fixture. The fixture now builds its single canonical row directly, preserving the retained row and every assertion. Production behavior is unchanged by this lint correction.Final lint correction validation:
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/pages/chat/chat-pane-offline-metadata.test.ts, oxfmt, andgit diff --checkpassed; all 5 offline-metadata tests passed in 38.00 seconds wall time.Final presentation-fence repair
Commit 26e7fbe addresses the partial-publication review finding. Both chat copies now consume the owner presentation, so neither hello nor a non-null provisional result bypasses its canonical-list fence. Two regressions cover descriptor and startup publication before the canonical list; both failed before the fix. Canonical archive behavior is covered as well.
Coordinator-verified proof for this head: 8 files, 125 tests passed;
tsgo:ui, oxfmt, andgit diff --checkpassed. Fresh Codex autoreview was scoped-clean (patch is correct). The isolated-Gateway offline rename and reaction proof and sanitized screenshots above remain applicable.CI fixture repair on the final owner contract
CI run 39395855111 failed seven cases across four chat suites: retained presentation, approval requester titles, read markers, and composer settlement. These fixtures called the pane publication callback without updating their synthetic session owner. The real owner mirrors live state into presentation outside the reconnect fence. The fixtures now publish into that owner first; every original assertion remains, and the production fix is unchanged. The composer-settlement failure reproduced locally before the repair.
--maxWorkers=1, 77.13 seconds wall time across two local test shards.git diff --checkpassed.