Repository navigation
fix(ui): avoid recapturing chat drafts during UI updates - #146884
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 13, 2026, 7:21 AM ET / 11:21 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Control UI prepares chat draft recovery snapshots only when restoration is admitted, while preserving edits made during storage loading. Merge readiness✅ Ready for maintainer review Keep open: current main still performs the redundant snapshot work, and this focused patch preserves restore ordering without introducing a blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI’s composer persistence connects chat edits and UI updates to browser draft storage. Its restore owner checks session scope and draft revisions before applying saved content. flowchart TD
A[Chat edits and UI updates] --> B[Composer persistence]
B --> C{Restore already admitted?}
C -->|Yes| D[Skip snapshot preparation]
C -->|No| E[Capture current draft synchronously]
E --> F[Read browser draft storage]
F --> G{Scope and edit still current?}
G -->|Yes| H[Reconcile saved and current draft]
G -->|No| D
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +11, Tests +216. Total +227 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep restore admission in the existing persistence owner and capture its baseline synchronously only when a restore will actually start. Do we have a high-confidence way to reproduce the issue? Yes, from source: repeated UI invalidations reach snapshot preparation before the current-main restore guard. The PR reports a failing original-owner regression; this review did not execute tests. Is this the best way to solve the issue? Yes. Moving preparation behind the existing admission guard removes redundant work while retaining synchronous baseline capture and the established restore checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 32bf352734f0. 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)
|
cd140d6 to
041ca72
Compare
|
Merged via squash.
|
* temp/pr-146799: (70 commits) test: reuse explicit fallback config fixtures (openclaw#146948) fix(computer): return fresh window observations after actions (openclaw#146822) refactor(feishu): remove unreachable requester topic selection (openclaw#146904) improve(gateway): reduce CPU spent listing agent-owned sessions (openclaw#137745) fix(ui): avoid recapturing chat drafts during UI updates (openclaw#146884) fix(ui): show system uptime in the debug overlay (openclaw#146960) fix(retry): honor waits beyond the native timer limit (openclaw#145718) fix(ui): keep chat history idle when run status changes (openclaw#146802) fix(ui): reuse persisted text during chat streaming (openclaw#146831) refactor(qa): share harness drift result construction (openclaw#146903) test(agents): coordinate settings lock contention (openclaw#146949) fix(worker): avoid repeatedly serializing screenshot history (openclaw#146907) fix(secrets): stop buffered upload writes after cancellation (openclaw#146840) perf(doctor): avoid unnecessary state runtime imports (openclaw#146926) improve: reduce compaction request estimation work (openclaw#146961) fix(ci): wait for forwarded avatar imports before assertions (openclaw#146729) perf(workers): skip configured Git author lookups (openclaw#146833) fix: admit borrowed memory writes through the agent database owner (openclaw#146760) fix(discord): prevent voice playback gaps and stale turn controls (openclaw#146798) improve: reduce worktree filesystem stalls and archive syncs (openclaw#146906) ...
* commit 'ccfd2377cd07d1ad3a583ba64d08e29a065f7061': (1587 commits) fix(ui): avoid recapturing chat drafts during UI updates (#146884) fix(ui): show system uptime in the debug overlay (#146960) fix(retry): honor waits beyond the native timer limit (#145718) fix(ui): keep chat history idle when run status changes (#146802) fix(ui): reuse persisted text during chat streaming (#146831) refactor(qa): share harness drift result construction (#146903) test(agents): coordinate settings lock contention (#146949) fix(worker): avoid repeatedly serializing screenshot history (#146907) fix(secrets): stop buffered upload writes after cancellation (#146840) perf(doctor): avoid unnecessary state runtime imports (#146926) improve: reduce compaction request estimation work (#146961) fix(ci): wait for forwarded avatar imports before assertions (#146729) perf(workers): skip configured Git author lookups (#146833) fix: admit borrowed memory writes through the agent database owner (#146760) fix(discord): prevent voice playback gaps and stale turn controls (#146798) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) ... # Conflicts: # test/tsconfig/tsconfig.core.test.agents-other.json # test/tsconfig/tsconfig.core.test.agents-root.json
What Problem This Solves
Fixes: ordinary chat UI updates repeatedly prepare a draft recovery snapshot even after restoration has already been admitted for that session.
User Impact
The composer avoids redundant snapshot work during UI updates. Draft restoration still protects edits made while stored content is loading. No configuration or migration is required.
Why This Change Was Made
The existing restoration owner checks whether the scope needs restoration before requesting snapshot preparation. Preparation remains synchronous, before admission state changes or storage yields, and captures the snapshot used when the current draft wins. Scope, generation, revision, and ownership checks stay in their existing owner.
Production changes: +38/-27 (net +11), to move preparation behind the single admission boundary without weakening recovery ordering. Tests: +216.
Evidence
041ca72b8d80ed348e43085f1487bdbc18e5d600preserves the tested patch onf513c0f345f7f2514c49ccfbc00adc3f78b9a755, which includes the canonical CI guard and file-tab test repairs.