Skip to content

fix: accept forwarded launches during startup update prompts - #2080

Merged
bkudiess merged 2 commits into
openclaw:mainfrom
shanselman:shanselman-startup-activation-readiness
Nov 13, 2026
Merged

bkudiess merged 2 commits into
openclaw:mainfrom
shanselman:shanselman-startup-activation-readiness

Conversation

@shanselman

@shanselman shanselman commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2073
Related: #2071

What Problem This Solves

Fixes forwarded launches and deep links being dropped while a startup update prompt is open.

User Impact

User impact: Companion can respond to forwarded launches and its global hotkey while the update prompt is pending.

Why This Change Was Made

Startup starts the existing current-user listener and applies the hotkey through its settings owner before waiting for the update check.

Evidence

The startup-order and hotkey-owner guards failed before the fix and pass afterward. Named-pipe tests deliver ordinary and deep-link launches during a synthetic pending update. An isolated current-build app received both pipe payloads; the Settings route opened General. A real release update prompt was not exercised.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: current-head forwarded activation and native navigation; live isolated fixture checks below are partial, not a complete pool run.

Validation

  • .\build.ps1: passed.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 4,876 passed, 24 skipped, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 5,297 passed, 0 skipped, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --filter 'FullyQualifiedName~Startup_Order_PreservesInitializationInvariants|FullyQualifiedName~Startup_GlobalHotkey_UsesTheSettingsOwner|FullyQualifiedName~ForwardedLaunch_IsDispatchedWhileStartupUpdateCheckIsPending|FullyQualifiedName~MigrationShutdown_UsesCurrentUserIpcWithoutCreatingADeepLinkRoute': 5 passed.
  • CI run 42461228890, attempt 1, head 69a1f27b0f8452c3416c99e0026bc2432e115a95: passed change classification, fast validation, proof-pool contracts, Tray/setup/integration tests, UI/functional/accessibility tests, and CI Gate. Core/CLI and the three WSL E2E jobs were classification-skipped, not executed.
  • P0-P3 scoped autoreview: no findings, with update-dialog and migration callback implementations not supplied. Independent rubber-duck review found a misplaced test helper; fixed before final source review and validation.

Real Behavior Proof

  • Environment tested: Windows x64, Debug unpackaged current build, isolated profile and synthetic fixture Gateway.
  • PR head or commit tested: 69a1f27b0f8452c3416c99e0026bc2432e115a95; matching uncommitted source was used for the tests and live app before commit.
  • Exact steps or command run: sent openclaw://settings and openclaw://hub separately to the fixture app's current-user named pipe; observed the app via computer-use and its redacted log.
  • Evidence after fix: Settings displayed the General page after the first payload; the log recorded two IPC receipts. The ordinary launch payload kept the existing Settings surface open.
  • Observed result: both pipe writes completed and the primary app stayed responsive. The fixture host later recorded app-failed because the task-owned app process was deliberately stopped for cleanup.
  • Screenshot or artifact links verified? (Yes/No/N/A): N/A; native UI tree and local logs were observed, not a screenshot.
  • Not verified or blocked: this isolated Debug app skips the real update check. The pending-update tests inject a synthetic wait; neither a published release update dialog nor installer migration shutdown was exercised live. Full interactive proof pool and screenshot evidence remain outstanding.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation:

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No
  • If yes, list the exact upgrade steps:

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Starts forwarded activation reception and applies the existing hotkey owner before awaiting the startup update prompt.

Example: An unpackaged Release update prompt remains open when another launch requests openclaw://settings.

  • Before: The listener has not started, so the secondary process exhausts forwarding retries and exits.
  • After: The existing listener receives the request and dispatches the Settings route while the prompt remains pending.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The production repair is focused and appears correct, but supplied live evidence bypasses its defining trigger and added transport coverage is redundant.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Relaunching Companion, opening deep links, and using global hotkeys can fail while its startup update prompt is unanswered.
Reason: The maintainer-authored direction matches the linked audit lane and restores existing capabilities through their established owners.

Merge readiness

✅ Ready for maintainer review

Keep open: this collaborator-authored PR makes a focused repair to a startup defect still present on main; no introduced correctness bug was found.

Priority: P2
Reviewed head: 69a1f27b0f8452c3416c99e0026bc2432e115a95

Before merge

None.

Findings

None.

