Repository navigation
refactor(macos): deslop macOS app second pass - #159031
Conversation
Consolidate existing parser, projection, lifecycle, and update owners while retaining wire, credential, permission, and persisted-state contracts. Fix Voice Wake sending the original recognition after transcript edits; bind edited text to the current coordinator session.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 4:13 PM ET / 20:13 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch consolidates duplicated macOS app and CLI code and makes Voice Wake send text edited in its transcript overlay. Merge readiness✅ Ready for maintainer review Current main still has the Voice Wake edit-and-send defect, and the merged first cleanup pass does not contain this repair. The final scoped branch has no confirmed blocking finding. Priority: P2 Review scores
Verification
How this fits togetherThe macOS app receives speech transcripts, local settings, and Gateway events, then presents native controls and sends actions to the Gateway. This change affects the native state between those inputs and their outgoing actions. flowchart LR
A[Voice recognition] --> B[Editable transcript]
B --> C[Session coordinator]
C --> D[Gateway message]
E[Local settings] --> F[Mac connection]
F --> D
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther -1091. Total -1091 across 68 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the coordinator as the send-state owner, with overlay edits synchronized by session token and installed lifecycle behavior left to its existing owners. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main changes overlay text while Send reads separate coordinator text. The PR reports a native callback regression that fails when the repair is removed; this review did not run the app. Is this the best way to solve the issue? Yes. Updating the token-matched coordinator session from the overlay callback repairs the existing send path without adding another delivery owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c0e6951d6f02. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Use explicit multi-closure labels, share speech fallback and phase cleanup without fallthrough, and delete unused Gateway project-root forwarding methods. Independent scoped review found no actionable issues.
|
@clawsweeper re-review The final head is f2949d5. Installer/update, relocation/relaunch, managed Gateway recovery, launchd lifecycle, restart policy, and persisted activation receipt changes have been removed. Those implementations match the base revision; the only remaining GatewayProcessManager change deletes two unused forwarding methods. The PR body now records passing final-head CI and native tests, both Xcode builds, and a real callback-boundary negative control: removing only the overlay-to-coordinator update makes the new regression fail with the original recognized text; restoring it passes. The final audited sandbox run passed 73 tests. No live Gateway delivery or native GUI recording is claimed. Stored formats, auth, permissions, wire behavior, and dependency versions are unchanged. Please refresh the review against this final scope and evidence. Review only; do not merge or start repair. |
|
🦞👀 Re-review progress:
|
* refactor(macos): deslop macOS app second pass Consolidate existing parser, projection, lifecycle, and update owners while retaining wire, credential, permission, and persisted-state contracts. Fix Voice Wake sending the original recognition after transcript edits; bind edited text to the current coordinator session. * refactor(macos): align cleanup with native lint Use explicit multi-closure labels, share speech fallback and phase cleanup without fallthrough, and delete unused Gateway project-root forwarding methods. Independent scoped review found no actionable issues. * style(macos): align session action arguments * refactor(macos): keep installed lifecycle outside cleanup scope
What Problem This Solves
The macOS app still carried duplicated internal parsing, lifecycle, and projection code after the first cleanup pass. This second pass removes 1,074 net production lines while preserving its existing boundaries.
User Impact
Voice Wake now sends the text edited in its transcript overlay; clearing that text dismisses the request instead of sending the original recognition. The remaining changes preserve behavior and appearance. Gateway wire behavior, auth/pairing, Keychain and permission flows, persisted formats, bundle/entitlement/update configuration, URL schemes, and dependency versions are unchanged.
Why This Change Was Made
This pass follows #158516 and keeps one existing owner for each shared operation:
Fixes found along the way
The overlay's edit callback previously updated only presentation state, while Send read a separate coordinator transcript. Edits now update the matching session token. The regression exercises the actual edit/send callbacks and checks that cleared input dismisses without forwarding stale text.
Installed update, app relocation/relaunch, managed Gateway recovery, launchd lifecycle, worker restart policy, and persisted activation receipt changes are excluded. Those owners retain the base implementation. No published-app upgrade behavior is changed or claimed by this PR.
Evidence
Final head:
f2949d587ca8b155bd89a70d3af4110469cb2abd. The exact-head CI run passed, includingopenclaw/ci-gate, localization, all three macOS Node lanes, Swift package tests, and native app tests. Native CI passed 2,296 Swift Testing tests across three isolation partitions, plus the XCTest partition. The native job took 901 seconds; the Swift Testing partitions took 264.134 seconds. Final macOS Periphery also passed.All local Apple builds ran at
nice -n 10, one at a time:swift build --package-path apps/macos --build-system native --product OpenClaw --jobs 4 --disable-automatic-resolutionpassed (1,755.24 seconds wall).swift build --package-path apps/macos --build-system native --build-tests --jobs 4 --disable-automatic-resolutionpassed (846.14 seconds wall), rebuilding both app and tests.xcodebuild -scheme openclaw-mac -configuration Debug -destination platform=macOS -jobs 2 -skipPackageUpdates -disableAutomaticPackageResolution buildpassed, including discovery (576.03 seconds wall).xcodebuild -scheme OpenClaw -configuration Debug -destination platform=macOS -jobs 4 -skipPackageUpdates -disableAutomaticPackageResolution buildpassed (1,233.88 seconds wall).An audited OS-sandboxed subset passed 73 tests in eight suites on the final head (0.561 seconds test runtime, 9.60 seconds process wall). The new Voice Wake regression took 0.495 seconds, with no timer or network dependency. Removing only the edit-to-coordinator call made that same test fail with
recognized wordsinstead ofcorrected words; restoring the exact candidate bytes made it pass again. This exercises the real edit/request-send callback boundary and empty-text dismissal. No live Gateway delivery or GUI recording is claimed. Operator files, preferences, Keychain services, network access, and helper execution were blocked by the test sandbox.Blacksmith Testbox
tbx_01m3f9m3g0j6mwh3sqs2q2791everified sourcef2ae76d05ecb72533c2b04cdabe3910386b92c3fand passedpnpm install --frozen-lockfile,pnpm protocol:check:swift,pnpm native:i18n:verify, 13 explicitly selected import-boundary files (includingsrc/infra/fs-safe-import-boundary.test.tsand the Gateway entry point), andnode scripts/check-changed.mjs. The remote run took 464.766 seconds for the command; the lease is stopped. Subsequent changes only fixed Swift lint or removed installer/lifecycle refactors; the tested TypeScript and import contracts are unchanged.Independent autoreview completed with no accepted findings. Three normalization findings in the initial review were rejected after checking that canonical
String.nonEmptytrims whitespace/newlines and returns nil for blank strings. The lint repairs and final scope narrowing each passed fresh scoped review through P2. Two initial CI runs exposed SwiftLint closure-layout/fallthrough issues; these were repaired, and the final run is green.The final shared Periphery run separately reports exactly the existing
ChatScrollCommand.Request.idnonce. Synthesized equality uses it to distinguish same-target requests; deleting it would change behavior. Its explicit-identity repair is already owned by #158587. This PR leaves shared/iOS code and Periphery retain/baseline policy untouched.Production count excludes
Tests/and generated sources: +723 / -1,797 = 1,074 net lines removed. Tests: +76 / -93 = 17 net lines removed. No changes toapps/shared,apps/ios, SwiftPM manifests, lockfiles, or generated localization inventory.