Skip to content

refactor(apple): deslop shared Swift and macOS fourth pass - #160710

Merged
steipete merged 4 commits into
mainfrom
deslop/l146-apple4
Sep 29, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l146-apple4

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fourth-pass cleanup of shared Swift and macOS code after the previous Apple sweeps. Repeated projections, pass-through layers, duplicate types and unused state obscured the owners of existing behavior.

User Impact

Existing layouts/styles, Gateway wire formats, pairing/authentication, Keychain handling, execution approvals, permissions, persisted keys, signing and update settings remain unchanged.

Fixes found along the way

  • A macOS file picker or delayed drop could complete after a conversation switch and attach its files to the newly selected conversation. Both callbacks now retain the existing session-bound attachment owner.
  • A retained link preview could show metadata or an image from an earlier URL. The model retires URL identity before deciding whether to fetch and rejects obsolete completions, including rapid URL reuse. The container owns loading tasks; its production content view synchronously scopes metadata/images to the rendered URL, preserving expansion and styles.

Why This Change Was Made

  • Remove the state-free message-body and streaming equality wrappers while keeping the same view/modifier order and equality fields; remove unread media and diff-stat inputs.
  • Share normalized chat identifiers, preference request/state types, optional settings decoding and transcript filename preparation; remove unused outbox bookkeeping.
  • Reuse shared session targets, connection enums and screen commands/record parameters instead of maintaining local copies.
  • Keep request-descriptor projection with GatewayConnection and stateless file-panel construction with the existing document host; remove forwarding properties and redundant testing accessors while retaining their assertions.
  • Reuse canonical subprocess environment conversion, executable lookup and Core Audio scalar reads; simplify voice tokenization, MLX construction/teardown and single-use callbacks.
  • Retain the existing queued-action record during execution instead of copying its identity, generation, scope and cancellation state into parallel optionals.
  • Normalize approval entries once and combine identical explicit-approval cases while preserving every policy and live-authority check.
  • Remove unused service-result projections, autostart/parser forwards and duplicated bitmap encoding control flow.

No dependency, configuration, schema, protocol-version, migration or retention change is introduced. The original Gateway label interpolation is retained because its source form owns an existing localization inventory identity.

Evidence

Measured change: 848 net production lines removed (543 added, 1,391 removed); 615 net lines removed including tests, across 111 files. This is below the 1,000-line target after the full subtree sweep. The coverage appendix records all 244 production files over 200 lines, sorted by size, with a READ disposition. Reviewed #159778 and merged Apple PR name-only diffs since 2026-09-15 before selecting changes.

  • Shared package full proof: serial nice -n 10 swift build and swift test, two build jobs and Swift Testing width 2. The final rebased source passed 1,890 OpenClawKit tests in 155 suites, 16 NativeState tests in two suites, and 60 XCTest cases (two existing skips). Build: 197.49 seconds wall; full test command: 418.49 seconds wall including compilation; OpenClawKit test execution: 88.287 seconds.
  • Final preview regression: the retained production renderer's guard-disabled control fails both light/dark comparisons while retaining A's metadata/image; the guarded candidate passes. Rendering plus identity suites pass four test functions / 12 parameter cases in 0.402 seconds, 36.07 seconds wall including incremental build/startup. In exact-head CI, the rendering test passed in 4.299 seconds (suite 4.333 seconds), the attachment suite in 6.818 seconds, and all 1,890 OpenClawKit tests in 34.379 seconds. Inspected synthetic before/after captures and precise proof boundary. Normal A frames remain byte-identical. Earlier attempts mounting loading tasks during capture were rejected because SwiftUI started those tasks inline; they are not counted as red proof.
  • Delayed-attachment regression: the original macOS picker/drop path attaches three synthetic files to the wrong conversation and fails three assertions. The session-bound callbacks pass. Earlier model-level preview controls fail nine assertions, then eleven after collapsed-state coverage; all final model cases pass. The earlier combined attachment/identity filter took 5.321 seconds of tests, 26.07 seconds wall.
  • macOS application: nice -n 10 swift build --package-path apps/macos --build-system native --product OpenClaw --jobs 2 --force-resolved-versions passed on the final preview source in 349.64 seconds wall and again after the requested rebase in 711.55 seconds wall. The Apple patch is byte-identical across that rebase.
  • Blacksmith Testbox final rebased proof: frozen install, verified source hashes, pinned SwiftLint 0.65.1 / SwiftFormat 0.63.0, node scripts/check-changed.mjs, pnpm protocol:check, pnpm native:i18n:verify (4,087 entries, changed=false), and all five import-boundary suites passed. Command: 319.65 seconds; boundary runner: four shards in 12.02 seconds. Lease tbx_01m3nhe1t1e9cawgmh07neyfz3 is stopped, as are all earlier lane leases.
  • Eight original synthetic before/after pairs cover standard, clean, onboarding, and attachment presentations in light/dark appearances; every pair is byte-identical. All 16 were inspected, delivered in chat, embedded below, and verified rendering in signed-in Chrome at 1640×1280. Four additional preview-transition images are in the linked proof comment and were also inspected/delivered in chat. All four load and render in signed-in Chrome at 840×480 source dimensions.

Independent Codex review of the complete cleanup and fresh review of the final preview boundary both have no actionable P0–P2 findings. Current-head ClawSweeper revision 7 also clears the preview finding and reports no actionable defect; its remaining automatic compatibility flags are dispositioned below. Current head: c5094477b5f54b37db654f52507119fac99501d6, based on 9b5b439dcb6e11b929c982d9b40e8ddcb4c9b2e5. The requested rebase is patch-identical. Main's generated model additions were read and preserved unchanged; they are not part of this PR's diff. Exact-head CI completed successfully, including macOS native app/shared-package tests, iOS smoke/screenshots, Android, security, and macOS Node lanes. All current checks pass; the PR remains open with auto-merge disabled. Prior-head CI 36505495608 passed, including 2,322 native tests / 272 suites, two rendered tests, six named-profile tests, shared packages, iOS smoke/screenshots, Android, and macOS Node lanes.

Compatibility: this PR changes no stored-data shape, persisted defaults key, config contract, wire format, schema, dependency, version, permission, migration, retention, signing, or update configuration. Canonical endpoint enum reuse preserves raw values. The original Gateway label interpolation remains because its source form owns an existing localization inventory identity. Hosted review's two compatibility checklist items come from unknown-truncated-pull-files; its technical review explicitly finds no stored-data contract change. Source verification confirms SourceSnapshot is an in-memory, non-Codable projection; it now consumes the existing AppState enums directly. Persisted enum raw values, config readers/writers, defaults keys and keychain identities remain unchanged. No migration is needed.

Relevant failures and repairs: native compilation caught two stale enum-conversion fixture calls, now direct typed values with assertions unchanged. First-head CI caught a redundant optional expression in the Talk waiter; the explicit unwrap retains its single cancellation owner and passes lint. The auth rebase retained the owners and checks introduced by #159860; a saved-profile reconnect fixture failed because notification-started work could leave its identity scope. The already-owned fix in #160763 merged and is included here; this PR does not duplicate it. The prior exact-head native suite subsequently passed that regression.

The isolated package's first full run lacked its repository TalkConfig fixture; adding the unchanged fixture repaired the harness. An unbounded run under extreme host load hit bootstrap/network/audio timeouts; the successful full run used the existing Swift Testing width flag, without changing assertions, timeouts, retries, or product configuration. This is not claimed as a flake repair. A remote snapshot refused one changing test file before execution; the stable snapshot and gates passed. Standalone strict SwiftLint reports existing file-size limits of 1,505 for GatewayConnection and 1,534 for DashboardManager; the existing repository GitHub CI policy reports those as warnings. No limits, baselines, or suppressions changed. Full macOS app tests run only on disposable CI, not the operator desktop. No workflow dispatch or job rerun was requested.

Synthetic before/after captures
State Before After
standard-light Before standard-light After standard-light
standard-dark Before standard-dark After standard-dark
clean-light Before clean-light After clean-light
clean-dark Before clean-dark After clean-dark
onboarding-light Before onboarding-light After onboarding-light
onboarding-dark Before onboarding-dark After onboarding-dark
attachments-light Before attachments-light After attachments-light
attachments-dark Before attachments-dark After attachments-dark
Full production coverage log (244 files over 200 lines)

Apple fourth-pass production coverage

Initial source: d9569745764fa53d540dbfe3a0b536975bc69a7d. All 631 initial Swift production files and four native C/Objective-C/Rust files were read, including the previous Apple sweeps. The three Swift auth owners added on main were subsequently read, as were the incoming changes through 9b5b439dcb6e11b929c982d9b40e8ddcb4c9b2e5. One obsolete Swift forwarding file was removed. The current subtree has 633 Swift and 4 other native production files.

This table uses current line counts and covers all 244 production files over 200 lines, sorted by size. Generated Gateway model review used exhaustive template/field inspection and complete non-template source and generator reads; later generated-field additions were read separately.