Tests

  • Low-value test tests/OpenClaw.Tray.Tests/ActivationRouterTests.cs: Remove or consolidate ForwardedLaunch_IsDispatchedWhileStartupUpdateCheckIsPending and its dedicated SignalingSink: it manually supplies the repaired ordering to unchanged router code, so it also passes on base and largely repeats existing ordinary/deep-link pipe coverage; the App source-order guard catches the actual regression.
  • Missing end-to-end proof: The reported source guards fail before the fix, but the new pipe theory does not; supplied runtime evidence does not exercise forwarded launches or hotkey enable/disable while a real Release update prompt remains open.
Agent review details

How this fits together

App composes startup services; ActivationRouter receives current-user pipe messages and dispatches typed routes onto the UI thread, while ApplyGlobalHotkey manages native hotkey registration.

flowchart TD
 A[App startup] --> B[Initialize existing services]
 B --> C[Start ActivationRouter listener]
 B --> D[ApplyGlobalHotkey]
 C --> E[Await startup update prompt]
 D --> E
 F[Secondary launch] --> C
 C --> G[UI route dispatch]
Loading

Technical review

Best possible solution:

Use the existing activation listener and hotkey owner before the update await while preserving service readiness, routing, confirmation, and shutdown ownership.

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

Main awaits UpdateDialog closure before starting the listener; a secondary launch retries for a bounded interval and exits, establishing the dropped-launch path without running target code.

Is this the best way to solve the issue?

The production diff is the smallest complete repair: change startup ordering and reuse ApplyGlobalHotkey, with no new service, state, configuration, or competing route.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e70292487958.

Provenance checked

  • Startup update versus activation ordering changes intended behavior with a stated reason (eae6626: The original WinUI port checked for updates before starting its deep-link server; no explicit requirement to suppress forwarded activation during that wait was found. The later orchestration extraction retained App startup ownership.)
  • Startup hotkey construction changes intended behavior with a stated reason (eae6626: The port initialized hotkeys directly at startup and reused them on settings changes; the PR explains why startup must now use the existing reuse path to avoid replacing a registered service.)
  • Gateway-aware update admission and native setup bypass keeps the original intent (7347631: Update admission deliberately follows connection initialization so authenticated Gateway channel policy can suppress ordinary updates; this ordering and the later native setup receipt bypass remain intact.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Verified introduction and current-main defect: The pinned diff moves listener startup ahead of the update await and replaces direct hotkey construction with ApplyGlobalHotkey. GitHub main still resolves to the pinned base, where both operations follow the update await. (src/OpenClaw.Tray.WinUI/App.xaml.cs:1092, 69a1f27b0f84)
  • Existing owners preserve the relevant boundaries: ActivationRouter retains CurrentUserOnly pipe access, payload validation, confirmation, and shutdown quiescence. ApplyGlobalHotkey reuses its existing service and honors the saved enabled preference. The migration callback revalidates installation identity and consent immediately before invoking exit. (src/OpenClaw.Tray.WinUI/Helpers/InnoMigrationHandoff.cs:26, 69a1f27b0f84)
  • Supplied validation and runtime evidence: The complete REST-read PR body reports a passing build, 4,876 Shared tests and 5,297 Tray tests, plus current-build Debug fixture activation. It explicitly states that the fixture skips updates and that the real release prompt was not exercised; discussion adds no further behavior evidence. (69a1f27b0f84)
  • Owned audit lane and earlier activation repair: Accept forwarded launches and deep links before the startup update prompt #2073 requests this exact ordering and hotkey-owner repair within Fix dangerous implicit state machines (audit lanes) #2071. The merged Fix Start menu activation for running tray app #1262 established ordinary-launch forwarding and bounded retries, but did not solve an indefinitely pending startup prompt. (src/OpenClaw.Tray.WinUI/Services/ActivationRouter.cs:56, 169afab4be58)
  • Feature history and provenance: The original Moltbot WinUI port already placed update checking before its deep-link server and hotkeys. The later orchestration extraction preserved startup in App and assigned activation and settings effects to their current owners. Some helper blame operations encountered unavailable historical blobs; App history and the original port blob were readable. (src/Moltbot.Tray.WinUI/App.xaml.cs:89, eae6626635ba)
  • Repository policy and read-only review: Read the complete root and WinUI AGENTS.md files and applied architecture, simplification, test-audit, and proof guidance. No maintainer-notes directory exists. No helper, second reviewer, build, or test was run, and the checkout remains clean. (AGENTS.md:1, 69a1f27b0f84)

Likely related people:

  • Scott Hanselman: Raw commit eae6626 adds src/Moltbot.Tray.WinUI/App.xaml.cs:135 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: eae6626635ba; files: src/Moltbot.Tray.WinUI/App.xaml.cs)
  • Barbara Kudiess: Raw commit 17a8b03 adds src/OpenClaw.Tray.WinUI/App.xaml.cs:948 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 17a8b0363a82; files: src/OpenClaw.Tray.WinUI/App.xaml.cs)
  • Karen: Raw commit 7347631 adds src/OpenClaw.Tray.WinUI/App.xaml.cs:919 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 734763131c8d; files: src/OpenClaw.Tray.WinUI/App.xaml.cs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production and test delta Production +5/-12; tests +62/-2 The production repair removes duplicate hotkey initialization; source guards protect ordering and ownership, while the added transport theory overlaps existing coverage.

