Skip to content

fix(macos): serialize Cron refreshes and stabilize native fixtures - #138209

Merged
steipete merged 7 commits into
mainfrom
codex/macos-dashboard-readiness-observation
Sep 4, 2026
Merged

steipete merged 7 commits into
mainfrom
codex/macos-dashboard-readiness-observation

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem and repair

A successful macOS Cron deletion could disappear from the Gateway yet return to the displayed list. Manual, polling and post-mutation refreshes called the loader directly; its isLoadingJobs guard discarded the post-delete refresh while an older response was pending. That older response could then publish the deleted row.

All refresh entry points now use the existing cancellation-and-drain task chain. A replacement cancels and waits for its predecessor before loading; direct callers propagate cancellation only to their captured task, never a newer caller's task. The old loading guard and bypass path are removed. Source leases, generation checks, final-consumer stop and route retirement remain the publication boundaries. No new queue, pending flag, fallback, configuration, schema or protocol is added.

The branch also removes the redundant same-lease hello refresh that duplicated startup reads. New-lease adoption still refreshes. Native fixture repairs establish Dashboard focus/readiness and shared config ownership, replace a request-observation spin loop with the existing async gate, remove WebChat's unrelated five-second semaphore while preserving all four no-reopen assertions, and supply the settings layout's inert Tailscale dependency. Canonical ConfigStore repair #138207 is retained without a duplicate patch.

Production: +18/−8, net +10. Tests/support: +233/−171, net +62. Docs: +2. The production growth is the single-owner wrapper and exact-caller cancellation propagation needed to replace the bypass path; there is no parallel implementation. Most Dashboard edits are indentation for isolation. Release-note context: prevent deleted or updated Cron jobs being overwritten by an older read, and avoid duplicate startup status/list requests. The menu-bar docs describe the refresh guarantee. No dependency, permission, timeout or retry policy changed.

Reproduction and verification

  • The frozen-response regression failed on unchanged c2aadeae: deletion completed, no replacement cron.list arrived, and the old response restored [job-a, job-b]. It failed in 0.030 seconds. The same complete test body passed after repair in 0.052 seconds. Its interleaving is established by actual removal completion or replacement-request admission, not a sleep.
  • Direct-caller cancellation now joins the existing pane-stop success/failure table. The original cancellation-resistant endpoint table additionally acknowledges cancellation before its unchanged 350 ms exclusion interval and two-second replacement observation. An instrumented c2 run recorded actual held-lookup exit before replacement delivery in all three variants; it did not reproduce the hosted failure and is not claimed to establish its sole cause.
  • Focused candidate proof passed 28 tests / 69 expanded cases across three suites: CronJobsStoreTests, CronGatewayOwnershipTests and SimpleTaskSupportTests. It covers source changes, retained actions, stop/reopen, direct cancellation, scheduled replacement and late hello.
  • The full default native command passed once: four XCTest cases in original order, plus 2,102 Swift Testing tests across 219 suites in 181.466 seconds. All 1,008 native input hashes and 16 pinned dependencies matched before and after. No candidate retry or diagnostic patch was used. The disposable Mac used macOS 26.5, Xcode 26.5 and Swift 6.3.2; the established AppState exclusion is not named-Keychain or hosted-toolchain proof.
  • The changed gate passed formatting, Swift lint, all three macOS Node tooling partitions and native schema v15 checks. Prior WebChat negative control made all four retained no-reopen assertions fail when owner cancellation was removed; production was restored before green proof. Prior candidate delayed-hello proof changed status/list counts from 1/1→2/2 to 1/1→1/1, with ten warm starts each retaining one of each.
  • Deslop is complete. Managed Codex review of the final staged candidate passed all three complete-file evidence batches with no actionable P0–P2 findings; prior reviews remain scoped to their captured heads.

Current candidate: 3da6d7a97cb10aacd544ec70c02cedca916a47db. Required hosted CI passed on attempt two: 11 successes and 23 skips, with the required app-15368 gate green on this exact head. Only zero-step runner admission was retried; completed checks were retained.