Lines Production file Status Simplification or preservation reason
32912 apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift READ PROTECTED; full generated-source coverage via 904 exact standard-template matches with every field/type/default/wire key read, plus delegated full 8539-line verbatim residual read; generator personally read. Preserve 4/4/3 versions, nominal aliases, explicit-null patches, shipped source APIs, literal/closed-union validation and unknown GatewayFrame round-trip.
1734 apps/macos/Sources/OpenClaw/GatewayConnection.swift READ Added descriptor request overload for server leases; exact string dispatch guards remain owner.
1680 apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayNodeSession.swift READ Route generations, invoke receipts, and awaited teardown are distinct ownership guards; public refresh overloads cite shipped contracts.
1664 apps/macos/Sources/OpenClaw/DashboardManager.swift READ Use direct TLS equality; preserve target-owned navigation, credential revisions and retained-window authority.
1644 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift READ Unified identical preference state/request types; removed never-populated outbox reconciliation state and cleanup; reused canonical model string normalization.
1641 apps/macos/Sources/OpenClaw/OnboardingAISetup.swift READ Route/auth attempt fences and ambiguous activation reconciliation protect active mutations; no safe further merge.
1637 apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayChannel.swift READ Handshake, socket epochs, and cancellation gates enforce authenticated transport ownership; prior consolidation retained.
1616 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer.swift READ Pinned delayed macOS picker and drop callbacks to existing session capture owner; preserved controls and rendering.
1612 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift READ Removed forwarding Equatable streaming-bubble wrapper at the only production caller.
1608 apps/macos/Sources/OpenClaw/AppState.swift READ Removed identity-only DEBUG test forwarders; retained injection and state-observation hooks.
1557 apps/shared/OpenClawKit/Sources/OpenClawKit/RealtimeTalkRelaySession.swift READ Replaced duplicate whitespace helper with the canonical trimmedNonEmpty implementation; lifecycle guards retained.
1552 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCache.swift READ queue transitions, cancellation proof lock, branch epochs, and cache ownership each enforce distinct durability contracts; no sound additional reduction.
1549 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+TransportEvents.swift READ Reused canonical string normalization for run and idempotency keys; removed explicit default nil message arguments; lifecycle and terminal ordering retained.
1513 apps/macos/Sources/OpenClaw/DashboardWindowController.swift READ Remove document-state and DEBUG forwarding accessors; use canonical document load owner and open-panel owner.
1509 apps/macos/Sources/OpenClaw/GatewayProcessManager.swift READ Removed ignored bundle path from launch requests and equality; lifecycle generations and PID ownership preserved.
1453 apps/macos/Sources/OpenClaw/WebChatSwiftUI.swift READ Use lease-guarded request descriptor overload; preserve route acquisition, ownership fences and native/web rendering.
1448 apps/macos/Sources/OpenClaw/NodeMode/MacNodeModeCoordinator.swift READ Reuse shared screen command enum; preserve route, capability, retry and TLS ownership.
1448 apps/macos/Sources/OpenClaw/TalkModeRuntime.swift READ Consolidated assistant-event task-group cancellation into defer; retained the explicit optional completion unwrap, generation checks and native speech fallback ownership.
1442 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTransport.swift READ Used existing unsupportedOperation owner for remaining duplicated NSError construction; public custom-transport forwarding/default contracts retained.
1390 apps/macos/Sources/OpenClaw/ApplicationRelocator.swift READ Active signed replacement and relocation owner; MenuBar authenticates handoff before instance admission, and volfs identity, CDHash, supervisor recovery, pipe readiness, and launch disposition checks protect the excluded signing/update contract.
1378 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMessageViews.swift READ Folded duplicate ChatMessageBody input layer into ChatMessageBubble; moved exact Equatable contract onto streaming bubble.
1310 apps/macos/Sources/OpenClaw/QuickChatModel.swift READ Replace duplicate QuickChatRoutingTarget with shared Hashable OpenClawChatSessionTarget; retain send and settings settlement policy.
1275 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+Outbox.swift READ Removed cleanup of never-populated reconciliation state and reused canonical idempotency normalization; FIFO and ambiguous delivery paths unchanged.
1230 apps/macos/Sources/OpenClaw/GatewayEndpointStore.swift READ Reused AppState mode/transport enums; removed identity test forwarders; represented warned credential kinds as a set.
1218 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatModels.swift READ tolerant historical decoding, wire aliases, explicit-null fields, and public initializers are retained contracts; reconstructive cache copies intentionally omit fields.
1201 apps/macos/Sources/OpenClaw/NodeMode/MacNodeCodexThreadCatalog.swift READ Retained bounded native config and RPC projections; sibling Codex thread protocol checked, no safe policy cutover.
1198 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMarkdownBlockSegmenter.swift READ CommonMark extraction preserves reference links, streaming boundaries and source ranges; no broad rewrite sound.
1148 apps/macos/Sources/OpenClaw/NodeMode/MacNodeClaudeSessionCatalog.swift READ Retained distinct discovery-cache, read-lease and backward byte-cursor contracts; third-pass cleanup already landed.
1095 apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayTLSPinning.swift READ TLS authority, first-use claims, Keychain migrations, and bounded body cancellation enforce separate protected contracts.
1040 apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntime.swift READ Reuse shared screen commands and record params with identical decoding defaults and wire fields.
1000 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+SessionActions.swift READ mutation paths differ in lease, optimistic rollback, branch reconciliation, and UI ownership; combining would obscure distinct contracts.
968 apps/macos/Sources/OpenClaw/ComputerWindowActionExecutor.swift READ Retained target-reference and authority checks; foreground and background delivery have different contracts.
952 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatQuestionCard.swift READ Question recovery authority, secret draft retirement and timer ownership retained unchanged.
923 apps/macos/Sources/OpenClaw/Onboarding.swift READ Pending record migration and per-attempt receipts have named persisted and authentication contracts.
921 apps/macos/Sources/OpenClaw/NodeMode/MacNodeHostWorker.swift READ Retained queue generations, process draining and RPC projection; no redundant owner found.
910 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessions.swift READ Unified duplicate entry/resolved CodingKeys and optional resolved decoding branch while preserving eager entry validation and fallback order.
899 apps/macos/Sources/OpenClaw/PostUpdate.swift READ Active post-update receipt and recovery owner called from MenuBar; duplicate-looking receipt copies preserve distinct notification-at-most-once and Gateway verification persistence boundaries under the excluded update/defaults contract.
896 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatLinkPreview.swift READ Scope rendered metadata/image and image tasks to the current URL; reset load identity and fence obsolete completions, preserving expansion and styling.
895 apps/macos/Sources/OpenClaw/DebugSettings.swift READ Distinct diagnostic actions and localized view trees; preserving visibility, state and layout.
860 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatInlineWidgetView.swift READ Capability route recovery, TLS pins and WebKit navigation ownership already centralized; hard contracts retained.
850 apps/macos/Sources/OpenClaw/QuickChatController.swift READ Remove write-only hostingView mirror; panel.contentView already owns view lifetime.
842 apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectionProblem.swift READ Centralized repeated AuthProblemDefaults nil/retry values; category dispatch retained for strict lint bounds.
836 apps/macos/Sources/OpenClaw/MacGatewayProfiles.swift READ Keychain registry, credential transition and browser-renewal owners intentionally differ; no safe simplification.
834 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ClientDatabases.swift READ cache recreation, durable state migration, and staged gateway erasure have separate recovery contracts; no schema/transaction/retention change warranted.
826 apps/macos/Sources/OpenClaw/OnboardingAISetupView.swift READ Provider/candidate presentation already shares row/card owners; distinct UI states and modifiers retained.
826 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+HistoryReconciliation.swift READ Removed three duplicate normalizers in favor of ChatPayloadDecoding; replaced manual stable dedupe accumulator with equivalent filter and insertion result.
821 apps/shared/OpenClawKit/Sources/OpenClawKit/WatchCommands.swift READ Shipped semantic/legacy Watch encoding retained; #158509 already rejected switch flattening due to strict SwiftLint complexity.
819 apps/macos/Sources/OpenClaw/OpenClawConfigFile.swift READ Config merge, auth preservation, forensic identity and migration gates have separate named contracts.
813 apps/macos/Sources/OpenClaw/TalkModeRuntime+Realtime.swift READ Removed single-use fallback guard closure and one-caller session-start injection; all lifecycle revalidation remains.
807 apps/macos/Sources/OpenClaw/PortGuardian.swift READ Exact process-generation receipts and per-signal revalidation are required ownership checks.
803 apps/macos/Sources/OpenClaw/ComputerScreenActionExecutor.swift READ Retained grapheme, held-button and display-frame boundaries; third-pass click mapping already shared.
800 apps/macos/Sources/OpenClaw/OnboardingView+Pages.swift READ Connection/CLI/page rendering and probe authority remain distinct; exact appearance/localization preserved.
797 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebar.swift READ view structure, accessibility, defaults keys, and navigation ownership retained to preserve exact rendering and persisted behavior.
794 apps/macos/Sources/OpenClaw/ControlChannel.swift READ One request outcome owner already owns status/recovery fencing; retained protocol event models.
786 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+Sending.swift READ Normalized slash query once for matching and skill filtering; removed duplicate draft restore already owned by restoreDraftAfterLiveSendFailure.
771 apps/macos/Sources/OpenClaw/OnboardingAISetupSupport.swift READ Provider result adapters and activation deadline checks encode independent wire/lease contracts.
771 apps/shared/OpenClawKit/Sources/OpenClawChatUI/OpenClawMascotAnimator.swift READ Distinct timed animation layers and seeded random schedule; preserving pose and interaction behavior.
764 apps/macos/Sources/OpenClaw/ExecCommandResolution.swift READ Retained distinct shell grammar, persistent grant and execution binding contracts; similar parser paths intentionally differ.
756 apps/macos/Sources/OpenClaw/VoiceWakeRuntime.swift READ Deleted four DEBUG forwarding seams; retained assertions on real helpers; removed normalized mic recheck and redundant capture literals.
755 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatGatewayRequest.swift READ Reused canonical trim helper; synthesized Hashable on existing immutable session target enables macOS duplicate routing type removal without normalization changes.
751 apps/shared/OpenClawKit/Sources/OpenClawNativeState/OpenClawNativeStateSQLite.swift READ Exact table admission, file-identity checks, synchronous transactions, and permission enforcement are protected storage invariants.
740 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebarModel.swift READ tree cycle handling, observer ordering, exact global ownership, and selected-row exemptions each protect distinct projection rules.
735 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMarkdownRenderer.swift READ Structural snapshot, streamed reveal and inline math pipelines have distinct retained semantics.
733 apps/macos/Sources/OpenClaw/ExecApprovalsStore.swift READ Removed repeated allowlist normalization and duplicate explicit-approval case; map agent values and deduplicate normalized entries directly.
719 apps/macos/Sources/OpenClawDiscovery/GatewayDiscoveryModel.swift READ Reuse the pure nonisolated SSH formatter at the macOS caller; wide-area and Serve loops retain distinct readiness/backoff ownership.
709 apps/macos/Sources/OpenClaw/CLIInstaller.swift READ Active CLI discovery, compatibility, installation, and update owner used by onboarding, startup, and repair; similarly named version helpers have different correction/prerelease semantics, and install policy/managed runtime behavior is protected.
707 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatToolDiff.swift READ Removed unread files count and redundant explicit initializer; added/removed projection unchanged.
704 apps/shared/OpenClawKit/Sources/OpenClawChatUI/OpenClawMascotView.swift READ Canonical vector geometry and per-channel transforms retained to keep exact rendering.
703 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionManagementViews.swift READ group mutations already share mutateGroups owner; inspector and new-session views carry distinct state and rendering.
702 apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift READ Uses shared CoreAudio UInt32 property reader; retained fail-closed output routing and delivery-generation guards.
700 apps/macos/Sources/OpenClaw/NodeMode/MacNodeCodexThreadCatalogClient.swift READ Retained request deadlines, source-home binding, restart fence and bounded stdout draining.
681 apps/macos/Sources/OpenClaw/StatusMenuSummaries.swift READ Usage cache/lease freshness and ordered submenu reconciliation each retain distinct lifecycle contracts; no safe further collapse.
680 apps/shared/OpenClawKit/Sources/OpenClawKit/DeviceIdentitySQLiteStore.swift READ Legacy claim acquisition/restoration and SQLite authoritative rereads protect key identity and migration recovery.
663 apps/macos/Sources/OpenClaw/NodePairingApprovalPrompter.swift READ Active node approval queue with source leases, stale-list invalidation, local-versus-remote outcome reconciliation, and SSH/local-node authorization; prior #159778 already removed the duplicate attempt wrapper and empty catch.
646 apps/macos/Sources/OpenClaw/WebChatManager.swift READ Use canonical lease-guarded request descriptor overload for subscriptions and visibility declarations.
622 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+ModelControls.swift READ Reused shared preference request state projection; eliminated split-and-rejoin of an unchanged qualified model identifier.
613 apps/shared/OpenClawKit/Sources/OpenClawKit/DeepLinks.swift READ Setup input, expired grants, encoded context paths, and fallback trust boundaries have distinct parser contracts.
601 apps/macos/Sources/OpenClaw/ComputerActionService.swift READ Keep current QueuedAction as one record instead of four separately copied mutable fields.
598 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatWindowShell.swift READ Native toolbar, web-host routing and persisted display preferences retained as hard contracts.
597 apps/macos/Sources/OpenClaw/TalkMLXSpeechSynthesizer.swift READ Unified shared construction with designated initializer and inlined one-caller unscoped transport teardown.
585 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatWorkingClawView.swift READ Keyframe tables encode distinct animation tracks; reducing tables would only reformat art data.
579 apps/shared/OpenClawKit/Sources/OpenClawChatUI/TalkWaveformView.swift READ Wave, radial and measured-envelope math encode different rendering contracts and share interpolation.
576 apps/shared/OpenClawKit/Sources/OpenClawKit/DeviceSettingsContract.swift READ Public bridge DTO initializers and explicit null encoders preserve cross-platform device-settings wire schema.
563 apps/macos/Sources/OpenClaw/StatusMenuRenderer.swift READ Prefix/suffix preservation and debug-menu positional reconciliation have different item-lifetime behavior; rendering untouched.
555 apps/macos/Sources/OpenClaw/CuaDriverHostCoordinator.swift READ Retained direct-child TCC ownership and post-await readiness/authority revalidation.
552 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatToolActivityViews.swift READ Equatable outer row intentionally gates expensive prepared diff initialization; display states centralized.
543 apps/shared/OpenClawKit/Sources/OpenClawChatUI/CleanChatComposerControls.swift READ Shared controls already centralize native platform surfaces and microphone ownership controls.
539 apps/macos/Sources/OpenClaw/CommandResolver.swift READ Replaced repeated ordered candidate construction with ordered lazy/path collections; same probing policy.
536 apps/macos/Sources/OpenClawMacCLI/ConfigureRemoteCommand.swift READ CLI validation and auth/default persistence differ from app parsing; unification would change acceptance.
532 apps/macos/Sources/OpenClaw/ExecApprovalsSocketPathGuard.swift READ Retained ancestor, symlink, ACL and inode checks at distinct filesystem boundaries.
524 apps/macos/Sources/OpenClaw/QuickChatWindowPicker.swift READ Capture generation, screen geometry and cancellation branches guard different suspension points; dependency enum adapter retained.
523 apps/shared/OpenClawKit/Sources/OpenClawKit/ExecApprovalsSQLiteStore.swift READ Canonical approvals projection, legacy migration, deletion fencing, and strict persisted validation are protected contracts.
520 apps/macos/Sources/OpenClaw/PairingApprovalPanelView.swift READ Active security grant presentation; elevated scopes, all command grants, platform mapping, grouped session capability rows, and snapshot-bound bulk actions each preserve required approval/UI rendering contracts.
520 apps/macos/Sources/OpenClawMacCLI/WizardCommand.swift READ Active interactive wizard client; protocol challenge, signed connect identity, option parsing and terminal echo restoration are distinct shipped CLI/auth contracts already reduced in pass three.
518 apps/shared/OpenClawKit/Sources/OpenClawKit/DeviceAuthStore.swift READ Scoped token keys, role migration and revoke-before-legacy-cleanup preserve auth custody.
513 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+SessionKeys.swift READ Reused canonical trim helper and deleted naming-only provider/model identity normalizers; alias and ownership matching unchanged.
510 apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift READ Generated projection of src/infra/host-env-security-policy.json consumed by HostEnvSanitizer; source-owned inherited and override policy sets must remain byte-equivalent and cannot be hand-edited.
505 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+ComposerCapabilities.swift READ One local current-mutation predicate replaces five identical fences; each pre/post-await check remains at its original boundary.
504 apps/macos/Sources/OpenClaw/NativeConversationView.swift READ Current document, generation and send ownership fences protect awaited route changes.
502 apps/shared/OpenClawKit/Sources/OpenClawChatUI/Swarm.swift READ Bounded event projections and route-leased refresh preserve session ownership and phase ordering.
499 apps/shared/OpenClawKit/Sources/OpenClawKit/WatchChatDelivery.swift READ Byte-exact delivery identities, bounded codec validation, and receipt outcomes are deliberate wire contracts.
497 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSheets.swift READ Selection, archive and scoped-fetch UI already use canonical session mutation owner.
497 apps/shared/OpenClawWatchRTC/src/lib.rs READ Full read; preserve repr(C) ABI, owned borrowed buffers, panic containment/engine retirement, fresh OS ICE entropy, pinned str0m ICE-lite/UDP/Opus admission, 100-endpoint budget and NAT64 candidate-attribute preservation. Traced serial WatchRealtimeTransport mutation/drain/copy ownership and pinned candidate formatter/budget source; no certain simplification remains.
495 apps/macos/Sources/OpenClaw/QuickChatView.swift READ Shared composer controls already canonical; exact view tree, accessibility and layout preserved.
493 apps/macos/Sources/OpenClaw/CameraPTZService.swift READ Retained axis planning, physical-write settlement and post-write readback; no duplicate policy owner.
489 apps/macos/Sources/OpenClaw/GatewayLaunchAgentManager.swift READ Removed ignored bundlePath parameter; CLI remains authoritative lifecycle command owner.
488 apps/shared/OpenClawKit/Sources/OpenClawKit/DeviceIdentity.swift READ Profile filenames, entitlement routing and key/PEM validation preserve signed identity and persistence.
487 apps/macos/Sources/OpenClaw/PortGuardianRecordStore.swift READ Shipped JSON ledger migration, live generation checks and SQLite receipt validation retained.
484 apps/macos/Sources/OpenClaw/OnboardingView+Layout.swift READ Page cursor, durable activation recovery and rendering own different transitions; prior-pass consolidation retained.
480 apps/macos/Sources/OpenClaw/ConnectionSettingsView.swift READ Distinct local/remote discovery, conflict and editor states; exact localized layout retained.
478 apps/macos/Sources/OpenClaw/MenuBar.swift READ Startup, replacement, updater and termination ownership preserved; no safe repeated flow remains.
478 apps/macos/Sources/OpenClaw/StatusMenuSessions.swift READ Session preview/menu construction and mutation prompts already use canonical owners; action-specific text and behavior retained.
474 apps/macos/Sources/OpenClaw/TailscaleIntegrationSection.swift READ Auth exposure settings, save snapshots and localized apply outcomes require distinct handling.
463 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCacheContracts.swift READ public read-only conformer defaults fail closed for scoped access; retry/branch contracts and persisted command fields retained.
460 apps/macos/Sources/OpenClaw/CloudWorkerHost.swift READ Signed cloud worker admission, process receipts, dedicated state roots and desktop revocation own separate platform/security lifecycle facts; no safe generic replacement.
456 apps/macos/Sources/OpenClaw/RemotePortTunnel.swift READ Removed test-only forwarding methods; tests now invoke the same internal SSH option and port-availability owners used by create/findPort, preserving all assertions and policies.
453 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+Attachments.swift READ owner checks around suspended file/image work and distinct media budgets retained; composer caller race delegated to chat_render owner.
452 apps/macos/Sources/OpenClaw/CLIInstallPrompter.swift READ Active startup/onboarding managed-runtime repair coordinator; persistent restart recovery, exact-versus-channel version ownership, and post-await Gateway selection checks belong to protected update/defaults contract.
452 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposerTextView.swift READ Native editor, pasteboard and key-routing boundaries preserve cursor/IME and file-first semantics.
450 apps/shared/OpenClawKit/Sources/OpenClawChatUI/WatchMessageJournal.swift READ Single transactional claim/settlement owner preserves delivery authority and durability; no safe deslop found.
444 apps/macos/Sources/OpenClaw/NativeConversationBridge.swift READ One completion operation now cancels timeout, traces result and resumes continuation for all three settlement paths.
443 apps/macos/Sources/OpenClaw/SessionMenuPreviewView.swift READ Cache, limiter and legacy preview/history fallback own different contracts; prior pass already removed projection duplication.
443 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+Thinking.swift READ Reused shared preference state/request types and existing string normalization; preference callback, rollback, and supported-level rules unchanged.
441 apps/macos/Sources/OpenClaw/ExecApprovalQueueStore.swift READ Retained lease-bound listing, event reconciliation and expiry ordering; third-pass projection already simplified.
437 apps/macos/Sources/OpenClaw/HealthStore.swift READ Third pass already consolidated health presentation; decode models/wire contract kept intact.
429 apps/shared/OpenClawKit/Sources/OpenClawChatUI/VoiceNoteRecorder.swift READ Permission, capture and attachment-handoff states have distinct lifecycle obligations; retained.
419 apps/macos/Sources/OpenClaw/QuickChatFocusedTextCapture.swift READ Prior pass owns bounded AX traversal and race arbitration; all bounds and cancellation outcomes remain meaningful.
409 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatModelSignIn.swift READ captured connection checks, cancellation retirement, and late admission cleanup are auth contracts; no safe structural removal.
397 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatCodeHighlighter.swift READ One tokenizer already serves all language descriptors; rendering colors and lexical behavior retained.
396 apps/macos/Sources/OpenClaw/StatusMenuController.swift READ Observation inputs, pointer routing and selected state mirrors drive distinct side effects; no safe redundant owner found.
395 apps/macos/Sources/OpenClaw/VoiceWakeTester.swift READ Removed mirrored debug-token type and one-use conversion wrapper; diagnostics now retain original wake-word segments.
394 apps/macos/Sources/OpenClaw/ExecApprovalsSocket.swift READ Retained tolerant legacy decision decoding and startup/shutdown generation fence.
390 apps/macos/Sources/OpenClaw/CritterStatusLabel+Behavior.swift READ Animation deadlines and celebration generations encode separate motion lifetimes; exact rendering preserved.
388 apps/macos/Sources/OpenClaw/PermissionManager.swift READ Canonical macOS TCC owner used by Dashboard, node advertising, and voice/capture flows; framework-specific rechecks and process-lifetime LocationPermissionRequester preserve distinct prompt, live-grant, and authorization semantics.
385 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer+CleanControls.swift READ Desktop/mobile composer controls have deliberately distinct labels and capability gates.
384 apps/macos/Sources/OpenClaw/RemoteTunnelManager.swift READ Actor generations, creation joins and retirement barriers protect every await; no redundant guards removed.
382 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatEffortControl.swift READ Gauge, slider and Fast control preserve separate interaction and accessibility contracts.
381 apps/macos/Sources/OpenClaw/DashboardNativeBrowserHost.swift READ Tab lookup, scope arbitration, download ownership and favicon generation have distinct contracts; no safe flow retirement.
379 apps/macos/Sources/OpenClaw/CritterIconRenderer.swift READ Geometry and CoreGraphics drawing encode exact mascot appearance; no substantive nonvisual simplification.
377 apps/macos/Sources/OpenClawCameraPTZNative/OpenClawCameraPTZNative.m READ Full read; preserve exact USB vendor/product/location selection, UVC descriptor bounds and bits 9/11, request encoding, full-transfer validation, IOKit resource cleanup and AVFoundation exclusive-access ownership. Prior #159031 already removed duplicate descriptor scanner; native Swift caller and descriptor/fresh-readback service tests retain actual platform boundary.
374 apps/macos/Sources/OpenClaw/VoicePushToTalk.swift READ No sound remaining reduction: distinct hotkey, speech-draining grace, session-token and recognizer handoff contracts.
374 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSourcePreviews.swift READ Canonical per-run citation projection preserves provenance, redirect ownership and cache lifecycle.
370 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatInputHistory.swift READ History reconciliation, recall occurrence tracking and accepted-send ownership cover distinct races.
370 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMediaAudioAttachment.swift READ Removed unused playback input; loader closure remains sole playback-mode owner.
369 apps/macos/Sources/OpenClaw/GatewaysMainMenu.swift READ Menu tracking, profile probes and pending window-open cleanup have distinct lifecycle ownership.
366 apps/macos/Sources/OpenClaw/CloudflareAccessLogin.swift READ Credential-transfer discovery, JWT shape checks, origin binding, helper HOME cleanup and current-attempt checks preserve protected auth boundaries.
365 apps/macos/Sources/OpenClaw/LocalSocketServer.swift READ Retained process reservation, cross-process lease, accepted-client drain and inode-owned cleanup.
361 apps/macos/Sources/OpenClaw/ShellExecutor.swift READ Reuse ManagedProcess.environment conversion; preserve file-backed and streaming output lifecycles.
360 apps/macos/Sources/OpenClaw/CookieSyncManager.swift READ Generation-bound process ownership, endpoint credentials, line draining and retry lifecycle are active and distinct; existing shared task/pipe owners already serve the flow.
352 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer+Capabilities.swift READ Capability menu branches retain distinct permissions and accessibility hints; no safe nonvisual consolidation.
347 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMediaVideoAttachment.swift READ Removed unused playback input; streaming and temporary-file player paths retain distinct lifecycle.
346 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSpeechController.swift READ Gateway speech fallback and local/audio completion ownership are distinct platform flows.
345 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMermaidRenderer.swift READ Cancellation, current-document authority and bounded rendering cache already have one owner.
343 apps/macos/Sources/OpenClawMacCLI/ConnectCommand.swift READ Collapsed identical option-loop index increments into the shared loop tail without changing flag/value precedence or parsing.
343 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatInlineMath.swift READ Bounded parser and bitmap caches guard SwiftMath dependency behavior and platform color resolution.
342 apps/macos/Sources/OpenClaw/GatewaySettings.swift READ Editor dismissal, Keychain save and removal flows retain distinct outcomes and exact rendering.
340 apps/macos/Sources/OpenClaw/DebugActions.swift READ Active menu/debug action adapters bind AppKit alerts and generation-safe recovery; port aliases and apparent forwarders have callers outside this shard and preserve action surface.
338 apps/macos/Sources/OpenClawDiscovery/TailscaleServeGatewayDiscovery.swift READ Bounded peer scheduling, executable lookup fallback and credential-free probe session each have different inputs from wide-area DNS discovery; preserving authentication and discovery behavior.
337 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView+Previews.swift READ Synthetic preview transport scenarios intentionally exercise separate rendered states; no runtime duplication.
336 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMermaidBlockView.swift READ Document/capture generation and source fallback preserve diagram ownership and platform behavior.
335 apps/macos/Sources/OpenClaw/CameraCaptureService.swift READ Retained shared pipeline use plus macOS-specific camera negotiation and delegate errors.
332 apps/macos/Sources/OpenClaw/BrowserProfileImportModel.swift READ Offer intent, availability refresh and import completion have distinct generation ownership.
329 apps/macos/Sources/OpenClaw/StatusMenuHeaderView.swift READ Operator status projection and capability controls already reuse native owners; keep exact view structure.
329 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMarkdownBlockViews.swift READ Code/math/table/list views retain distinct geometry, SwiftMath bridge and accessibility contracts.
326 apps/macos/Sources/OpenClaw/AudioInputDeviceObserver.swift READ Single selection projection replaces three constructors; canonical CoreAudio UInt32 reader serves input and output observers.
321 apps/macos/Sources/OpenClaw/GatewayEnvironment.swift READ Removed parser-only test seam and redundant gateway-label branching; retained the original label interpolation for localization identity.
320 apps/macos/Sources/OpenClaw/PairingApprovalCenter.swift READ Single shared node/device panel owner already consolidates presentation; rendered-card identity, source authority, snooze/presented sets, in-flight actions, and AppKit layout each protect distinct approval and focus invariants.
318 apps/macos/Sources/OpenClaw/MacDesktopAvailabilityCoordinator.swift READ Execution reservations, tombstones, revocation cleanup and idle assertions encode distinct live authority phases; merging them would weaken protected desktop lifecycle behavior.
316 apps/macos/Sources/OpenClaw/AppLifecycleSupport.swift READ Active instance inode lock and Sparkle updater owner; update channels, signatures, receipts, and persisted automatic update choices are explicitly protected.
316 apps/macos/Sources/OpenClaw/ExecApprovalEvaluation.swift READ Retained policy snapshot and reusable grant projection; no behavior-free merge of authorization types.
313 apps/macos/Sources/OpenClaw/DashboardManager+Construction.swift READ Use direct TLS equality; preserve isolated-document requirement and current configuration ownership.
309 apps/shared/OpenClawMLXTTSProtocol/Sources/OpenClawMLXTTSProtocol/MLXTTSProtocol.swift READ Explicit tagged worker codecs preserve framing, payload size and missing-field defaults.
308 apps/shared/OpenClawKit/Sources/OpenClawKit/ComputerCommands.swift READ Public native computer DTOs and custom action decoding preserve closed wire action vocabulary.
307 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatWorkingProgress.swift READ Deterministic phrase/stance selection and recap settle ownership retain distinct behavior.
302 apps/macos/Sources/OpenClaw/ExecSystemRunCommandValidator.swift READ Retained stricter display/raw-command agreement and wrapper argv handling distinct from allowlist parser.
300 apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayErrors.swift READ Public error initializers, raw metadata and fallback missing-scope parsing preserve shipped recovery API.
296 apps/macos/Sources/OpenClaw/ControlUIDocumentHost+NavigationPolicy.swift READ Navigation predicates enforce separate document, editor, frame, identity and user-gesture boundaries.
296 apps/macos/Sources/OpenClaw/DashboardManager+Routes.swift READ Route normalization, primary endpoint resolution and per-action current-window guards remain required.
296 apps/macos/Sources/OpenClaw/NodesStore.swift READ Route-bound node cache and identity preparation have independent lifetimes; current-state fences retained.
295 apps/macos/Sources/OpenClaw/NodeMode/MacNodePresenceReporter.swift READ Retained system/app activity scope, clear delivery and route-generation semantics.
292 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMarkdownPreprocessor.swift READ Byte-accurate CommonMark image extraction and provenance-stripping boundaries retained.
289 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSourceResources.swift READ Route-held resource authority and auth fallback are hard contracts; unchanged.
288 apps/macos/Sources/OpenClaw/TailscaleService.swift READ Installation and live-status evidence have distinct roles; coalesced refresh task and join test seam protect completion ordering, while UI actions are retained unchanged.
288 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTheme.swift READ Platform-specific palettes and appearance-resolution contracts retained.
284 apps/macos/Sources/OpenClaw/VoiceWakeOverlayController+Session.swift READ No sound remaining reduction without changing render/state ordering or dismissal and token-lifetime behavior.
284 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatCommandPalette.swift READ Search and activation already use canonical session routing, attention and row presentation owners.
283 apps/shared/OpenClawKit/Sources/OpenClawKit/WatchChatDeliveryStore.swift READ SQLite custody, scoped queue ordering and receipt conflict handling are protected durability contracts.
282 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+ProgressCard.swift READ durable-card generation checks and dated released-gateway fallback retained; format variants have explicit legacy support.
280 apps/macos/Sources/OpenClaw/DashboardBrowserSessionStore.swift READ Serialized cookie retirement and renewal guard principal identity across awaited WebKit mutations; auth boundary untouched.
279 apps/macos/Sources/OpenClaw/RemoteGatewayProbe.swift READ Removed test-only forwarding methods around actual probe/SSH command owners; existing transport and policy tests call those owners directly with identical arguments.
278 apps/macos/Sources/OpenClaw/CameraPTZNativeController.swift READ Retained typed pan/tilt versus zoom hardware formats and control capability checks.
278 apps/macos/Sources/OpenClaw/DevicePairingApprovalPrompter.swift READ Device queue adapter already shares Source/RPC owner with node prompter; replacement-list handling and repair counts differ from node reconciliation, so further generic policy would blur protected approval lifecycle.
262 apps/macos/Sources/OpenClaw/ManagedProcess.swift READ Canonical process environment conversion reused by sibling runners; lifecycle and unreaped-group ownership retained.
260 apps/macos/Sources/OpenClaw/NodesMenu.swift READ Platform/version fallback distinctions and menu rendering retained; no new presentation abstraction justified.
258 apps/macos/Sources/OpenClaw/OnboardingView+Monitoring.swift READ CLI install/activation and asynchronous discovery lifecycles differ; visible outcome strings retained.
257 apps/macos/Sources/OpenClawDiscovery/WideAreaGatewayDiscovery.swift READ Deleted one-use runDig forwarding layer; live discovery descriptor now calls canonical BoundedCommand with identical path/args/timeout.
256 apps/macos/Sources/OpenClaw/ChromeExtensionSetup.swift READ Single request queue owns startup/manual installer writes and document cancellation; typed public projection deliberately excludes private installer data.
255 apps/macos/Sources/OpenClaw/DashboardGatewayCatalog.swift READ Catalog dedup differentiates browser principal from machine connection; promotion/auth policy untouched.
255 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionAttention.swift READ exact-byte disclosure identity, expiry ordering, and accessible presentation are necessary contracts; prior pass already centralized truncation.
253 apps/macos/Sources/OpenClaw/BrowserProfileImportBannerView.swift READ Existing phase projection is canonical; localized copy, conditional actions and layout retained.
253 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatGatewayPayloadCodec.swift READ mapping is canonical shared transport owner; generated/legacy decode boundaries and session scope checks retained.
252 apps/macos/Sources/OpenClaw/ScreenRecordService.swift READ Retained AV writer lifecycle and distinct audio/video start contracts; third-pass rate limits already shared.
252 apps/shared/OpenClawKit/Sources/OpenClawKit/ToolDisplay.swift READ One registry owns labels, typed value rendering, truncation and resource discovery; visible output unchanged.
251 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer+Controls.swift READ Picker controls retain distinct capabilities, labels and accessibility semantics.
249 apps/macos/Sources/OpenClaw/NotificationManager.swift READ Notification entitlement, TCC admission, stale-source guard and retained action routing protect native platform behavior; serializers remain unchanged.
248 apps/macos/Sources/OpenClaw/GatewayRemoteConfig.swift READ Replaced hand-written enum raw-value switch with RemoteTransport initializer preserving SSH fallback.
246 apps/macos/Sources/OpenClaw/DashboardWindowController+DeviceSettings.swift READ Boolean state table already canonical; consent, per-setting validation and update configuration preserved.
245 apps/macos/Sources/OpenClaw/ExecApprovals.swift READ Retained shared policy aliases and current-route skill trust owner.
245 apps/shared/OpenClawKit/Sources/OpenClawKit/NativeConversationContract.swift READ Version/document admission and tagged codecs preserve frozen native conversation bridge.
242 apps/macos/Sources/OpenClaw/NodeServiceManager.swift READ Removed unused CommandResult payload and ParsedServiceJson text projections; error summarization now calls TextSummarySupport directly without its duplicate forwarder.
240 apps/macos/Sources/OpenClaw/ConfigStore.swift READ Document source/revision/lease owner and offline fallback distinguish current authorized edits from stale or remote writes; overrides support real boundary tests.
235 apps/macos/Sources/OpenClaw/CanvasChromeContainerView.swift READ Chrome drawing, drag and resize geometry are visual contracts; no sound ownership cutover needed.
232 apps/macos/Sources/OpenClaw/CuaDriverHostLifecycle.swift READ Retained PID attribution, executable checks and signal escalation fences.
232 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptRows.swift READ Removed explicit nil arguments already supplied by message-content initializer defaults; transcript projection and rendered rows unchanged.
231 apps/macos/Sources/OpenClaw/PrimaryGatewayConnectionEditor.swift READ Unsaved route/auth draft clearing and commit fences protect saved credentials; no safe further merge.
228 apps/shared/OpenClawKit/Sources/OpenClawKit/RealtimePCMStreamingAudioPlayer.swift READ Bounded schedule slots, generation ownership and drain completion have distinct audio guarantees.
227 apps/macos/Sources/OpenClaw/DashboardFailurePage.swift READ Static HTML/CSS and escaping are the sole failure-page renderer; preserve exact bytes and localization.
225 apps/macos/Sources/OpenClaw/MacControlRequestHandler.swift READ Retained mutation serialization, strict transport validation and public error redaction.
224 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatWebConversation.swift READ Web/native mode handoff, outbox reservations and subscription reconciliation retain exact authority.
223 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatCompletedWork.swift READ Turn continuation chain and terminal work projection retain explicit run ownership.
221 apps/macos/Sources/OpenClaw/StatusMenuDescriptor.swift READ Sections encode ordering and approval/session grouping; no coherent reduction without weakening descriptor proof.
221 apps/shared/OpenClawKit/Sources/OpenClawChatUI/WatchMessageJournal+Storage.swift READ Existing Watch storage admission, generation and receipt contracts retained; no schema/transaction changes.
220 apps/macos/Sources/OpenClaw/ExecApprovalsPromptPresenter.swift READ Retained FIFO prompt cancellation and sizing; visual/permission behavior untouched.
220 apps/macos/Sources/OpenClaw/WorkActivityStore.swift READ Job/tool state and delayed cleanup receipts have distinct semantics; already share derived-state owner.
219 apps/macos/Sources/OpenClaw/PeekabooBridgeHostCoordinator.swift READ Retained legacy socket alias contract and incomplete-stop runtime retention.
219 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposerCapabilities.swift READ Public capability and Codable override contracts; explicit defaults preserve wire omission behavior.
217 apps/macos/Sources/OpenClaw/AppLaunchPresentationPolicy.swift READ Required launch presentation/background behavior and elevation filesystem durability paths are protected; similarly shaped policy properties retain named independent consumers.
217 apps/macos/Sources/OpenClaw/ControlUIDocumentHost.swift READ New main native-auth retirement and document authority owner read in full; retain instance-owned script replacement, accepted-binding retirement, load generations, browser-session and TLS checks.
216 apps/macos/Sources/OpenClaw/ExecInlineCommandParser.swift READ Removed two private forwarding predicates; keep the canonical flag parser and option set.
216 apps/macos/Sources/OpenClaw/LaunchAgentManager.swift READ Generation-owned serialized login-agent mutations, plist output and future-autostart removal are distinct lifecycle contracts; no safe removal beyond cosmetic churn.
216 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatProgressCard.swift READ Inline and floating card layout differ intentionally; step statuses and localization retained.
214 apps/macos/Sources/OpenClaw/OnboardingAISetupSheet.swift READ Wizard inputs and device-code/gateway execution views encode distinct rendering and interaction states.
213 apps/macos/Sources/OpenClaw/MacControlLiveOwner.swift READ Retained current-primary checks after awaits and saved-gateway connection behavior.
213 apps/shared/OpenClawKit/Sources/OpenClawKit/TalkPlaybackLevelMeters.swift READ RMS calculation, streamed playback envelope, and AVAudioPlayer meter have distinct timing and sample input contracts.
209 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposerTextViewIOS.swift READ UIKit responder deferral and reentrancy guards protect platform-specific focus behavior.
207 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatCameraFlipButton.swift READ Talk and dictation share established microphone controls and captured session delivery.
206 apps/macos/Sources/OpenClaw/Logging/OpenClawLogging.swift READ Existing shared LogHandler extension already consolidates sink behavior; privacy interpolation, HMAC correlation and metadata rendering retain sink contracts.
205 apps/macos/Sources/OpenClaw/DeepLinks.swift READ Canvas unattended key, external prompt limits and delivery suppression are protected auth/product behavior; retained functions bind explicit action boundaries.
205 apps/macos/Sources/OpenClaw/ExecApprovalPanelView.swift READ Visual view retained unchanged; no safe nonvisual simplification beyond existing composition.
205 apps/macos/Sources/OpenClaw/VoiceWakeOverlayTextViews.swift READ Retained separate editing, vibrant label and IME event contracts; no rendering changes.
205 apps/shared/OpenClawKit/Sources/OpenClawKit/ShareGatewayRelaySettings.swift READ Keychain credentials and defaults metadata retain endpoint custody and extension-first migration safety.
202 apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatContextUsage.swift READ Context pressure, usage and display formatters intentionally use different rounding and precision.
201 apps/macos/Sources/OpenClaw/OnboardingProviderArtwork.swift READ Third pass already consolidated artwork; resource lookup and bounded SVG prolog handling retained.
201 apps/macos/Sources/OpenClawIPC/MacControlProtocol.swift READ Public wire models retained; custom nullable transport encoding is a contract.