Labels

Label changes:

  • add P2: The defect affects forwarded launches and hotkeys during an unpackaged Release update prompt, with recovery available by answering or closing the prompt.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The defect affects forwarded launches and hotkeys during an unpackaged Release update prompt, with recovery available by answering or closing the prompt.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Provide current-head runtime evidence through the actual Release update-prompt path.
  • Consolidate the redundant pending-update transport theory while retaining startup-order and hotkey-owner guards.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 8, 2026, 3:15 AM ET / 08:15 UTC.

@shanselman

Copy link
Copy Markdown
Collaborator Author

Hi @karkarl! I'm a Copilot triage bot posting for Scott (I'm not Scott). He asked me to assign this PR to you and see if you'd be up for reviewing it and merging it when you're happy with it.

This is one of five small fixes from the state machine audit in #2071 (Fix dangerous implicit state machines (audit lanes)). This one keeps forwarded launches, deep links and the global hotkey working while the startup update prompt is open, instead of dropping them.

CI note: CI is green here, so this might be the easiest one of the five to start with.

No rush at all, and please feel free to ask for changes or push back. Thank you so much!

@roboclaw-bot

Copy link
Copy Markdown
Contributor

PR cleanup review

Reviewed head: 69a1f27b0f8452c3416c99e0026bc2432e115a95. Main comparison: e59374c064f43d68f5c72d070d4c89ef2d20ec3b.

Source cleanup review at 69a1f27 against main e59374c: the early activation listener and reuse of ApplyGlobalHotkey are still useful changes, and current-head CI is green. The remaining acceptance gap is the exact scenario: a forwarded second launch while a real startup update prompt is pending, plus the preserved hotkey behavior. The existing Debug fixture skips update checking, so it is not that proof. Please retain this PR and add current-head Release-path evidence before landing.

Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass.

@shanselman

Copy link
Copy Markdown
Collaborator Author

Hi @karkarl, I'm a Copilot triage agent helping the maintainers overnight (I'm not Scott). Scott asked for your review on this one, so I did not merge it. I only gathered evidence to make your look quicker.

Validated locally (ARM64) on head 69a1f27b merged with current main (994539b8, clean merge, nothing pushed)

  • ./build.ps1 passed for all projects, including WinUI.
  • Full Tray test project: 6279 passed, 0 failed, 0 skipped. That includes ActivationRouterTests.ForwardedLaunch_IsDispatchedWhileStartupUpdateCheckIsPending, the AppRefactorContractTests ordering guards and Startup_GlobalHotkey_UsesTheSettingsOwner.
  • I compared the OnLaunchedAsync diff with the removed inline block. ApplyGlobalHotkey does the same unsubscribe, subscribe and Register() as the old code, and it unregisters when the hotkey is disabled, so behavior is equivalent apart from the new ordering.

The one gap I could not close: no real unpackaged Release update prompt was exercised (the startup update check is skipped for isolated runs, and I did not want to touch a real install overnight). A quick manual check would settle it: launch a non-isolated build with an update pending, then start a second launch with openclaw://settings while the prompt is open.

The Gate on this head is green but dates from Nov 8, so it predates today's main. If you want a fresh Gate before merging, "Update branch" will do it.

@bkudiess
bkudiess merged commit 03b692c into openclaw:main Nov 13, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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.

Accept forwarded launches and deep links before the startup update prompt

4 participants