Repository navigation
fix(ios): allow reading chat history before startup finishes - #198244
roboclaw-bot wants to merge 16 commits into
Conversation
Worked on by: - @mikengyn - @vyctorbrzezowski Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: cb9361af-698e-4708-9a35-38f4a88703a8
|
🦞👀 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 changes before merge. What this changesThis PR layers early native-history reading onto a pinned iOS transcript and scrolling repair. Example: Open session main containing “Saved question” while the model catalog request remains pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this maintainer-authored PR addresses a current startup-reading problem, but its inherited streamed-list changes contain a concrete rendering regression. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Apple chat model accepts cached or Gateway history, and the native chat view turns it into transcript rows, initial positioning, follow behavior, and navigation controls. flowchart TD
A[Gateway history] --> C[Chat view model]
B[Offline transcript cache] --> C
C --> D[Accepted history readiness]
C --> E[Remaining startup requests]
D --> F[Native transcript reader]
F --> G[Positioning and scroll navigation]
Technical reviewBest possible solution: Keep the readiness change at the existing history/view owners, preserve nested fence completion during streaming, and land the dependent transcript repair separately. Do we have a high-confidence way to reproduce the issue? Current-main source shows accepted history arriving before optional startup completes while reader admission remains tied to isLoading; no target code was executed during this read-only review. Is this the best way to solve the issue? Using accepted-history facts for reader readiness is a focused solution that preserves bootstrap and send ownership; the inherited list renderer must also preserve incomplete-code semantics. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c0a4b4bf6496. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1098, Tests +659. Total +1757 across 35 files. Added test files: 5. 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. Review metrics
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:05 AM ET / 12:05 UTC. |
Related: #192232
Depends on #192232 at
7618f4311be932aadf7a06d18e28fbfe806c407d. This is a separate follow-up on that pinned head.What Problem This Solves
Fixes: opening a native chat keeps initial reader positioning and scroll-follow release tied to the rest of startup even after its cached or live history is available.
User Impact
Users can begin reading and navigating accepted history without waiting for session metadata and model-list startup to finish. Grouped replies, sidebar animation, word fade, and Send/Talk admission are unchanged. This draft still needs exact-head Mac/iOS build, scrolling, and before/after visual proof; no measured speedup is claimed.
Why This Change Was Made
The existing history owner already records accepted live history and cache pre-paint. The transcript now consumes that fact for its one-shot initial position, loading overlay, and jump-to-latest availability instead of using whole-bootstrap completion. Session/model replacement resets the one-shot anchor even when SwiftUI coalesces readiness updates. A separate completed-load fallback preserves reading of restored outbox rows when history fails; an already-settled replacement uses the existing bootstrap task to distinguish an attempted load from unstarted idle. The shared macOS reader no longer repeatedly restores the initial anchor while optional startup runs.
Bootstrap work is neither deleted nor reordered: branch reconciliation, outbox recovery, subscription, health, metadata, mark-read, model availability, and permission guards retain their owners.
isLoadingand the existing empty-state/error/intro loading gates remain unchanged. The blocking full-chrome spinner is limited to the period before readable history exists; accepted history remains readable during a refresh. No cache or parallel startup task is added.Evidence
bootstrapapplies history, then awaits branches, health, the 50-row session refresh, mark-read, and models before its defer clearsisLoading. The reader previously used that same flag to establish its initial anchor and admit scroll-phase handling.git diff --check: passed. Source inspection and simplify pass completed. Production delta: +40/-15 lines (net +25); regression delta: +363/-1 (net +362). Swift tests are outside the repository's JavaScript/TypeScript test-line ratchet.load()gate regressions: delayed sessions/models, empty history, active-stream ownership/send blocking, stale bootstrap after session/alias-route change, detachment during history, and history error with actual SQLite-restored outbox rows. Existing cache-to-live regression now checks early reader readiness. An iOS-only hostedOpenClawChatViewregression covers failed-load positioning/follow release and settled same-key failed model replacement, using rendered-state signals and scroll observation. No test-only production seam or real sleep was added.openclaw,openai/gpt-6.1-sol) reportedscoped-clean, zero remaining findings, with intact view/load/history/cache/outbox/web/scroll owners and relevant fixtures. This is static review, not a native test result.Acceptance rule for the Mac proof loop
Use the exact pinned base and exact candidate commit with the same synthetic history and device. Separate cold open, cached reopen, and active-stream open. In the deterministic gated owner tests, accepted history must be readable before the sessions/models gate opens while bootstrap and metadata/send guards remain in their original states. In the actual UI, initial positioning must settle before optional startup completes; scrolling away must release follow, and optional completion must not snap back. Session/route switches must show only their own content; retry after an error must anchor when history first succeeds.
Record at least five interleaved baseline/candidate samples per cold/warm scenario: time to first correct anchor and successful scroll-away, median/p95/spread, host load, RPC counts, main-thread work, total CPU, memory, and frame hitches. Expect unchanged RPC counts and no added work/caches; a slower optional RPC must no longer extend reader readiness. Do not claim a performance win or mark ready without the table and exact-head native proof. A 20% regression in a user-facing metric stops the change for investigation.
Contributor credit
Requested by Vyctor Brzezowski, with the requested co-author credit to
vyctorbrzezowskiandmikengyn.Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by