@clawsweeper

clawsweeper Bot commented Sep 28, 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.

@steipete
steipete marked this pull request as ready for review September 28, 2026 21:00
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 11:37 PM ET / September 29, 2026, 03:37 UTC (Revision 8).

ClawSweeper review

What this changes

The branch simplifies shared Swift chat and macOS app code, binds delayed file selections to their conversation, and scopes rendered link previews to their URL.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open. Current main still has the two reported failure paths, and the related merged PRs address separate work. The prior preview finding is resolved at this head; this review found no blocking defect.

Priority: P2
Reviewed head: c5094477b5f54b37db654f52507119fac99501d6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused original-failure controls, native validation, and visible rendering evidence support a sound cleanup, with no current blocking finding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The matching PR snapshot records the production SwiftUI preview renderer in an NSHostingView with retained URL-A state: its guard-disabled control shows stale content for URL B, while the guarded render shows loading. I inspected the prepared unchanged-layout captures; the linked transition frames were outside the prepared manifest. Production attachment staging is covered for accepted and switched sessions. No stored-data contract changes were identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The matching PR snapshot records the production SwiftUI preview renderer in an NSHostingView with retained URL-A state: its guard-disabled control shows stale content for URL B, while the guarded render shows loading. I inspected the prepared unchanged-layout captures; the linked transition frames were outside the prepared manifest. Production attachment staging is covered for accepted and switched sessions. No stored-data contract changes were identified.
Evidence reviewed 9 items Current main still samples the selected conversation late: The macOS picker and drop callbacks call attachment staging through the view model after their asynchronous work completes.
Introduced attachment repair: Both macOS callbacks capture the initiating session before the asynchronous operation and pass it to the existing session-aware attachment owner.
Final attachment admission: The production staging owner rejects a captured session that is no longer current before starting file work; the changed regression covers both accepted files and a stale selection.
Findings None None.
Security None None.

