Repository navigation
fix(ios): avoid blocking chat while decoding history - #198247
Conversation
Worked on by: - @mikengyn - @vyctorbrzezowski Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 92bb54d2-9e4b-401d-b46f-3f85563a4bb7
|
🦞👀 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 changesMoves native chat history decoding off the main actor on top of a stacked iOS transcript repair. Example: Open a native conversation containing 1,000 history rows.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this maintainer-authored draft open: current main still performs history-row conversion on the main actor, and this PR explicitly depends on an unmerged transcript repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Apple chat model receives Gateway history pages, converts and reconciles their messages, and publishes transcript state consumed by native chat views. flowchart LR
Gateway[Gateway history page] --> Owner[History refresh owner]
Owner --> Decode[Concurrent row decoding]
Decode --> Prepare[Main actor preparation]
Prepare --> Merge[Cursor and transcript reconciliation]
Merge --> View[Native chat transcript]
Technical reviewBest possible solution: Land the transcript dependency with its remaining fence repair, then retain the focused concurrent decoder and prepared-row publication in the existing history owner. Do we have a high-confidence way to reproduce the issue? Source confirms synchronous per-row JSON conversion on the MainActor-isolated current-main model; no runtime reproduction establishes the size or frequency of visible pauses. Is this the best way to solve the issue? The decoding-only commit follows the existing owner, avoids a detached task or new cache, and preserves synchronous publication after revalidation; its measured benefit remains to be established. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d5d77e181a2e. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1110, Tests +353. Total +1463 across 41 files. Added test files: 3. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label 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 Reviewed November 13, 2026, 7:08 AM ET / 12:08 UTC. |
|
Merged the narrowed history-decoding change after 541 targeted Swift tests and green current-head CI. The final merge contains only the 12 history source/test files; it does not include the separate transcript-reader changes. The scope and limits of the native performance evidence remain documented above. Thanks @mikengyn for the contribution. |
Decode native history rows away from MainActor while preserving cursor admission, cancellation, reconciliation and outbox confirmation. Retain only this PR's history-decoding changes; no transcript-reader feature is included. Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]>
What problem this solves
Native chat converted every raw history row to its typed representation on the main actor. Large history loads competed with interaction, and visible outbox confirmation decoded the same canonical page twice.
What changes
Move typed row conversion into the existing structured concurrent decoding phase. Keep reconciliation and ingestion on their existing actor, with the same post-await cancellation, route generation, request-order and cursor checks. Reuse the decoded canonical page during visible outbox confirmation. No cache, detached task, schema or layout change is added.
The branch originally included #192232. A linear corrective commit removes that unrelated rendering work from the final diff: only the three history/transport production files and their directly affected tests remain. Historical commits are retained, but the squash does not include the parent feature.
Validation
5df28e77efearetains the landed question-expiry repair, Markdown cache and streaming-display clearing behavior. The resulting diff has 12 files.No claim of improved global CPU, memory, frame rate or load-to-display latency is made. Ingestion and the separate Watch preview remain on their existing paths.
Contributor credit: @vyctorbrzezowski and @mikengyn.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by