Hosted native jobs checked out merge dde545909b95a4d118422e4a17b692ff8b061648, combining the exact PR head with main 94ae415c565088667b594c16edc77791b516ed21. All eight PR files match the reviewed candidate byte-for-byte. This integrated run passed 1,629 shared Swift tests / 124 suites (plus 60 XCTest cases, two skipped), 2,109 app Swift tests / 220 suites (plus four XCTest cases), both named AppState tests with real default-Keychain/catalog readback, and the health render. The original three replacement variants passed in 6.832 seconds; the new deletion regression passed in 0.984 seconds. Release compilation also passed.

Hosted gate and review disposition

The latest c2 required CI run failed its event replacement assertion and aggregate: seven successes, two failures, 25 skips. The request observer already performed a final post-deadline read, so it was not patched. Investigation instead found the untracked direct-refresh owner and missing cancellation-admission acknowledgment described above. The historical event-only phase remains unproven; the repaired owner/fixture candidate has now passed the required hosted gate, including the previously failing table. This addresses ClawSweeper's request to repair the owner/fixture boundary and complete the native gate without relabeling old success as new proof.

Earlier 5bba required CI passed release, shared/app suites and both named AppState tests, including real default-Keychain/catalog readback. A subsequent overlapping main readiness repair required a mechanical refresh. Initial zero-step runner-admission stalls received one failed-only recovery through the workflow's existing hosted route; this did not retry failing tests or change runner policy.

The requested full matrix at f066 finished 191 successes, three failing lanes plus the derived gate, and one skip. Windows, Android, iOS builds/tests/screenshots, all six QA profiles, macOS release, macOS Node shards and shared Swift tests passed. Failures were generated native/UI translations and the unchanged second-request DashboardHTTPFixture timeout. Native translations remain owned by #138372; UI's 143 later keys require canonical regeneration after #138401. The HTTP fixture subsequently passed but its earlier phase remains unproven; bounded connection events and URLSessionTaskMetrics are the named follow-up. Canonical QA repair #137342 is retained; no duplicate patch or permission bypass was applied.

Other named follow-ups: existing continuation diagnostics, prior Skills wait failure, the profile-window blocking fixture and Settings preview dependency. This PR does not claim to fix them. No required CI was bypassed.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: XS maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 5:38 PM ET / 21:38 UTC.

ClawSweeper review

What this changes

The branch removes a duplicate macOS Cron refresh after a delayed Gateway snapshot and makes several native test fixtures deterministic.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open. The lease-adoption path makes the Cron deduplication a sound owner-level change, but the exact-head macOS Swift check still fails in the replacement-refresh case and the PR reports no established cause or repair.

Priority: P3
Reviewed head: c2aadeae603e5314a34e609c3df73aba8ebb3ec6

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused Cron repair is well-scoped, but the unresolved exact-head native test failure prevents a higher readiness assessment.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to this member-authored PR; the body records native after-fix runs, but the current exact-head Swift test failure remains a separate merge blocker.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to this member-authored PR; the body records native after-fix runs, but the current exact-head Swift test failure remains a separate merge blocker.
Evidence reviewed 5 items Current-main behavior: The current main implementation schedules a refresh on lease adoption and then unconditionally schedules another refresh for every snapshot; a delayed snapshot on the already-adopted lease can therefore initiate a second read.
Snapshot delivery contract: A new subscriber is immediately sent the connection's cached snapshot before it is registered for later pushes, which establishes the delayed-hello path addressed by this change.
Introduced repair and regression coverage: The branch retains the refresh on adoption of a new lease but deletes the same-lease snapshot refresh, and adds a late-snapshot case that expects no second cron.list request.
Findings None None.
Security None None.

How this fits together

The macOS Cron store subscribes to Gateway snapshots and polls the active Gateway for scheduler status and jobs. It supplies the same cached job state to the Settings view and menu-bar summaries.