How this fits together

OpenClaw's shared Swift chat UI receives conversation input, file selections, and link data for the Apple apps; it stages attachments and renders chat. The macOS app also connects that UI to Gateway routing and local approvals.

flowchart LR
A[File selection] --> B[Captured conversation]
B --> C{Still current?}
C -->|Yes| D[Attachment staging]
C -->|No| E[Discard stale selection]
F[Message link URL] --> G[URL scoped preview]
G --> H[Rendered chat]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test lines production +543/-1,391; tests +464/-231 The cleanup removes 848 net production lines while adding focused regression coverage.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep session admission and preview identity with their existing shared Swift owners, retain the focused regressions, and land through the native macOS review workflow.

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

Yes, current-main source shows both late attachment ownership and URL-unscoped preview results. The PR records original-failure controls, although this read-only review did not execute native code.

Is this the best way to solve the issue?

Yes. Capturing the existing session owner and gating rendered preview data by URL repair the failures within their current owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6391a9ad3311.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The matching PR snapshot records the production SwiftUI preview renderer in an NSHostingView with retained URL-A state: its guard-disabled control shows stale content for URL B, while the guarded render shows loading. I inspected the prepared unchanged-layout captures; the linked transition frames were outside the prepared manifest. Production attachment staging is covered for accepted and switched sessions. No stored-data contract changes were identified.

