Skip to content

fix(ios): keep conversation history visible during agent discovery - #198251

Merged
vyctorbrzezowski merged 4 commits into
mainfrom
openclaw/ios-draft-selection-acceptance
Nov 17, 2026
Merged

vyctorbrzezowski merged 4 commits into
mainfrom
openclaw/ios-draft-selection-acceptance

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #159404

What Problem This Solves

An already displayed conversation can become empty while iOS resolves its default agent or replaces a presentation alias with the same canonical conversation.

User Impact

Previously displayed replies remain visible during a verified same-conversation handoff. Unknown or different Gateway, account, agent, or conversation identities still clear the old display, and fresh empty history removes retained rows.

Why This Change Was Made

The iOS presenter verifies matching Gateway/account/ingress inputs. The transcript owner compares the canonical key and agent recorded by accepted history with the resolved destination. Only display rows survive; live authority, cursor, run ownership, outbox mappings, permissions and capabilities do not transfer. Drafts and durable outbox entries retain their existing owners. No schema, configuration, dependency, or animation change.

The maintainer integration preserves current main's asynchronous history decoding, synchronous foreground question expiry, run-scoped streaming retirement, local-send revision and attachment/question authority guards. Only the display handoff is added to those current owners.

Evidence

  • The current six-file integration (dcdd2de, based on main 53278c3) passed the iOS app build and all 4 ChatSendHydrationTests cases. The shared package passed 211 tests in 5 suites (245 expanded parameterized cases), covering transcript cache, outbox, agent navigation, input history and foreground/history handling. The package manifest was intact: no test exclusions or overlays.
  • Strict SwiftLint and configured SwiftFormat pass all 6 touched Swift files. A fresh independent P0–P2 review of the complete integration and owning source found no actionable issues. All 6 files in the tested native checkout match the current candidate byte-for-byte.
  • Earlier paired native iOS execution reproduced the visible alias handoff failure: the base clears the conversation to “Loading chat,” while the candidate retains the two displayed replies until replacement history arrives. A subsequent authoritative empty history clears both versions. These screenshots use synthetic conversation data.

Before / after: canonical-alias handoff

These captures are from base 0633f25 and the original candidate d240ab4 with the previously recorded mechanical repair. They are not new runtime captures of the integrated published head.

Before: alias handoff clears the displayed conversation

After: the same conversation remains visible while history is pending

Proof limits

Fresh late-agent/config launch hydration and a real different-owner runtime control were not completed; the owner and history tests cover those contracts. This PR does not claim scroll-position continuity across presenter replacement or CPU, memory, or latency improvements. It keeps transcript rows visible, not the separate reader-position state.

Contributor credit

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

Worked on by:
- @mikengyn
- @vyctorbrzezowski

Co-authored-by: mikengyn <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 0565032c-15bc-4f97-aaaf-9c91f4cefcfe
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserve displayed messages across verified same-conversation agent discovery and alias handoffs until authoritative history replaces them.

Example: The displayed conversation changes from main to agent:main:main while replacement history is pending.

  • Before: The saved exchange disappears and the app shows Loading chat.
  • After: The saved exchange remains visible, and a subsequent authoritative empty history clears it.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused implementation has no identified correctness defect and useful boundary coverage, but retained earlier media does not establish the integrated native behavior.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An already displayed conversation becomes blank while the app discovers its agent or resolves an equivalent conversation alias.
Reason: Maintainer direction is recorded, and preserving the current conversation during an equivalent route transition restores the existing continuity contract without adding user choices.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR provides a focused, maintainer-backed fix for conversation blanking that remains possible on current main; no actionable introduced defect was found.

Priority: P2
Reviewed head: dcdd2dedec3e352e29d2ebb9c36f70c58ff89d8d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide native screenshots, a recording, or redacted runtime output from the integrated candidate showing discovery or alias handoff retaining rows until fresh history replaces them, and report whether the new regressions fail on the base for the intended reason.
Agent review details

How this fits together

The iOS presenter replaces transport-backed shared chat models during agent discovery; the shared model reconciles Gateway history, cached display rows, and durable outbox messages for the native transcript.