flowchart LR
  A[Gateway poll] --> C[Cron jobs store]
  B[Delayed Gateway snapshot] --> C
  C --> D{New server lease?}
  D -->|Yes| E[Refresh scheduler and jobs]
  D -->|No| F[Keep current data]
  E --> G[Settings and menu bar]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head macOS Swift test failure leaves the Cron refresh-drain invariant unproven; merging before its cause is resolved could retain a flaky or broken native test path.
  • Complete next step (P2) - Resolve the exact-head Cron replacement-refresh test failure, or establish it is unrelated with focused evidence, before merge.
Agent review details

Security

None.

PR surface

Other -12. Total -12 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 7 153 165 -12
Total 7 153 165 -12

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-2; tests/support +153/-163 The runtime change is a two-line deletion; the remaining changes are native test-fixture stabilization and regression coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve the lease-adoption deduplication, establish why the replacement-refresh test does not observe its post-drain request, repair that owner or fixture boundary, and rerun the exact-head macOS Swift test gate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve the lease-adoption deduplication, establish why the replacement-refresh test does not observe its post-drain request, repair that owner or fixture boundary, and rerun the exact-head macOS Swift test gate.

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

Yes—source inspection reproduces the causal sequence: a subscriber receives a cached snapshot after polling has already adopted that lease, and current main schedules another refresh. The reviewer did not execute the native test locally.

Is this the best way to solve the issue?

Yes for the duplicate read: retaining refresh only when a new lease is adopted is the narrowest owner-boundary fix. Overall merge readiness remains unclear until the failing replacement-refresh check is explained and passes on the exact head.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2329399cf6a9.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: This is a contained macOS efficiency and test-reliability repair with no demonstrated user-facing outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to this member-authored PR; the body records native after-fix runs, but the current exact-head Swift test failure remains a separate merge blocker.

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)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve or source-disprove the exact-head Cron replacement-refresh failure, then complete the macOS Swift test gate.

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-04T13:41:31.773Z sha aa5b779 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-04T14:40:44.462Z sha aa5b779 :: blocked before merge. :: none
  • reviewed 2026-09-04T16:15:04.064Z sha 8075b7c :: blocked before merge. :: none
  • reviewed 2026-09-04T16:59:45.424Z sha 8075b7c :: blocked before merge. :: none
  • reviewed 2026-09-04T18:40:21.721Z sha f6f0160 :: blocked before merge. :: none
  • reviewed 2026-09-04T19:40:17.297Z sha 427acfa65d3898913ba94e9a8a98bfe888f29882 :: blocked before merge. :: none
  • reviewed 2026-09-04T20:02:06.044Z sha 5bba369 :: blocked before merge. :: none
  • reviewed 2026-09-04T20:55:11.581Z sha c2aadea :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/macos-dashboard-readiness-observation branch 3 times, most recently from aa5b779 to 8075b7c Compare September 4, 2026 16:07
@steipete steipete changed the title test(macos): check dashboard readiness before timing out test(macos): stabilize dashboard readiness and recovery fixtures Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final head adds a reproduced recovery-fixture focus repair and replaces its request-observation spin loop with the existing async gate. All 19 focused dashboard tests and the default native partition (2,084 tests/218 suites) pass in a disposable VM. The refreshed head is 8075b7c; all six reviewed owner/test modules are byte-identical after refresh. Managed P0–P2 review is clean.