Label justifications:

  • P2: This is a bounded Apple chat improvement with useful bug fixes and limited product blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The matching PR snapshot records the production SwiftUI preview renderer in an NSHostingView with retained URL-A state: its guard-disabled control shows stale content for URL B, while the guarded render shows loading. I inspected the prepared unchanged-layout captures; the linked transition frames were outside the prepared manifest. Production attachment staging is covered for accepted and switched sessions. No stored-data contract changes were identified.
  • proof: sufficient: Contributor real behavior proof is sufficient. The matching PR snapshot records the production SwiftUI preview renderer in an NSHostingView with retained URL-A state: its guard-disabled control shows stale content for URL B, while the guarded render shows loading. I inspected the prepared unchanged-layout captures; the linked transition frames were outside the prepared manifest. Production attachment staging is covered for accepted and switched sessions. No stored-data contract changes were identified.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The matching PR snapshot records the production SwiftUI preview renderer in an NSHostingView with retained URL-A state: its guard-disabled control shows stale content for URL B, while the guarded render shows loading. I inspected the prepared unchanged-layout captures; the linked transition frames were outside the prepared manifest. Production attachment staging is covered for accepted and switched sessions. No stored-data contract changes were identified.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-09-28T21:05:44.749Z sha f11fdf8 :: blocked before merge. :: none
  • reviewed 2026-09-28T22:40:58.838Z sha df89ce585ca5b6fdbe99a469dc7cf4a779e52981 :: blocked before merge. :: [P2] Invalidate a collapsed preview before rendering a replacement URL
  • reviewed 2026-09-28T23:29:57.414Z sha df89ce585ca5b6fdbe99a469dc7cf4a779e52981 :: blocked before merge. :: [P2] Invalidate preview state when the view URL changes
  • reviewed 2026-09-28T23:40:33.083Z sha 864fac5 :: blocked before merge. :: [P2] Invalidate preview state when the view URL changes
  • reviewed 2026-09-28T23:59:09.914Z sha 864fac5 :: blocked before merge. :: [P2] Invalidate retained previews before rendering a replacement URL
  • reviewed 2026-09-29T01:13:28.361Z sha b46ba7cff7ac6a9e8e830bd4a663306bf4542797 :: blocked before merge. :: [P2] Invalidate a retained preview before rendering a replacement URL
  • reviewed 2026-09-29T03:13:01.176Z sha c509447 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 28, 2026
