Skip to content

refactor(macos): make the sidebar roster the single session owner - #161745

Merged
steipete merged 4 commits into
mainfrom
steipete/mac-sidebar-owner-b1
Sep 30, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/mac-sidebar-owner-b1

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Parallel macOS sidebar parity work needs one session roster owner so mutations and delayed query results cannot leave consumers with different row facts.

User Impact

Internal ownership refactor with no intended visual change; no screenshots. Existing requests and UI remain in place. iOS retains its legacy VM path. The status menu and Quick Chat keep their independent query contracts. No new Gateway protocol, configuration, dependencies, or persistent stores.

Why This Change Was Made

The full macOS chat window opts into one canonical roster. The sidebar, agent navigation, palette, Threads manager, inspector, conversation metadata and native fallback swarm read owner projections. Query consumers retain membership identities; optimistic edits, acknowledged fields, rollback, observer updates, settings writes and authoritative membership removal reconcile at that owner. Projections are memoized by agent scope or query membership and invalidated at the owner's change boundary; swarm decoration also invalidates on local activity changes.

Paging, server/transcript search, status/all-agent controls and request-state UI follow separately on this owner. Known follow-up: the Mac settings adapter currently drops the shared patch's expected-session and permission/tool CAS fields; this PR does not claim those fields fence Mac dispatch.

Evidence

  • Wire-shaped fixtures cover all eight optimistic mutation cases, receipts versus older reads, settings/observer ordering, authoritative absence, cache ingress and foreign/archived rows. Each macOS consumer observes a mutation exactly once. New count assertions prove 20 unchanged reads compute each projection once; uncached controls failed with eight assertions (50.16s wall).
  • Focused shared-kit run: 124 tests across eight suites passed (50.15s wall; 1.356s execution). Final expanded cache/activity checks: 45 tests across three touched suites passed (21.52s wall; 1.084s execution). No sleeps or timing-based assertions.
  • App build, test compilation, formatting, changed-file checks and independent P2 reviews: final results below. The app and full native test suite were never launched on the operator Mac.
  • Native localization verification passed in 24.57s; no strings changed.

App builds passed: native 55.55s, plain debug 37.64s; native test compilation passed in 26.70s. Mac formatting passed in 0.74s, with changed shared-kit files separately formatted. Mac lint reports the pre-existing DashboardManager.swift:1666 file-length violation (1,534 versus 1,500); the file and lint configuration match inspected main 6e6916dcfef85bdb194837d113a3c0ee09f3b0aa. The final changed-file gate reports that same sole inherited failure (81.06s).

Independent P2 review is clean for the owner refactor (215.72s), the memoization candidate (93.82s), and the requested memoization commit review (63.65s). Four commits, 23 changed files, zero pure file moves: production +755/−79 (net +676), tests +831/−4 (net +827). The production growth establishes the single owner and removes mutable consumer copies; the additional 43 net lines cache its projections.

The first CI run exposed shared Swift layout violations in iOS smoke and screenshot jobs. Commit 22795b48eb37 fixes those and moves the unchanged computed roster property to its existing owner extension, with batch intent creation moved to the owner. iOS lint now passes (1.37s); 77 focused tests pass (57.42s wall / 1.280s execution); the current debug app build passes (58.67s). Independent P2 review of this repair is clean (97.28s).

ClawSweeper found no concrete code defect. Its optional live-window rank-up is skipped under the approved host restriction: this internal ownership refactor has no intended visual change, and the operator Mac must not launch the app or full native suite. The seven-consumer observation regression supplies the direct state-boundary proof; live window behavior is not claimed.

The next hosted Mac run exposed one stale routing-test fixture: sessions.patch returned only ok:true, so the new receipt decoder correctly rejected the missing key. Test-only commit 14fc1f6a20ea supplies the Gateway key/entry shape and asserts returned receipts while retaining the agent-routing checks. Native test compilation passed in 143.00s; independent P2 review is clean (45.92s). Production code is unchanged by this correction.

Share canonical session rows across the full native window's sidebar, palette,
thread manager, inspector, and swarm projection. Keep query membership separate
from row facts, fence stale reads, and reconcile pending edits and acknowledged
fields without restoring stale copies over newer activity or settings.

Keep the existing iOS roster path and the independent status-menu and Quick Chat
queries. Validate with focused shared-kit regressions, both app builds, native
test compilation, localization verification, and a clean scoped P2 review.
Swift lint and changed-file checks retain the pre-existing DashboardManager
file-length violation, with identical source and configuration on origin/main.
@clawsweeper

clawsweeper Bot commented Sep 30, 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 30, 2026 08:03
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 4:45 AM ET / 08:45 UTC (Revision 3).

ClawSweeper review

What this changes

The branch gives the macOS full chat window one session roster that reconciles Gateway responses and local edits for its sidebar, palette, thread manager, inspector, and swarm views.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. The central change is absent from current main, and this remains a coherent PR candidate. I found no concrete defect introduced by the reviewed patch.

Priority: P2
Reviewed head: 14fc1f6a20ea26f0838d6a7fbd7fc2db9b474367

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cutover is coherent and has broad focused regression coverage, while its behavior in a launched Mac window remains unobserved.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The host identifies the author as a member, so the external-contributor proof gate does not apply. The macOS window enables the changed owner, and fixture-backed Swift tests exercise its consumers and patch receipts; no live window result is claimed. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The host identifies the author as a member, so the external-contributor proof gate does not apply. The macOS window enables the changed owner, and fixture-backed Swift tests exercise its consumers and patch receipts; no live window result is claimed. No stored-data contract changes.
Evidence reviewed 6 items Introduced owner: The introduced macOS path enables the shared roster; the owner holds rows, query membership, pending edits, receipts, and projection invalidation.
Current main: Fetched main still declares separate mutable session and swarm arrays; the new owner files are absent there and from the latest release tag.
Gateway receipt contract: The Gateway's successful single-session patch projects a result containing the canonical key and public session entry, matching the receipt shape used by the branch.
Findings None None.
Security None None.

How this fits together

The native macOS chat window receives session lists, mutation receipts, and observer events through its Gateway transport. Its views read session rows from a shared roster; iOS retains its existing path.

flowchart LR
 A[Gateway session lists] --> C[Mac chat transport]
 B[Patch receipts and observer events] --> C
 C --> D[Session roster owner]
 E[Local session edits] --> D
 D --> F[Sidebar and thread views]
 D --> G[Palette and inspector]
 D --> H[Swarm and conversation metadata]
Loading

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
Agent review details

Security

None.

PR surface

Other +1503. Total +1503 across 23 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 23 1586 83 +1503
Total 23 1586 83 +1503

Review metrics

Metric Value Why it matters
Production versus test growth production +755/−79 (net +676); tests +831/−4 (net +827) The PR body attributes production growth to consolidating roster ownership and memoizing projections; the test growth covers reconciliation and consumers.

Technical review

Best possible solution:

Use one macOS roster to reconcile session facts and local edits while preserving the separate iOS, status-menu, and Quick Chat contracts.

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

Not applicable: this is an internal ownership refactor rather than a report of a reproducible current-main defect. Focused tests exercise the intended state invariant.

Is this the best way to solve the issue?

Yes. A single roster owner fits the existing native chat boundary and the repository's ownership guidance; the patch retains the separately scoped consumers named in the PR.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 754453157b15.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded native chat state refactor with no reported urgent user-facing regression.
  • merge-risk: 🚨 session-state: The macOS window changes where session rows, optimistic edits, and delayed responses reconcile; focused boundary tests cover the principal state paths.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The host identifies the author as a member, so the external-contributor proof gate does not apply. The macOS window enables the changed owner, and fixture-backed Swift tests exercise its consumers and patch receipts; no live window result is claimed. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): 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 (2 earlier review cycles)
  • reviewed 2026-09-30T08:09:33.766Z sha 8d140a6 :: blocked before merge. :: none
  • reviewed 2026-09-30T08:21:12.149Z sha 22795b4 :: blocked before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

The first exact-head CI run failed iOS smoke and both screenshot builds on shared Swift lint rules. These are branch-caused and fixed in 22795b48eb37: iOS lint passes across 437 files, the focused 77-test run passes, and the debug app builds. Independent P2 review is clean.

ClawSweeper disposition: no concrete code or security findings. The optional live-window rank-up is skipped because the approved scope prohibits launching the app/full native suite on this operator Mac and explicitly requires no screenshots for this internal ownership refactor. The seven-consumer regression verifies that each projection observes one canonical mutation; no live UI proof is claimed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

The hosted Mac failure in run 36688528334 was the routing test's old sessions.patch fixture ({"ok":true}), which lacks the Gateway's required receipt key and entry. Test-only commit 14fc1f6a20ea replaces it with wire-shaped scoped receipts and asserts that the Mac lease returns them; the existing per-request agent-routing checks remain. Native tests compile locally (143.00s), and independent P2 review is clean. No production changes were needed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete enabled auto-merge (squash) September 30, 2026 09:01
@steipete
steipete merged commit ed70396 into main Sep 30, 2026
76 of 78 checks passed
@steipete
steipete deleted the steipete/mac-sidebar-owner-b1 branch September 30, 2026 09:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…enclaw#161745)

* refactor(macos): make the sidebar roster the single macOS session owner

Share canonical session rows across the full native window's sidebar, palette,
thread manager, inspector, and swarm projection. Keep query membership separate
from row facts, fence stale reads, and reconcile pending edits and acknowledged
fields without restoring stale copies over newer activity or settings.

Keep the existing iOS roster path and the independent status-menu and Quick Chat
queries. Validate with focused shared-kit regressions, both app builds, native
test compilation, localization verification, and a clean scoped P2 review.
Swift lint and changed-file checks retain the pre-existing DashboardManager
file-length violation, with identical source and configuration on origin/main.

* perf(macos): memoize the sidebar roster projection

* refactor(apple): keep sidebar ownership within shared Swift lint limits

* test(macos): return session patch receipts in routing fixtures
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 merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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