Repository navigation
feat(macos): show the web conversation in native chat windows - #159946
Conversation
Keep native outbox work draining for unselected sessions and retain send exclusion until the retiring web document commits about:blank or terminates. Bind opening drafts to their source conversation and preserve native focus during background readiness. Keep the pane visible through bounded navigation, reconcile failed selections with the web's settled state, defer sidebar updates beyond table callbacks, and remove duplicate native title chrome. Add opt-in bridge metadata tracing with OPENCLAW_DEBUG_CONVERSATION_BRIDGE=1.
Retain web route and state reports during asynchronous reservations. Recheck the latest reported context after each await, reserve it before selecting it, and let newer routes supersede both success and failure of an older attempt. Read the bridge's current state when publishing the admitted route. Keep native navigation and document retirement fences, without echoing web routes back into the page. Cover B-to-C handoff during a paused reservation for both admitted and refused B outcomes.
|
🦞👀 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. Reviewed September 28, 2026, 5:10 AM ET / 09:10 UTC (Revision 8). ClawSweeper reviewWhat this changesThe macOS app embeds the Gateway-served web conversation inside native chat windows, coordinates navigation and sending with the native shell, and retains a Swift fallback. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: current main has the web conversation surface, but the native-window integration remains unique. The earlier renderer-default and route-admission concerns were explicitly dispositioned; an existing-profile upgrade run remains the concrete merge evidence gap. Priority: P2 Review scores
Verification
How this fits togetherA native Mac chat window receives a selected Gateway session from its sidebar. Its conversation area then uses either the Gateway-served web pane or the Swift fallback, and sends messages through the corresponding chat path. flowchart LR
A[Native sidebar] --> B[Selected Gateway session]
B --> C[Draft and outbox check]
C --> D{Web pane available?}
D -->|Yes| E[Control UI conversation]
D -->|No| F[Swift conversation]
E --> G[Gateway chat]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceDocs +32, Other +3174. Total +3206 across 53 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use one Control UI conversation owner inside the native window, retain the Swift fallback, and handle the deferred web pre-send admission contract as a focused follow-up. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR. Current main's Mac guide and source establish the existing Swift conversation path, while the inspected screenshots show the proposed renderer difference. Is this the best way to solve the issue? Yes: reusing the Gateway's Control UI conversation within the native shell addresses renderer parity at one owner, with a Swift fallback for unavailable pages and pending native work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c07906d5fa37. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
…versation handoffs
|
Review disposition: reject "secure destination ownership before acknowledging web navigation" for this change. When the web pane reports Follow-up noted: add a contract in which the web pane waits for native admission before enabling send after a web-originated route change. No code change for this finding is included here. |
|
ClawSweeper follow-up for 403d6b6:
The renderer default in the experimental Native experience is the intended feature of this PR. No settings/schema migration is added. The coordinator supplied live pane/titlebar/bridge smoke on the preceding reviewed head; a separate existing-preferences upgrade run and live final-send traces have not been captured. Those proof requests are recorded as remaining limitations rather than claimed as completed. Local proof for this follow-up: 82 conversation/outbox tests and 108 attachment/identity tests passed, along with both app builds, native test-bundle compilation, Swift lint/format, localization verification, and 61 i18n script tests. The new socket-boundary Mac tests compile locally and are left for hosted execution under the operator's compile-only restriction. Codex autoreview through P2: scoped-clean, with no accepted/actionable findings. CI run https://github.com/openclaw/openclaw/actions/runs/36381064545 failed in |
|
Exact-head CI update for The macOS test and package lanes are green in https://github.com/openclaw/openclaw/actions/runs/36393462911. The native artifact records 2,308 main-suite tests plus six named-profile and two rendered tests passing, including the titlebar refresh, independent sends, all three native send-fence paths, and the restored-toolbar layout regression. iOS smoke and iPhone screenshots also passed. The remaining failure is the iPad Settings screenshot startup check: Treating this first observed hosted readiness failure as a transient candidate, I am rerunning failed jobs once on the same head. The failure remains recorded; no assertion, timeout, baseline, or product code is changed to make it pass. A passing replay alone will not be described as a root-cause repair. |
|
Remaining ClawSweeper policy dispositions for The pre-send web admission handshake remains deferred by the coordinator’s explicit decision, as recorded in #159946 (comment). No handshake or draft-storage migration is added here. The approved parity campaign intentionally changes the conversation detail inside existing Native experience windows to the shared web renderer. The native shell, sidebar, menus, and Gateway selection remain native. Preserving the old Swift renderer as an upgrade default would change that approved behavior, so that proposed change is rejected for this PR. The User Impact section now states the existing-installation behavior explicitly; native drafts, pinned attachments, pending outbox work, and unsupported Gateway pages retain the Swift path. Hosted Mac CI now passes on this head, including the titlebar refresh, independent sends, native-send exclusion, and web/native layout regressions (2,308 main-suite, six named-profile, and two rendered tests). The optional rank-up requests for additional live web-send/final-Gateway-effect traces and an existing-preference upgrade recording remain documented proof gaps; no such capture is claimed. The coordinator supplied the inspected rendering proof and live pane/bridge smoke. The one iPad readiness rerun is still a required CI gate before landing. |
|
Land-ready validation for Hosted native proof includes 2,308 main-suite tests, six named-profile tests, and two rendered tests. The Dashboard refresh, independent-send, native-send exclusion, and web/native titlebar/layout regressions all pass. Local app builds, native test compilation, 82 conversation/outbox tests, 108 attachment/identity tests, Swift lint/format, localization verification, and 61 i18n script tests passed; exact commands and wall times are in the body. Independent Codex autoreviews are scoped-clean through P2. The current-head ClawSweeper review is completed. Accepted implementation findings are fixed; the already-deferred admission handshake, approved renderer default, and additional live-send/upgrade proof gaps are explicitly dispositioned in #159946 (comment). The inspected before/after images and coordinator live smoke are in the body, and the titlebar companion #159932 is merged. Continuing through native preparation and pinned merge admission. |
|
Merged via squash.
|
…aw#159946) * refactor(macos): extract the Control UI document host from the Dashboard * feat(macos): show the web conversation in native chat windows * fix(macos): preserve web conversation state during navigation Keep native outbox work draining for unselected sessions and retain send exclusion until the retiring web document commits about:blank or terminates. Bind opening drafts to their source conversation and preserve native focus during background readiness. Keep the pane visible through bounded navigation, reconcile failed selections with the web's settled state, defer sidebar updates beyond table callbacks, and remove duplicate native title chrome. Add opt-in bridge metadata tracing with OPENCLAW_DEBUG_CONVERSATION_BRIDGE=1. * fix(macos): reconcile the latest web conversation route Retain web route and state reports during asynchronous reservations. Recheck the latest reported context after each await, reserve it before selecting it, and let newer routes supersede both success and failure of an older attempt. Read the bridge's current state when publishing the admitted route. Keep native navigation and document retirement fences, without echoing web routes back into the page. Cover B-to-C handoff during a paused reservation for both admitted and refused B outcomes. * fix(macos): unify the web conversation titlebar * refactor(macos): simplify conversation browser-store selection * fix(macos): keep native drafts and Dashboard titlebar through web conversation handoffs * fix(macos): preserve independent sends and web-route drafts * test(macos): wait for the hosted conversation detail * test(macos): wait for complete native toolbar restoration
What Problem This Solves
The macOS chat window renders conversations with the native Swift transcript and composer, which trail the web Control UI on nearly every rich surface: Mermaid and wide tables overflow their bubbles, paragraphs merge, and inline cards, message actions, side panels, slash commands, queue/steer, find, and export are missing or different. Keeping two renderers and two send pipelines at parity is not converging.
Why This Change Was Made
Native chat windows keep their native shell: sidebar roster, ⌘K palette, toolbar, menus, windows, and Gateway handling. The detail area now hosts the Gateway-served Control UI conversation pane (header, transcript, composer, side panels) in a WKWebView, the same surface the Dashboard already trusts.
DashboardWindowControllerintoControlUIDocumentHost, which both windows now use.NativeConversationBridge, contract types in OpenClawKitNativeConversationContract): injectssurface: "conversation", binds every message to the web document id (stale documents, reloads, and process termination cancel pending requests), and speaks the small command set the web side landed in feat(ui): add a native conversation surface for the macOS app #159739:navigate,presentation, andfocus-composerfrom native;ready,state,route-changed,open-dashboard, andcommand-resultfrom web.ChatSendOwnership,ChatWebConversation): sessions shown in the web pane get no full-window native history load, message subscription, read acknowledgement, or send. Sessions with pending native outbox work stay on the Swift view until drained. Sidebar, palette, and New Thread selection switch the pane in place vianavigatewithout reloading; web-originated moves (forks, session links) update the sidebar viaroute-changed, and the latest route wins when moves overlap.OPENCLAW_DEBUG_CONVERSATION_BRIDGE=1logs bridge traffic for diagnosis.Production growth is mostly the bridge, the web-mode view, and the ownership rules; the Dashboard shrinks by the extracted host. Web-side presentation of the titlebar row landed in #159932 as
b3b74485057018b090b9b76a809b53a59cffd6f0; the merge dependency is satisfied.Review follow-up: independent Quick Chat and Talk Mode sends continue through the shared Gateway connection; renderer exclusion is owned only by the full-window native conversation transport. Web-originated navigation inspects the destination's saved native draft before reserving web ownership, so a restored draft remains visible in the Swift fallback. The deferred web admission handshake is tracked in the review disposition comment.
Screenshots
Before: native Swift transcript on main. The diagram overflows into the message header and paragraphs merge.
After: the same kind of thread in the web conversation pane, reached by clicking it in the native sidebar, with one titlebar row.
Evidence
Coordinator live rig before the review follow-up (dev Gateway serving the matching Control UI build, synthetic sessions): sidebar thread switch traced as
navigate → state (rev 12) → result ok → focus-composer okin one document, with no reload and no blank pane; one unified titlebar row. Existing inspected screenshots remain above. The coordinator also live-tested the rebased and fixed0b91904b99dd29c3c954a5046e52848f94929cdebuild: the web pane loads with the unified titlebar, and the bridge reportsready → adopted → presentation ok → state.Follow-up checks for
0b91904b99dd29c3c954a5046e52848f94929cde(wall times, all passed):swift build --package-path apps/macos --build-system native --product OpenClaw(40.93s),swift build --package-path apps/macos --build-system native --build-tests(24.02s), andswift build --package-path apps/macos --product OpenClaw(26.80s). macOS tests compiled only; neither the app nor the native suite was launched on the operator Mac.swift test --package-path apps/shared/OpenClawKit --filter 'NativeConversation|ChatViewModelOutbox': 81 tests passed (9.58s).swift test --package-path apps/shared/OpenClawKit --filter 'ChatFileAdmission|ChatFileAttachmentRequest|ChatMessageMediaAttachment|ChatComposerPasteSupport|ChatViewModelAttachment|GatewayAttachmentLimits|ChatGatewayAgentCatalog|ChatViewModelAgentNavigation|ChatViewModelSessionAction': 108 tests passed, comprising 90 Swift Testing cases and 18 XCTest cases (7.46s).The new
NativeConversationDraftTestscases,returning from web mode keeps a restored native draft after its outbox drainsandattachment staging keeps native ownership while a web pane is selected, both failed at the pending-native-work assertion on the pre-fix production code (23.21s wall including compilation). All four draft tests passed after the fix (45.04s wall including recompilation; 0.055s test execution). The new Dashboard smoke regression,dashboard refresh preserves titlebar chrome for the current endpoint and mount, compiled successfully. Its pre-fix evidence is source-level: refresh cleared all scripts without reinstalling host titlebar CSS. It was not executed under the macOS compile-only restriction.scripts/lint-swift.sh macos(0.58s),scripts/format-swift.sh macos(0.46s),pnpm native:i18n:verify(4.01s), andpnpm test test/scripts/native-app-i18n.test.ts test/scripts/apple-app-i18n.test.ts(61 tests, 41.46s) passed. No user-visible strings or translation memory changed in the follow-up.Codex autoreview through P2: the coordinator’s branch review supplied the accepted titlebar/draft findings above. Commit-scoped autoreview of
0b91904b99dd29c3c954a5046e52848f94929cdeis scoped-clean, with no accepted/actionable P0–P2 findings. The Dashboard runtime-proof limitation is recorded above.ClawSweeper follow-up
403d6b6eee5effd41713dee9d03995623280548d:swift build --package-path apps/macos --build-system native --product OpenClaw(107.65s),swift build --package-path apps/macos --build-system native --build-tests(43.98s), andswift build --package-path apps/macos --product OpenClaw(77.57s) passed. The same conversation/outbox filter above passed 82 tests (32.52s); the attachment/identity filter passed 108 tests (21.19s). Swift lint passed in 1.48s, format in 0.75s, native i18n verify in 5.00s, and the 61 i18n script tests in 86.30s.web links inspect the destination native draft before changing selectionfailed with the original current-input-only admission behavior, then all five draft tests passed with destination lookup (24.02s wall, 0.134s execution). The new Mac socket-boundary tests cover independent sends under a web claim and all three native conversation send paths; local proof is compilation only. Hosted execution remains required. Codex autoreview through P2 for this follow-up: scoped-clean, with no accepted/actionable findings.Hosted Mac run 36385613760 executed the native suite. The Dashboard titlebar-refresh regression passed (2.768s), independent chat sends under web ownership passed (0.015s), and all three full-window send paths retained their fence (27.306s). One separate layout test failed because it waited for an unrelated virtualized sidebar accessibility row. The test-only follow-up identifies and waits for its actual embedded detail view, retaining the geometry and toolbar assertions; The repair compiles with
swift build --package-path apps/macos --build-system native --build-tests(184.35s), passes focused formatting and diff checks, and has a scoped-clean Codex autoreview through P2. Hosted run 36390110337 passed that readiness check, then exposed a later native-menu assertion. The next test-only follow-up waits for both native title and action menu and uses the existing selector’s label-or-title rule. The original toolbar/geometry assertions and timeout remain unchanged. Test compilation passed (34.14s), formatting/diff checks passed, and Codex autoreview is scoped-clean through P2; Hosted macOS execution on932424e916f0bfd80617103b9d7c1aea63042bc0is green: 2,308 main-suite tests, six named-profile tests, and two rendered tests passed, including the restored-toolbar layout regression (4.271s). macOS packages, iOS smoke, and iPhone screenshots passed. The iPad Settings root-readiness failure is retained in the CI disposition comment; its single unchanged-head failed-jobs rerun passed. Exact-head CI 36393462911, attempt 2 andopenclaw/ci-gateare green on932424e916f0bfd80617103b9d7c1aea63042bc0.User Impact
macOS users on a current Gateway get the full web conversation experience inside the native window; older Gateways keep the Swift chat unchanged. Existing installations that selected Native experience retain the native shell and receive the web conversation detail by default; this renderer transition is intentional for the approved parity campaign. Native drafts, pinned attachments, and pending outbox work retain their Swift owner until resolved. The developer comparison override remains available. No config, protocol, or schema changes.