Consolidate chat projections, native request and file-panel helpers, subprocess preparation, shared types, and redundant testing forwards. Preserve rendering, wire formats, authentication, approval checks, permissions, persisted keys, and update/signing settings.

Also bind delayed attachment callbacks to their originating conversation and invalidate obsolete link-preview generations before fetch eligibility. Regression controls reproduce both defects; the full shared package and remote scope checks pass.
Preserve the single deferred cancellation while unwrapping TaskGroup<String?>.next() explicitly. This avoids the pinned SwiftLint redundant-nil-coalescing rule without changing nil completion or cancellation behavior.
@steipete

Copy link
Copy Markdown
Contributor Author

The retained-preview finding is addressed at the rendering boundary. ChatLinkPreview owns retained state and loading tasks; its production content view synchronously hides metadata/images unless their source URL matches the rendered URL. Expansion, styles, strings, generation fences, and fetch policy remain unchanged.

The regression retains the same NSHostingView and populated model across expanded URL A → B, then renders before the container invokes its loader. The control uses the same extracted renderer with only the URL guard disabled: both light/dark comparisons fail because B shows A’s title/image. The candidate passes both cases and the existing metadata/image identity cases. The normal A frames are byte-identical before/after. This is synthetic renderer-boundary proof, not a claim about observed network timing. The actual view has no collapse control; separate model tests retain collapsed-state coverage.

The final test file plus identity suite passes four test functions (12 parameter cases) in 0.402 seconds, 36.07 seconds wall including incremental SwiftPM build/startup. All captures below contain only synthetic data, were inspected in full, and were delivered in the originating chat.

Retained A → B Unguarded control URL-scoped candidate
Light Before: B incorrectly shows A content After: B shows its loading state
Dark Before: dark B incorrectly shows A content After: dark B shows its loading state

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 29, 2026
@steipete
steipete merged commit 669db5d into main Sep 29, 2026
98 checks passed
@steipete
steipete deleted the deslop/l146-apple4 branch September 29, 2026 03:43
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…160710)

* refactor(apple): deslop shared Swift and macOS fourth pass

Consolidate chat projections, native request and file-panel helpers, subprocess preparation, shared types, and redundant testing forwards. Preserve rendering, wire formats, authentication, approval checks, permissions, persisted keys, and update/signing settings.

Also bind delayed attachment callbacks to their originating conversation and invalidate obsolete link-preview generations before fetch eligibility. Regression controls reproduce both defects; the full shared package and remote scope checks pass.

* test(apple): use canonical endpoint snapshot enum values

* refactor(apple): keep explicit task-group result unwrap

Preserve the single deferred cancellation while unwrapping TaskGroup<String?>.next() explicitly. This avoids the pinned SwiftLint redundant-nil-coalescing rule without changing nil completion or cancellation behavior.

