Repository navigation
fix: keep Mac desktops available and resolve session views directly - #144226
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 11, 2026, 11:23 AM ET / 15:23 UTC (Revision 28). ClawSweeper reviewWhat this changesThe branch adds consented Mac keep-awake behavior, resolves session desktops directly, repairs worker cleanup and capability refresh, and adjusts supporting tests and CI planning. Merge readiness⛔ Blocked before merge - 3 items remain This PR remains useful: current main lacks its central desktop-availability and direct-resolution changes. No blocking introduced defect was found; the prior compatibility concern is explicitly addressed by the maintainer-authored description and signed recovery evidence. Priority: P2 Review scores
Verification
How this fits togetherThe Mac node receives authorized Computer requests from the Gateway and turns them into native desktop actions. Its availability owner controls execution lifetime and keep-awake assertions, while the web Desktop panel resolves the session’s machine and displays its current state. flowchart TD
A[Gateway Computer request] --> B[Mac execution owner]
C[Console state and hosting consent] --> B
B --> D{Execution still allowed?}
D -->|Yes| E[Native desktop action]
D -->|No| F[Refusal and scoped cleanup]
C --> G[Gateway environment status]
G --> H[Session Desktop panel]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one native execution owner, preserve explicit hosting consent and normal sign-in recovery, and ship the documented provider cleanup contract with its matching SDK and consumer. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the inventory-first desktop lookup and missing confirmed-cleanup handling on fetched main; the PR also records signed native before/after behavior. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes, the changes extend the existing native, Desktop, publication, and teardown owners, with explicit compatibility decisions and focused regression coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3c8a78472013. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (27 earlier review cycles; latest 8 shown)
|
08722fe to
007cbee
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
460d1a4 to
d5d8323
Compare
49e16c6 to
ab59398
Compare
This comment has been minimized.
This comment has been minimized.
Rebalance one eligible file within its existing tooling family after bounded tail packing overflows. Preserve the 80-job cap, timing floors, complete inventories, process isolation, and ordinary plans.
Use the existing retirement callback to observe reservation before exercising bounded cleanup. Preserve discovery and assertion deadlines and release the held callback during cleanup.
Keep the canonical Zod parser, infer the existing desktop fields, and verify publication of locked, unlocked, unknown, and absent state.
|
Merged via squash.
|
…penclaw#144226) * fix: keep Mac desktops available and resolve session views directly Keep authorized Computer executions awake with bounded native assertions, report locked/unknown desktop state, and offer explicit unattended hosting. Manual lock and route retirement revoke old executions without disturbing a successor or unrelated held input. Resolve session desktops through exact session and environment status before unrelated inventory. Preserve retry for transient errors, recover missing sources to the picker, and refresh availability when the presenter reconnects. * test: keep node host alive for inventory assertions * refactor: remove unused Mac service protocol requirement * fix(macos): preserve desktop parameter errors Preserve command-specific malformed snapshot and computer.act errors at the execution-envelope guard, using the existing decoder and a shared response formatter. Include unattended hosting in the existing consent and setting-coercion coverage tables. Verified the four original CI failures and eight lifecycle siblings with a signed Intel payload in an isolated native test run. Swift lint, formatting, schema guard, and independent review passed. * fix(macos): preserve literal desktop error responses Keep the two complete diagnostic strings at the response boundary so native translation discovery does not interpret a temporary command label as UI copy. The selection predicate, error code, and response messages are unchanged. Verified unchanged native i18n inventory and generated artifacts, strict Swift lint and formatting, an isolated Intel compile, and independent review. Existing signed native regression proof remains applicable to the identical output contract. * fix(macos): read console state from the registry root The IOService plane root can be the hardware entry and omit IOConsoleUsers, leaving an unlocked desktop unavailable to Computer work. Use the registry root accessor while preserving CFBoolean, UID, lock, and release validation. Live signed Swift proof calls the actual platform method before and after the accessor repair on macOS 15.7.9. * fix: refill prepared workers after session worktree cleanup Retain the canonical Git donor while keeping the admitted session commit. Reuse repository identity for immutable replays and preserve managed archive snapshot retention. Cover archive removal, immediate Git pruning, store reopen, pinned refill, bare donors, and idempotency rejection with real Git. Validation: 130 focused and sibling tests passed, scoped changed checks, and managed review with the retention finding resolved against the existing archive owner and forced-pruning regression. * test(android): await approval reconciliation before reconnect Wait for the original resolution coroutine to finish its immediate readback before replacing the test backend. The published unknown-outcome message precedes that read and was not a completion barrier. Preserve the exact reconnect request-order assertions and existing timeout. Validation: causal reproduction of the extra leading get, all 26 approval runtime tests, app ktlint, and independent review. * test(android): await complete gateway deadline admission Read operation readiness through the existing lifecycle owner lock before advancing virtual time. The operation field is published before its deadline is registered, so an unlocked read could observe half-completed admission. Preserve the deadline, cleanup, and replacement-admission assertions. Validation: causal RED/GREEN, all 53 foreground-service tests, Android ktlint, and independent review. * fix(macos): propagate native worker task cancellation Route Swift task cancellation through the existing worker owner and settle cancelled calls without waiting for a suppressed child result. Bind queued cancellation to its exact request reservation and consume that request's buffered controls when admission is already cancelled. Clarify that Screen Sharing can explicitly lock a Mac on viewer disconnect; unattended hosting respects that operating-system boundary. Signed isolated native proof passed six functions/eight cases, including active and pre-dispatch cancellation, scoped buffered controls, worker replacement, and process cleanup. Swift and documentation checks passed. * test(browser): report tab creation errors before polling * perf(ui): reuse native embed shape validation * test(ui): await plugin mutation reconnect before assertions * test(codex): control native relay retention clock * fix(workers): cancel reserves and finalize confirmed cleanup Let environments.destroy cancel an unused automatic reserve through the existing guarded preparation owner before waiting for provider settlement. Preserve claimed workers and admitted capture expiry behavior. Carry confirmed allocation cleanup through WorkerProviderError.cleanupComplete and the existing teardown finalizer. Retire pending or bound node enrollment before terminal failure and preserve the original provider error. Uncertain allocation and cleanup retain their existing recovery ownership. Validate with producer/consumer RED-GREEN cases, 53 combined service regressions, provider and ownership siblings, changed checks, and scoped P2 review. Keep separate checkpoint/image recovery obligations with the provider. * fix(memory): reject views in FTS schema checks Restore the existing unavailable-FTS fallback when a view occupies the derived index name. Preserve the colliding view and the existing savepoint boundary; table lookup must include views while excluding the independent trigger namespace. The unchanged temporal-ranking regression fails before this repair and passes afterward, with 64 focused cases, changed checks, and independent review passing. * fix(cua): launch observed Mac apps by native identity Use the observed bundle ID or name accepted by the pinned Mac driver instead of its unsupported launch_path field. Preserve discovered launch-path precedence on Linux and Windows and the rejection of model-supplied paths. Both Mac regressions failed before the guard; all 21 provider cases, selected changed checks and independent review pass. A fresh signed artifact and native launch proof remain required. * fix(nodes): republish runner inventory after reapproval * test(memory): preserve equal-count view collision coverage * test(ui): wait for chat readiness before submitting controls * fix(ci): recover stranded hosted tooling capacity Rebalance one eligible file within its existing tooling family after bounded tail packing overflows. Preserve the 80-job cap, timing floors, complete inventories, process isolation, and ordinary plans. * test(android): observe promotion before crossing discovery deadline Use the existing retirement callback to observe reservation before exercising bounded cleanup. Preserve discovery and assertion deadlines and release the held callback during cleanup.
Port only the Wear promotion-reservation testcase from the canonical change. Observe retirement before crossing the discovery deadline and release the held callback during cleanup. Production code is unchanged. Source-Commit: cc0d3ca Source-PR: openclaw#144226 Punchcard-Session: cobalt-harbor-valley-dg
Port only the Wear promotion-reservation testcase from the canonical change. Observe retirement before crossing the discovery deadline and release the held callback during cleanup. Production code is unchanged. Source-Commit: cc0d3ca Source-PR: openclaw#144226 Punchcard-Session: cobalt-harbor-valley-dg
What Problem This Solves
Fixes an issue where Mac Computer sessions lost access to an idle desktop or retained stale work after a lock or disconnect. Session Desktop links also waited for unrelated environment discovery and could remain on Retry after a machine disappeared. Ready-worker refill could fail after the seed session's worktree was archived, and reserve cancellation or confirmed provisioning cleanup could leave teardown unfinished.
Live validation also found two defects: launching a discovered Mac app used an argument unsupported by the Mac driver, and approving a connected node's changed capabilities removed its hosting capacity until it reconnected.
Why This Change Was Made
The native desktop owner holds bounded assertions for authorized executions, retires stale executions, and releases execution-scoped held input on lock, expiry, cancellation, or route loss. The existing device-settings bridge provides an explicit unattended-hosting confirmation and reports locked, unlocked, or unknown state. Manual lock remains effective, and Screen Sharing supplies normal sign-in. Physical cancellation of an already-running driver gesture remains a separate limit below.
The Desktop presenter resolves the exact session and environment before loading global inventory. Missing machines return to the picker; temporary failures retain Retry. Prepared snapshots retain the admitted commit through the canonical repository and managed archive owner. Reserve cancellation uses the existing cancellation owner; confirmed provider cleanup finalizes teardown and enrollment ownership while preserving the original error. Uncertain cleanup remains owned for recovery.
After reapproval, the Gateway notifies the exact authenticated connection to republish current runner facts through the shared publication owner. Generation fences reject late acknowledgments and replaced routes, without interrupting active invocations or forcing hosting on. Mac app launch uses its discovered bundle identifier or name; Linux and Windows retain their platform-specific launch paths.
Compatibility follows the existing owners: unattended hosting is a new native preference that defaults off and requires confirmation, without changing macOS power or lock settings. Lock recovery intentionally requires normal sign-in and a fresh Computer execution. Bundled provider cleanup and the SDK ship together; arbitrary independently installed version combinations are outside the package proof. This change adds no SQLite DDL or schema version; durable cleanup uses the existing lifecycle, with close/reopen and upgrade-continuity evidence below.
User Impact
Mac Computer jobs can keep an authorized desktop available, and operators can opt into keeping an unlocked hosting Mac awake between jobs. Desktop links open directly, ready-worker refill survives seed cleanup, capability reapproval restores current hosting capacity, and discovered Mac apps launch through the supported native interface. Existing expiry, consent, and cleanup authority remain in effect.
Evidence
Current validation
The reviewed head is
41c9584. Exact-head CI passed on attempt 1: 133 jobs succeeded and six were skipped, including successful Android Play, macOS, iOS, planner, and real-Gateway UI lanes. Merged ascc0d3cathrough the native maintainer workflow. Main advanced during CI; after merge, 214 planner and precise-owner tests passed on the exact merged commit, including the newly combined upstream packing behavior. This focused proof is separate from the reviewed-head hosted CI. Live Mac and serving-Gateway evidence below remains labeled7355191; the full current app and runtime are not identical to that build.7355191; the UI adapter has new source-level proof, not new current-head live proof. Incoming chat/catalog/auth work, release metadata, Bonjour logging, and SQLite worker-registration changes prevent a whole-app or whole-runtime equivalence claim.add8f2aexposed a Wear fixture race: it spent 150 ms of a 200 ms channel-discovery window before releasing the replacement transport. The test now observes actual reservation through the old owner's stop callback, then deliberately holds bounded cleanup for 300 ms to cross that discovery deadline. The 200 ms discovery and 1,000 ms assertion deadlines remain unchanged; cleanup releases and joins the callback. On macOS with Gradle 9.7.1 and Temurin 21.0.12.1+1, the full registry class passed 22 tests, a temporary deadline-wrap mutant failed the intended single null-claim case, and the restored class passed all 22 again. Kotlin test-source lint and independent P2 review passed; no production mutation remains. This does not resolve that CI run's separate Play failure: Temurin 21.0.10 crashed inlibjvm(Node::uncast, SIGSEGV, exit 134). The local pass is not a Linux CI rerun or a toolchain fix. The final41c9584hosted Android Play lane passed; the prior JVM crash did not recur, but its cause remains unproven.2b4f7cfsent neither a model-change request nor a chat message. The repair passed a fresh build, seven focused real-Gateway/readiness tests, changed-file checks, and independent review; the passing recording shows one model-change request and the expected persisted thinking state.Live and package proof
CI on live-tested
7355191passed with 135 successful jobs and six skips. Three jobs were initially cancelled before runner assignment, with no steps executed; the unsuccessful-job rerun completed all three. The affected native suites passed all 125 identified cases, including reapproval; the complete macOS run passed 2,174 tests across 240 suites and the shared kit passed 1,695 across 132 suites. The reapproval repair also passed 227 focused tests and the complete changed-file gate, including 1,147 macOS TypeScript harness tests. Focused Gateway, plugin, Desktop browser, refill, cancellation, and cleanup proof passed with independent review.7355191ARM artifact passed 120 verification commands, all 22 native payload checks, both worker-readiness orders, and archive round-trip validation. Its bundled Node/plugin passed the two Darwin launch-mapping cases against a synthetic MCP peer; the original registered launch defect and both regression cases failed before repair, and all 21 platform cases passed after it. In the QA VM, registered discovery, TextEdit launch, typingA, native readback, and independent capture passed. Reapproval used an explicitly labeled request with the node's unchanged capability surface and normal approval RPC: app, driver, worker, and connection stayed unchanged, one hosting slot returned, and the existing execution's window reference still read the document. After normal Lock Screen and 6.735 seconds locked without input, normal sign-in preserved the processes. The old execution's attemptedBfailed withCOMPUTER_EXECUTION_CLOSED; a fresh execution readA, appendedC, and readAC. Both executions were closed.7355191remained unlocked for 1,333.856 seconds (22 minutes 13.856 seconds), with 24 passive samples, unchanged identities, both OpenClaw assertions, strictly increasing HID idle time, and no guest input or Computer calls during the interval. No RFB or caffeinate helper was present at baseline or end; the power policy stayed unchanged, and macOS recorded the OpenClaw display-idle assertion as the reason sleep was blocked. One Parallels process-read error succeeded on a single repeated read and remains recorded. End evidence completed before the next input. A fresh registered execution then readAC, appendedD, and readACD, confirmed by an independent visible capture; it was explicitly closed. Screen Saver Never, password After 5 minutes, keyboard navigation, unattended hosting off, and the complete original power policy were restored. There are no active Computer executions or OpenClaw assertions, and the passive observer is joined. This phase required no app or Gateway restart.49e16c6in the isolated macOS 26.6.2 ARM VM passed snapshot, observation, typing/readback, and capture. With unattended access off and no input or helper assertions, macOS automatically locked at its configured 20-minute threshold; the final observation was after 23 minutes. That artifact's on interval never started because opt-in setup did not reach a stable baseline. Its off result is reused only for identical availability owners; the completed7355191on interval does not make this a same-artifact A/B test. Earlier signed Intel evidence covers locked-state rejection, normal sign-in, capture, app-owned assertions, unattended confirmation, background control, and manual-lock release of held input. Those results retain their original artifact identity and do not certify physical cancellation of the pinned driver's long gesture.7355191dev Gateway passed qualification against the original immutable state snapshots, RPC/health/readiness, and a zero-error startup audit. All changes were accounted for, including an existing idle worktree retirement whose 21 retained files matched its Git snapshot by content and mode. The raw database comparison remains non-identical; qualification neither rewrote snapshots nor replayed the update. The original maintenance lock was preserved and the canonical lock released after fresh same-process proof. In the sealed package, the compiled Crabbox producer, public SDK export, and Gateway consumer resolve the sameWorkerProviderErrormodule; confirmed/indeterminate cleanup, original cause, lease identity, and forged shapes pass. Separate retained source tests cover real SQLite close/reopen, enrollment retirement, and no provisioning replay. This combines package-binding and source lifecycle evidence; it does not claim an induced real provider failure across a packaged restart.Historical CI on
49e16c6passed with 135 successes and six skips. CI on9a7c2074and2b4f7cfeach finished with 133 successes and six skips, with the respective layout/readiness test failures described above. These runs are not final-head CI. The earlier49e16c6dev Gateway passed session/transcript continuity, database integrity, unchanged auth stores, RPC/health, and startup audit; verification-only recovery reconciled plugin-index projection and update-check time against original snapshots and released its lock without another restart. An earlier Matrix Doctor timeout remains unexplained; its timeout was not increased.Remaining limits
The broader startup performance goal remains unproven. Three real ready-worker diagnostics reached the original exact-color criterion in 10.266, 24.089, and 21.919 seconds, with stable desktop/node observations and verified OpenAI API-key inference. Connected canvases appeared in 3.738–4.270 seconds. A separate same-session reconnect showed an inspected complete desktop 503.9–525.0 ms after canvas creation while one color remained one shade off for over a minute; the trace confirms noVNC JPEG decoding. This reveals a limitation of the exact-color criterion, but does not retroactively pass those timings or establish warm p95. The remaining cohort, burst, restart, and expiry evidence is unfinished, and cold allocation still takes minutes. Those diagnostic workers and the naturally expired spare were cleaned up. After supported browser-bootstrap recovery, two separately admitted
7355191diagnostics ran: a reserve-miss cold allocation and a warm run consuming the exact ready refill. The first readable pairs appeared in 277.419 seconds and 5.691 seconds respectively; the warm controlled pair appeared at 10.093 seconds. Both visual usability checks failed: an Xfce notification-selection dialog persisted through every expected File-menu capture, with no confirmed menu opening. Escape later dismissed the dialog. These results do not pass the usable-desktop or p95 target. The source comparison shows no PR-added desktop-session or panel start; the specific dialog cause remains unproven. Both runs disposed observers, disconnected their viewers, reclaimed and archived their sessions, and confirmed worker cleanup. Both sessions also returned exactlyREADYthrough the OpenAI Responses API-key route; the particular credential identity was not captured per run. The observed refill retired after its original expiry, and the later warm activation produced one further reserve under its own fixed 15-minute demand window. That reserve also retired naturally. Final inventory is zero active workers, zero reserves, and zero pending capacity. The original single-reserve watcher remains recorded as unresolved because it required immediate global zero; separate root reconciliation preserves that result and proves the final cleanup. The two earlier browser preflight failures remain retained.A 10-second CUA drag continued for about 9.992 seconds despite a 3-second invocation deadline. The pinned CUA 0.22.2 gesture has no cooperative physical cancellation. This PR does not patch that dependency or claim that case passed. Earlier isolated provider timeout/host-loss failures also remain recorded; subsequent healthy workers do not establish their causes.