Final ordinary CI and the broader hosted run are in progress. The earlier Cron timeout remains documented and is not claimed fixed by these dashboard changes; the broader run's localization-check failures are being investigated. Required CI must pass before landing.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete steipete changed the title test(macos): stabilize dashboard readiness and recovery fixtures fix(macos): deduplicate Cron startup and stabilize native fixtures Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The native repair now includes the reproduced duplicate Cron startup trigger, shared ConfigStore/Dashboard fixture isolation, and deletion of the timing-only primary WebChat watchdog. The final disposable-Mac run passed 2,084 tests in 218 suites; the preserved WebChat behavior failed in all four cases under the deliberate owner-fence negative control. Fresh managed reviews are clean. The PR body records exact proof, prior failures, and remaining hosted gates; please reassess this expanded candidate.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the codex/macos-dashboard-readiness-observation branch from f6f0160 to f066d53 Compare September 4, 2026 19:03
@steipete
steipete force-pushed the codex/macos-dashboard-readiness-observation branch from 427acfa to 5bba369 Compare September 4, 2026 19:47
@steipete
steipete force-pushed the codex/macos-dashboard-readiness-observation branch from 5bba369 to c2aadea Compare September 4, 2026 20:36
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 4, 2026
@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Sep 4, 2026
Route manual, poll and post-mutation reads through the existing cancellation-and-drain task chain so an older list cannot restore a deleted job. Preserve exact-caller cancellation and source-generation publication guards. Add a frozen-response regression that fails before the repair, cover caller cancellation, and acknowledge cancellation before the held-endpoint replacement check.

Validation: 28 focused tests across 3 suites; 4 XCTest cases plus 2102 Swift tests across 219 suites in one isolated full native run; changed gate and managed Codex review passed. The earlier hosted event-only timeout remains a distinct unproven phase until current-head CI completes.
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 4, 2026
@steipete steipete changed the title fix(macos): deduplicate Cron startup and stabilize native fixtures fix(macos): serialize Cron refreshes and stabilize native fixtures Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 3da6d7a97cb10aacd544ec70c02cedca916a47db adds a reproduced Cron owner repair. A successful deletion previously dropped its refresh while an older manual list was pending, allowing the deleted row to return. The identical frozen-response test failed before the fix and passes after routing every refresh through the existing cancellation-and-drain chain, with exact-caller cancellation preserved.

The original event replacement fixture now explicitly acknowledges cancellation before its unchanged exclusion and replacement deadlines. Its historical hosted failure phase remains unproven; the PR does not claim the separate stale-list defect was its sole cause.

The current candidate passed 28 focused tests / 69 cases across three suites, then the full default native command: four XCTest cases and 2,102 Swift tests / 219 suites, with all input/dependency hashes verified and no retry. Changed checks and managed Codex review passed. The PR body preserves prior hosted failures and review disposition. Current required CI is https://github.com/openclaw/openclaw/actions/runs/33923636281 and must pass before landing.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit c1f31ea into main Sep 4, 2026
102 of 107 checks passed
@steipete
steipete deleted the codex/macos-dashboard-readiness-observation branch September 4, 2026 22:36
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…penclaw#138209)

Manual, polling and post-mutation Cron refreshes bypassed the scheduled task owner. A successful deletion could drop its required refresh while an older list was pending, then show the deleted row again. Route every refresh through the existing cancellation-and-drain chain, propagating caller cancellation only to its captured task. Preserve lease/generation publication and consumer lifetime boundaries; remove the redundant delayed same-lease hello refresh.

Native fixture cleanup establishes Dashboard readiness/focus and shared config ownership, replaces request-observation spinning with the existing gate, removes an unrelated WebChat semaphore while retaining all four no-reopen assertions, and supplies the settings layout's inert Tailscale dependency. Keep canonical ConfigStore repair openclaw#138207. Document the Cron refresh guarantee.

Proof: frozen-response regression failed before and passed with the identical test body afterward; 28 focused tests/69 cases; 4 XCTest and 2102 Swift tests/219 suites in one isolated full run; changed gate and managed Codex review passed. Required CI 33923636281 on 3da6d7a passed 11 jobs with 23 skips. The integrated checkout passed 1629 shared Swift tests, 2109 app Swift tests/220 suites, the XCTest suites and both named Keychain/catalog tests. The one rerun recovered zero-step runner admission only. Prior full matrix (191 success/4 failure/1 skip) and historical event-only/HTTP-fixture uncertainty remain documented in the PR.

Production +18/-8 (net +10), tests +233/-171, docs +2. The added runtime lines replace the untracked bypass with one owner and exact-caller cancellation; no new queue, config, protocol, store, dependency, timeout or permission surface.
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant