Repository navigation
refactor(tray): extract final App orchestration owners - #1088
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 9:42 PM ET / August 14, 2026, 01:42 UTC. ClawSweeper reviewWhat this changesThis PR moves tray-app activation routing, saved-settings effect sequencing, and ordered shutdown mechanics into dedicated coordinators while retaining App as the startup composition root. Merge readinessKeep open: the author is a collaborator and the PR is actively landing, so it requires explicit maintainer handling. Local read-only source inspection was blocked by the sandbox before an exact-head lifecycle review could be completed. Priority: P2 Review scores
Verification
How this fits togetherThe WinUI tray app converts launches, toasts, deep links, and forwarded activations into UI actions, then applies saved settings to gateway, MCP, tray, and telemetry services. These paths also determine how the app drains work and releases those services during shutdown. flowchart LR
A[Launch and toast input] --> B[Activation router]
C[Saved settings] --> D[Settings coordinator]
B --> E[Tray App actions]
D --> F[Gateway MCP tray telemetry]
E --> G[Shutdown request]
F --> G
G --> H[Ordered shutdown coordinator]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land only after a maintainer completes exact-head review and the pending lifecycle checks confirm equivalent activation, settings, and shutdown behavior. Do we have a high-confidence way to reproduce the issue? Not applicable. This is a refactor PR, and review concerns behavioral equivalence rather than reproducing a reported defect. Is this the best way to solve the issue? Unclear. The proposed ownership split matches the documented App reduction direction, but the exact current head could not be independently inspected because the read-only sandbox failed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3a097bc85f7b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
53a4d0b to
7a2b6b8
Compare
|
Maintainer scope decision: keep A3 as one final App-orchestration layer. The product owner explicitly requested fewer consolidated PRs. Activation routing, post-save settings coordination, and ordered shutdown are the three remaining App-owned orchestration seams and share the same composition adapters, lifecycle fencing, disposal order, ledger closeout, current-head runtime proof, and rollback boundary. Each owner still has its own typed contract, authoritative/closed ledger rows, deterministic behavioral guards, focused tests, and independently reviewed invariants. Splitting this already validated final layer would add stack/cascade risk without changing runtime ownership or proof. I accept the combined A3 scope for normal maintainer review. The branch remains mergeable; local exact-current build, Shared, Tray, Connection, Setup, FunctionalUI, Integration, Native UI, Accessibility, focused lifecycle, and SetupAndConnect E2E are green. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <[email protected]>
7a2b6b8 to
27afcd4
Compare
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c9ce1f9c-5e46-4d33-bd1a-d670a04e36a6
Remove unused coordinator interfaces and callback compatibility paths, keep settings application synchronous and serialized, and trim tests for deleted protocols. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c9ce1f9c-5e46-4d33-bd1a-d670a04e36a6
Current-head UI proofRebuilt c5331f2 and launched the dev side-by-side identity with a fresh synthetic OPENCLAW_TRAY_DATA_DIR. The screenshots were reviewed before upload: no user account, gateway credential, device identifier, username, or filesystem path is rendered. 1. Connection deep link A secondary-process openclaw-dev://hub/connection activation reached the isolated app and showed the expected no-gateway / MCP-only state. 2. Settings deep link and persisted change A secondary-process openclaw-dev://hub/settings activation opened Settings. UI Automation toggled Show tool calls and usage on, and the isolated settings file persisted ShowChatToolCalls: true. 3. Chat deep link while disconnected A secondary-process openclaw-dev://hub/chat activation routed to the native disconnected-chat fallback instead of silently doing nothing. |



Extracts the final App orchestration owners while keeping startup and service construction in
App. PR #1085 is merged, so this branch is based directly onmain.Summary
ActivationRouterfor launch, toast, deep-link, and forwarded single-instance activation planning, confirmation, redaction, current-user IPC, and lifecycle quiescence.DeepLinkActionsandToastActivationActionscallback bags that production no longer used.SettingsChangeCoordinatorthat owns detached snapshot classification and exact post-save effect ordering. A reentrant monitor lock serializes concurrent MCP writes while preserving per-caller exceptions and mainline reentrant behavior.AppShutdownCoordinatorfor first-wins shared-task shutdown, ordered per-step catch/log/continue, and final Exit exactly once.AppInstanceredirection is intentionally deferred because packaged, portable, dev, post-setup, and isolated-test behavior require separate proof.Reduction result
Compared with the prior PR head, the reduction commit removes 1,377 lines and adds 350.
mainThe remaining production growth is primarily the extracted App route application, shutdown-plan construction, current-user IPC owner, and their typed plans. It is not a new parallel platform layer.
Ownership transfer
ActivationRouterApp.OnSettingsSavedclassification and effect orderSettingsChangeCoordinatorAppShutdownCoordinatorApp remains the sole composition root and startup owner.
Validation
.\build.ps1: all 5 projects passed; documentation validation passedOpenClaw.Shared.Tests: 3,654 passed, 32 skipped, 0 failedOpenClaw.Tray.Tests: 2,468 passed, 0 skipped, 0 failedReal behavior proof
Current-head automated proof covers activation route equivalence, current-user IPC bounds and forwarding, confirmation cancellation/drain, settings effect order and concurrent MCP admission, shutdown ordering, first-wins behavior, and failure continuation.
Interactive UI proof was not repeated for this reduction commit because it intentionally changes no visible UI. Fresh current-head CI and E2E proof is pending after this push. Previous live proof on the branch covered isolated MCP-only startup, second-process deep-link forwarding, Connection fallback UI, natural tray shutdown, and ordered shutdown logs.
Adversarial review
Claude Opus and GPT Codex independently reviewed the complete reduced diff. Verified findings were fixed:
mainby occurring before effectsActivationRouter.StopAsyncno longer exposes an ignored cancellation tokenBoth reviewers found no remaining actionable correctness or security issues in the final diff.
Architecture
Adds authoritative and closed ledger rows for activation, settings coordination, and shutdown. Startup remains in
App.OnLaunchedAsync;AppBootstrapperremains planned and deferred.