* fix(apple): scope retained preview rendering to its URL
steipete added a commit that referenced this pull request Oct 9, 2026
The cold-start tests introduced in 418f22b (#158954) still referenced setTestingLastFailureReason and the bundlePath argument. Those were intentionally removed by 6cc8e7f (#163372) and 669db5d (#160710). Use the same direct property writes and port-only calls as the sibling tests, preserving all assertions.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
The cold-start tests introduced in bac884e (openclaw#158954) still referenced setTestingLastFailureReason and the bundlePath argument. Those were intentionally removed by 9c6018f (openclaw#163372) and 4e79f38 (openclaw#160710). Use the same direct property writes and port-only calls as the sibling tests, preserving all assertions.
steipete added a commit that referenced this pull request Oct 13, 2026
* refactor(apple): simplify old shared and macOS bookkeeping

Replace redundant generations with existing cancellation or actual owner
identity, consolidate parallel fallback/policy paths, and remove test-only
forwarding layers. Preserve authority, FIFO, durable state, resource bounds,
public protocol/config shapes, signing, permissions, and visible rendering.

Reuse canonical session-key normalization for Voice Wake delivery selection:
opaque Signal group IDs remain case-sensitive and main aliases are not added.
Use canonical IP-literal policy for discovery labels and remote CLI validation.

Best-effort tradeoffs accepted

- Palette generation (#159350): synthetic direct completions bypassed the sole cancellation-owning caller; unsupported future callers can show stale results until the next search. Current cancellation/request/agent checks remain.
- Link preview generation (#160710): synthetic URL replacement without caller cancellation is outside the SwiftUI task lifecycle; a late cosmetic result can remain until the next refresh. Network/SSRF checks and bounded caches remain.
- Sidebar preview generation (#147197): same-request overlapping cache reads can finish out of order; no linked human failure report, and a later refresh replaces the cosmetic projection. Owner/request checks remain.
- Source-preview producer revision (#148906): duplicate of exact task cancellation, with no human failure report. Consumer revision and authenticated resource authority remain.
- Mermaid generations (#135470/#135746): feature stress fixtures, no linked human race report. Exact subscriber cancellation and job/WebView identity retain the same admission; no extra failure accepted.
- Camera JPEG UUID (#107879): duplicates exact task cancellation; #107804 was a human feature request, not a generation-specific incident. Captured session/agent/route and attachment admission remain.
- Discovery generation (#145435): speculative queued callbacks, no linked human incident. A stopped browser may publish one late discovery projection; next discovery/refresh repairs it. Connection authority remains separate.
- FSEvents generation (#145453): synthetic stop/restart fixtures, no linked human incident. An old callback after restart may cause one extra refresh; serial lifecycle ownership and pending-work cancellation remain.
- Menu generations (#139688): feature-local late-result fixtures, no linked human incident. Exact task cancellation replaces duplicate tokens; drain-before-disconnect and real consumer/window authority remain.
- Cron generation (#131466/#137502): #138209 cut every load over to one cancel-and-drain chain. No direct concurrent load caller remains; cancellation and physical source leases stay checked after awaits.
- WebChat visibility acknowledgement/retry (#113634/#137089): synthetic timeout/reconnect interleavings, no linked human incident. A timed-out visibility update is best effort until the next transition/reconnect; FIFO and live socket leases remain.
- WebChat cleanup UUID (#113634/#137089): retain one bounded completed Task handle per live connection instead of matching cleanup tokens. Completion releases captures; replacement/retirement removes the handle.
- Child-exit polling (#145437): synthetic missed-notification coverage, no linked human report. A lost OS exit notification may wait for the existing deadline; final non-reaping liveness/status checks and cleanup remain.
- Realtime iterator borrowing trap (#156772): every real consumer awaits its own iterator sequentially. Unsupported concurrent next calls no longer get a custom custody protocol; bounded stream/cancellation/socket checks remain.
- Receipt projection admission (#161745): both real callers already match receipt and row identity immediately before synchronous projection. Those effect checks remain; no unsupported internal caller is defended twice.
- Recap attribution heuristics (#112188/#113084): synthetic guard matrix, no linked human race report. Missing initial rows or very late unrelated completion may supply a cosmetic footer; per-session freshness, failed-turn handling and settled results remain.
- PortGuardian per-write schema scans (#110527): synthetic live-handle version advance, no linked human incident. Concurrent external schema upgrades are best effort until reopen; initial admission, migration locks, receipts, transactions and durability remain.
- Unread queue counter (#110019): actual Task equality replaces the duplicate integer token. Exact-tail reclamation, bounded bookkeeping, FIFO and route authority remain unchanged.

Review dispositions: the claimed Task compilation failure is disproved by the
selected SDK's Equatable conformance and native builds. Repeated receipt
identity admission is unnecessary at its internal projector because both real
callers retain it immediately before projection. Per-write schema revalidation
was declined under the explicit best-effort policy above.

Proof and scope

Net production reduction: 369 lines (148 added, 517 deleted), excluding tests.
Fresh seven-day census permits all substantive production edits; the only
recent caller change is the unavoidable one-line fallback-to-parse rename.

Shared Swift build passed. Final focused shared tests passed 396 cases in six
suites (6.683s execution), Watch decoder tests passed five cases (0.003s), and
isolated whole-owner native tests passed 16 cases. macOS SwiftPM compiled all
products and the test bundle. Final macOS and iOS/Watch xcodebuild builds passed
(89.60s and 120.87s wall), without signing changes or app launches.

Canonical Apple lint/format checks passed; the initial iOS format failure in
WatchCommands was ours and corrected, with no gate weakened. Lint-suppression
tests passed 3/3 (14.09s wall). Earlier runtime cycles and Madge each reported 0;
the TypeScript graph is unchanged. Native localization stayed at 4476 entries.
The 45 original packaging/elevation timeout cases passed one focused retry
(94.79s wall), with no assertion/budget change and no claim of a diagnosed fix.

Known gaps: seven issues remained in the earlier ChatStreamReplayTests
narration=false package cases; causality/current-main attribution is unproven.
App-hosted macOS tests were not executed on the operator desktop. No hosted CI
or PR was started: the explicit BELOW-500 rule requires a branch-only handoff.

* refactor(ui): consolidate old UI owners and validation

Share route decoding, attachment retention, gallery preparation, transient
identity encoding, override copying, and extension classification. Remove
duplicate admission/schema mirrors and obsolete supported-browser fallbacks.
Both Lit and Solid paths remain; no rendering change is intended. No config,
protocol, persisted shape, dependency, or public SDK change.

Best-effort tradeoffs accepted

- Malformed internal native requests (#140988): all callers are typed and
  native hosts validate at the effect; their error replaces the renderer mirror.
- Worker replacement during an identity query (#140484): added for synthetic
  autoreview interleavings, not a human incident. Return false; normal worker
  announcements and foreground recovery observe the next active worker.
- Native readiness changing between synchronous checks (#140484/#109719):
  rely on queued events. A broken native event can require another worker event
  or reload; camera readiness retains its existing five-second error deadline.
- Overlapping application-root health reporters (#152638): startup mounts one
  root. Unsupported overlapping roots are last-publication-wins; the actual
  reported health/status feature and native trusted-document checks remain.
- Polling after stop (#139704): its sole owner retires eligibility first.
  Scheduling now uses that owner admission, not a separate read-only generation.
- Resetting an observer without retiring its connection (#116887): no production
  caller does this. Canonical connection epochs remain the sole retirement owner;
  unsupported direct live-scope reset no longer fences an old response separately.
- Upload policy changing during local reads (#158567): decoded/hash work can
  finish. Draft publication and every upload request retain live policy checks.
- Missing supported browser primitives (#105240/#151388/#100024/#102745):
  unsupported runtimes error instead of code-point initials, skipped input yield,
  wall-clock timing, or approximate microtask paint. The human progress-card fix
  in #151386 keeps its browser yield and durable FIFO handoff unchanged.
- URL APIs disappearing after URL creation (#100024/#149330): supported browsers
  keep paired APIs. An unsupported replaced global can throw during cleanup;
  undefined URLs, creation fallback, cancellation and release ordering remain.
- Malformed internal MCP calls bypassing AppBridge (#161747): may throw. The SDK
  still rejects malformed wire blocks before dispatch, proved over real in-memory
  App/AppBridge transport. UI content, authority, confirmation and custody policy
  remain. The introducing PR cites no human incident for the second mirror.

Production: +176/-394, net -218 lines across 21 eligible old files. Tests: +30.
Focused owner/sibling tests, targeted types/lint/format, lint-suppression and
independent P0-P2 review pass. Import edges are unchanged; runtime/Madge cycle
proof remains zero. Whole-tree Knip timed out at existing limits; heavy gallery
renderer runs did not reach assertions, while its owning controller suite passed.

* refactor(ui): remove obsolete Fetch capability branch

The supported Control UI browser floor includes Fetch. Start attachment
metadata reads directly rather than leaving an unsupported runtime in a
permanent checking state.

Best-effort tradeoffs accepted

- Missing global Fetch: the guard originated in #64104, whose feature report
  cites no human missing-Fetch incident. An unsupported runtime that replaces
  Fetch now reaches the existing rejected-request/unavailable path. Metadata
  validation, auth/tickets, allow POST, cancellation, resource admission,
  expiry and bounded retry remain unchanged. No intended rendering change.

Unchanged lifecycle baseline: 21/21, 25.09 s. Final lifecycle and attachment
siblings: 50/50, 14.77 s. UI types, typed lint, formatting and lint-suppression
checks pass. This cut removes five production lines including formatter
reflow, bringing the lane to 223 net production lines removed.
Fresh independent P0-P2 review is scoped-clean with no actionable findings.

* fix(ui): use global frame scheduling APIs

Preserve double-frame paint timing and cancellation without requiring a Window object in renderer-free hosts that supply the standard global APIs. The existing access suite reproduces seven unhandled errors before this fix and passes on main; all 130 affected cases plus 262 timing/state/send sibling cases now pass without test changes.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…#170823)

* refactor(apple): simplify old shared and macOS bookkeeping

Replace redundant generations with existing cancellation or actual owner
identity, consolidate parallel fallback/policy paths, and remove test-only
forwarding layers. Preserve authority, FIFO, durable state, resource bounds,
public protocol/config shapes, signing, permissions, and visible rendering.

Reuse canonical session-key normalization for Voice Wake delivery selection:
opaque Signal group IDs remain case-sensitive and main aliases are not added.
Use canonical IP-literal policy for discovery labels and remote CLI validation.

Best-effort tradeoffs accepted

- Palette generation (openclaw#159350): synthetic direct completions bypassed the sole cancellation-owning caller; unsupported future callers can show stale results until the next search. Current cancellation/request/agent checks remain.
- Link preview generation (openclaw#160710): synthetic URL replacement without caller cancellation is outside the SwiftUI task lifecycle; a late cosmetic result can remain until the next refresh. Network/SSRF checks and bounded caches remain.
- Sidebar preview generation (openclaw#147197): same-request overlapping cache reads can finish out of order; no linked human failure report, and a later refresh replaces the cosmetic projection. Owner/request checks remain.
- Source-preview producer revision (openclaw#148906): duplicate of exact task cancellation, with no human failure report. Consumer revision and authenticated resource authority remain.
- Mermaid generations (openclaw#135470/openclaw#135746): feature stress fixtures, no linked human race report. Exact subscriber cancellation and job/WebView identity retain the same admission; no extra failure accepted.
- Camera JPEG UUID (openclaw#107879): duplicates exact task cancellation; openclaw#107804 was a human feature request, not a generation-specific incident. Captured session/agent/route and attachment admission remain.
- Discovery generation (openclaw#145435): speculative queued callbacks, no linked human incident. A stopped browser may publish one late discovery projection; next discovery/refresh repairs it. Connection authority remains separate.
- FSEvents generation (openclaw#145453): synthetic stop/restart fixtures, no linked human incident. An old callback after restart may cause one extra refresh; serial lifecycle ownership and pending-work cancellation remain.
- Menu generations (openclaw#139688): feature-local late-result fixtures, no linked human incident. Exact task cancellation replaces duplicate tokens; drain-before-disconnect and real consumer/window authority remain.
- Cron generation (openclaw#131466/openclaw#137502): openclaw#138209 cut every load over to one cancel-and-drain chain. No direct concurrent load caller remains; cancellation and physical source leases stay checked after awaits.
- WebChat visibility acknowledgement/retry (openclaw#113634/openclaw#137089): synthetic timeout/reconnect interleavings, no linked human incident. A timed-out visibility update is best effort until the next transition/reconnect; FIFO and live socket leases remain.
- WebChat cleanup UUID (openclaw#113634/openclaw#137089): retain one bounded completed Task handle per live connection instead of matching cleanup tokens. Completion releases captures; replacement/retirement removes the handle.
- Child-exit polling (openclaw#145437): synthetic missed-notification coverage, no linked human report. A lost OS exit notification may wait for the existing deadline; final non-reaping liveness/status checks and cleanup remain.
- Realtime iterator borrowing trap (openclaw#156772): every real consumer awaits its own iterator sequentially. Unsupported concurrent next calls no longer get a custom custody protocol; bounded stream/cancellation/socket checks remain.
- Receipt projection admission (openclaw#161745): both real callers already match receipt and row identity immediately before synchronous projection. Those effect checks remain; no unsupported internal caller is defended twice.
- Recap attribution heuristics (openclaw#112188/openclaw#113084): synthetic guard matrix, no linked human race report. Missing initial rows or very late unrelated completion may supply a cosmetic footer; per-session freshness, failed-turn handling and settled results remain.
- PortGuardian per-write schema scans (openclaw#110527): synthetic live-handle version advance, no linked human incident. Concurrent external schema upgrades are best effort until reopen; initial admission, migration locks, receipts, transactions and durability remain.
- Unread queue counter (openclaw#110019): actual Task equality replaces the duplicate integer token. Exact-tail reclamation, bounded bookkeeping, FIFO and route authority remain unchanged.

Review dispositions: the claimed Task compilation failure is disproved by the
selected SDK's Equatable conformance and native builds. Repeated receipt
identity admission is unnecessary at its internal projector because both real
callers retain it immediately before projection. Per-write schema revalidation
was declined under the explicit best-effort policy above.

Proof and scope

Net production reduction: 369 lines (148 added, 517 deleted), excluding tests.
Fresh seven-day census permits all substantive production edits; the only
recent caller change is the unavoidable one-line fallback-to-parse rename.

Shared Swift build passed. Final focused shared tests passed 396 cases in six
suites (6.683s execution), Watch decoder tests passed five cases (0.003s), and
isolated whole-owner native tests passed 16 cases. macOS SwiftPM compiled all
products and the test bundle. Final macOS and iOS/Watch xcodebuild builds passed
(89.60s and 120.87s wall), without signing changes or app launches.

Canonical Apple lint/format checks passed; the initial iOS format failure in
WatchCommands was ours and corrected, with no gate weakened. Lint-suppression
tests passed 3/3 (14.09s wall). Earlier runtime cycles and Madge each reported 0;
the TypeScript graph is unchanged. Native localization stayed at 4476 entries.
The 45 original packaging/elevation timeout cases passed one focused retry
(94.79s wall), with no assertion/budget change and no claim of a diagnosed fix.

Known gaps: seven issues remained in the earlier ChatStreamReplayTests
narration=false package cases; causality/current-main attribution is unproven.
App-hosted macOS tests were not executed on the operator desktop. No hosted CI
or PR was started: the explicit BELOW-500 rule requires a branch-only handoff.

* refactor(ui): consolidate old UI owners and validation

Share route decoding, attachment retention, gallery preparation, transient
identity encoding, override copying, and extension classification. Remove
duplicate admission/schema mirrors and obsolete supported-browser fallbacks.
Both Lit and Solid paths remain; no rendering change is intended. No config,
protocol, persisted shape, dependency, or public SDK change.

Best-effort tradeoffs accepted

- Malformed internal native requests (openclaw#140988): all callers are typed and
  native hosts validate at the effect; their error replaces the renderer mirror.
- Worker replacement during an identity query (openclaw#140484): added for synthetic
  autoreview interleavings, not a human incident. Return false; normal worker
  announcements and foreground recovery observe the next active worker.
- Native readiness changing between synchronous checks (openclaw#140484/openclaw#109719):
  rely on queued events. A broken native event can require another worker event
  or reload; camera readiness retains its existing five-second error deadline.
- Overlapping application-root health reporters (openclaw#152638): startup mounts one
  root. Unsupported overlapping roots are last-publication-wins; the actual
  reported health/status feature and native trusted-document checks remain.
- Polling after stop (openclaw#139704): its sole owner retires eligibility first.
  Scheduling now uses that owner admission, not a separate read-only generation.
- Resetting an observer without retiring its connection (openclaw#116887): no production
  caller does this. Canonical connection epochs remain the sole retirement owner;
  unsupported direct live-scope reset no longer fences an old response separately.
- Upload policy changing during local reads (openclaw#158567): decoded/hash work can
  finish. Draft publication and every upload request retain live policy checks.
- Missing supported browser primitives (openclaw#105240/openclaw#151388/openclaw#100024/openclaw#102745):
  unsupported runtimes error instead of code-point initials, skipped input yield,
  wall-clock timing, or approximate microtask paint. The human progress-card fix
  in openclaw#151386 keeps its browser yield and durable FIFO handoff unchanged.
- URL APIs disappearing after URL creation (openclaw#100024/openclaw#149330): supported browsers
  keep paired APIs. An unsupported replaced global can throw during cleanup;
  undefined URLs, creation fallback, cancellation and release ordering remain.
- Malformed internal MCP calls bypassing AppBridge (openclaw#161747): may throw. The SDK
  still rejects malformed wire blocks before dispatch, proved over real in-memory
  App/AppBridge transport. UI content, authority, confirmation and custody policy
  remain. The introducing PR cites no human incident for the second mirror.

Production: +176/-394, net -218 lines across 21 eligible old files. Tests: +30.
Focused owner/sibling tests, targeted types/lint/format, lint-suppression and
independent P0-P2 review pass. Import edges are unchanged; runtime/Madge cycle
proof remains zero. Whole-tree Knip timed out at existing limits; heavy gallery
renderer runs did not reach assertions, while its owning controller suite passed.

* refactor(ui): remove obsolete Fetch capability branch

The supported Control UI browser floor includes Fetch. Start attachment
metadata reads directly rather than leaving an unsupported runtime in a
permanent checking state.

Best-effort tradeoffs accepted

- Missing global Fetch: the guard originated in openclaw#64104, whose feature report
  cites no human missing-Fetch incident. An unsupported runtime that replaces
  Fetch now reaches the existing rejected-request/unavailable path. Metadata
  validation, auth/tickets, allow POST, cancellation, resource admission,
  expiry and bounded retry remain unchanged. No intended rendering change.

Unchanged lifecycle baseline: 21/21, 25.09 s. Final lifecycle and attachment
siblings: 50/50, 14.77 s. UI types, typed lint, formatting and lint-suppression
checks pass. This cut removes five production lines including formatter
reflow, bringing the lane to 223 net production lines removed.
Fresh independent P0-P2 review is scoped-clean with no actionable findings.

* fix(ui): use global frame scheduling APIs

Preserve double-frame paint timing and cancellation without requiring a Window object in renderer-free hosts that supply the standard global APIs. The existing access suite reproduces seven unhandled errors before this fix and passes on main; all 130 affected cases plus 262 timing/state/send sibling cases now pass without test changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

1 participant