flowchart TD
A[iOS agent discovery] --> B[Chat presentation owner]
B --> C[Gateway and account identity check]
C --> D[Shared transcript owner]
E[Accepted canonical identity] --> D
D --> F[Retained display rows]
G[Fresh Gateway history] --> D
F --> H[Native chat transcript]
D --> H
Loading

Technical review

Best possible solution:

Retain only verified same-conversation display rows through the existing transcript owner while fresh history restores live state and replaces the display.

Do we have a high-confidence way to reproduce the issue?

Current main visibly clears session-owned rows or replaces the presentation model during these transitions, and the inspected earlier native comparison demonstrates the resulting blank transcript.

Is this the best way to solve the issue?

The patch uses the existing presenter and transcript owners, preserves routing isolation, excludes outbox-owned rows from transfer, and lets authoritative empty history remove retained display.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6ba51132e323.

Provenance checked

  • iOS presentation replacement keeps the original intent (fix(ios): preserve first chat send during agent discovery #159404: Defer discovery while an accepted send settles, preserving its originating owner and optimistic row.)
  • Session-owned state reset changes intended behavior with a stated reason (443c582: Changing alias ownership must clear pending state before bootstrap; this PR explains why independently verified same-conversation display rows may survive while live state still resets.)
  • Cached transcript reconciliation keeps the original intent (5d8293c: Cached rows provide temporary display while Gateway history remains authoritative, including an empty response.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Avant: Raw commit 8043765 adds apps/ios/Sources/Chat/IOSChatViewModelOwner.swift:64 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 804376566a81; files: apps/ios/Sources/Chat/IOSChatViewModelOwner.swift)
  • Peter Steinberger: Raw commit 59c5087 adds apps/ios/Sources/Chat/IOSChatViewModelOwner.swift:70 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 59c50878f05b; files: apps/ios/Sources/Chat/IOSChatViewModelOwner.swift)
  • Marvinthebored: Raw commit e5f1a21 adds apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+TranscriptCache.swift:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e5f1a21c0b01; files: apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+TranscriptCache.swift)

PR surface

Source +65, Tests +294. Total +359 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 70 5 +65
Tests 2 302 8 +294
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 372 13 +359

Preflight source

Source 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

Metric Value Why it matters
Production versus test changes Production +70/-5 lines; tests +302/-8 lines Production growth records canonical display identity and reuses existing reset and reconciliation owners; tests cover distinct presenter, routing, isolation, and authoritative-empty-history boundaries.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit. Replaced prior rating: 🧂 unranked krab.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: Temporary conversation blanking during discovery or alias replacement is a bounded native-chat bug without established durable message loss.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit. Replaced prior rating: 🧂 unranked krab.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-13T12:11:32.594Z sha d240ab4 :: needs maintainer review before merge. :: none

Reviewed November 16, 2026, 10:07 PM ET / November 17, 2026, 03:07 UTC (Revision 2).

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review November 14, 2026 19:35
@vyctorbrzezowski

Copy link
Copy Markdown
Member

Maintainer integration updated against current main, preserving the newer streaming, send, outbox and authority owners. The iOS app builds; all 4 ChatSendHydrationTests cases and 211 shared tests across 5 suites pass. The shared package manifest was intact, with no exclusions or overlays. All six tested source files match dcdd2de byte-for-byte; strict lint/format and a fresh independent review pass.

The description now separates this integration's test results from the retained earlier native before/after captures and their disclosed runtime limits.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) November 17, 2026 03:05
@vyctorbrzezowski
vyctorbrzezowski merged commit 2014d1a into main Nov 17, 2026
82 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the openclaw/ios-draft-selection-acceptance branch November 17, 2026 03:22
@vyctorbrzezowski

Copy link
Copy Markdown
Member

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…penclaw#198251)

* fix(ios): keep conversation history visible during agent discovery

Worked on by:
- @mikengyn
- @vyctorbrzezowski

Co-authored-by: mikengyn <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 0565032c-15bc-4f97-aaaf-9c91f4cefcfe

* fix(ios): preserve current history owners during display handoff

* test(ios): format transcript hydration coverage

---------

Co-authored-by: mikengyn <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants