Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
95911b8
feat(shared): port DeviceIdentity with role-specific operator/node to…
May 4, 2026
3ae03d3
fix(shared): close Phase 1 punch list — scope persistence + role vali…
May 4, 2026
b20b5ce
feat(shared): port OpenClawGatewayClient — bootstrap + role-specific …
May 4, 2026
b69202d
feat(shared): port WindowsNodeClient — auth.deviceToken reconnect (Ph…
May 4, 2026
98bdf77
feat(tray): port LocalGatewaySetup with loopback-only WSL setup
May 4, 2026
4ab1ec6
fix(tray): close Phase 3 punch list — strip worker vocabulary, gate d…
May 4, 2026
8cc32c6
feat(tray): wire setup engine + shared identity path in App startup (…
May 4, 2026
43035ca
feat(onboarding): add SetupWarning + LocalSetupProgress routes and Se…
May 4, 2026
6a5783a
feat(onboarding): SetupWarningPage with folded security notice (Phase…
May 4, 2026
c2ad1e5
feat(onboarding): LocalSetupProgressPage bound to LocalGatewaySetup e…
May 4, 2026
99f5107
chore(onboarding): remove WelcomePage (folded into SetupWarning) (Pha…
May 4, 2026
8060ae9
feat(scripts): port validate-wsl-gateway.ps1 - 4 scenarios, loopback-…
May 4, 2026
dbd7708
feat(scripts): port reset-openclaw-wsl-validation-state.ps1 -- exact-…
May 4, 2026
32cbeae
fix(onboarding): drop time estimate + clean orphan Welcome resw entri…
May 4, 2026
1300981
docs(wsl): port wsl-owner-validation + wsl-owner-open-issues with Cra…
May 4, 2026
ce89251
feat(onboarding): localize SetupWarning + LocalSetupProgress strings …
May 5, 2026
73767c5
feat(onboarding): nav-bar Next/Back policy on LocalSetupProgressPage …
May 5, 2026
fe2de09
fix(shared): bootstrap-token wire-format consistency between gateway …
May 5, 2026
4af2581
fix(onboarding): LocalSetupProgressPage stage advancement + FailedRet…
May 5, 2026
3927451
fix(setup): operator-pair approval against CLI v2026.5.3-1 ensureExpl…
May 5, 2026
6942a81
fix(setup): two-stage operator approve (preview + explicit requestId)…
May 5, 2026
05f7be0
fix(setup): retry stage-1 approve preview on first-call race + surfac…
May 5, 2026
f2dec42
fix(setup): read gateway token in C# and interpolate as shell literal…
May 5, 2026
4d36dcd
fix(setup): treat valid preview JSON as stage-1 success regardless of…
May 5, 2026
6e532f7
fix(setup): wire pending-device approver into Phase 14 role-upgrade p…
May 5, 2026
545d95e
fix(onboarding): keep Wizard in route for Local autopair + seed Gatew…
May 5, 2026
d4e6f32
fix(onboarding): suppress Pending toast during Phase 14 auto-approve …
May 5, 2026
ba58226
fix(quicksend): resolve gateway client per-send to avoid stale-snapsh…
May 5, 2026
d4bc385
fix(app): broaden gateway client credential resolver -- Token -> Boot…
May 5, 2026
20af4f7
chore(onboarding): add diagnostics around LocalSetupProgress→Wizard a…
May 5, 2026
9e948a5
fix(tray): make UseEffect mount-once effects actually run (Bug #5)
May 5, 2026
cb010fd
fix(tray): standard local-loopback admin pair via deterministic CLI a…
May 5, 2026
f8e075f
fix(tray): persist shared gateway token via existing settings pattern…
May 5, 2026
d1cfbcf
fix(tray): wizard channel-pairing hang recovery (mirror macOS pattern)
May 6, 2026
8ff083b
fix(tray): keep wizard recovery guard set after recovery failure (Mat…
May 6, 2026
2487aef
fix(wizard): remove invented first-option selection and gate Continue…
May 6, 2026
7af7977
fix(scripts,docs): align validation env-var + remove agent planning a…
May 6, 2026
bea2bd5
fix(security): pass gateway token via env not argv
May 6, 2026
3c837f1
chore(wizard): add Phase 1 diagnostic logging for radiobutton + recov…
May 6, 2026
04c46df
fix(wizard): cache option arrays + use wizard.next for recovery resume
May 6, 2026
b3275a8
fix(wizard): wait for gateway reconnect before wizard.next to prevent…
May 6, 2026
0fafde1
chore(dev): add reset+rebuild+launch script and skill for the dev loop
May 6, 2026
5595f29
fix(onboarding): gate easy-button local setup behind existing-config …
May 7, 2026
a5727ae
chore(repo): untrack .squad/ agent coordination artifacts and add to …
May 7, 2026
c2a317d
fix(onboarding): align engine fail-closed to full existing-config gua…
May 7, 2026
37745b2
Merge branch 'master' into feat/wsl-gateway-clean
May 7, 2026
3e4c217
fix(tray): initialize tray icon BEFORE onboarding to survive fresh-bo…
May 7, 2026
8617ab5
fix(onboarding): skip chat-preview step + auto-launch chat on Finishe…
May 7, 2026
4f045c6
Merge origin/master into feat/wsl-gateway-clean
May 7, 2026
d4edab7
Fix bugs 4, 5 from PR #274 smoke test
May 7, 2026
be18fe8
Fix bugs 1, 2, 3 from PR #274 smoke test
May 7, 2026
5251eef
Wire BootstrapMessageInjector call site in App.ShowChatWindow
May 7, 2026
f9a5ef2
Fix "checking system" wizard hang on wsl.exe stdout drain
May 8, 2026
fc31f19
Actually fix onboarding finish and bootstrap
May 8, 2026
87210aa
Fix quick chat credentials and pairing toast dedupe
May 8, 2026
8c68111
Launch hub chat after onboarding
May 8, 2026
34f069e
Harden onboarding hub chat launch
May 8, 2026
5f65622
Merge remote-tracking branch 'origin/master' into feat/wsl-gateway-clean
May 8, 2026
2b12b39
Fix WSL validation tray launch path
shanselman May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,5 @@ test_ws.py

# Local visual test output
visual-test-output/

.squad/
31 changes: 31 additions & 0 deletions .squad/decisions/inbox/aaron-actually-fix-2-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Aaron: actual fixes for PR #274 bugs 2 and 3

## Bug 2 — tray quick-chat broken

Traced tray left-click to `InitializeTrayIcon()` -> `_trayIcon.Selected += OnTrayIconSelected` -> `OnTrayIconSelected()` -> `ShowChatWindow()`. The quick-chat path did use `ShowChatWindow`, but it resolved only `settings.Token` while the working operator client resolves `settings.Token`, `settings.BootstrapToken`, then stored `DeviceIdentity.DeviceToken` via `GatewayCredentialResolver`.

Changes:
- `App.ShowChatWindow()` and chat pre-warm now use the same `GatewayCredentialResolver` pattern as the operator client.
- `ShowChatWindow()` calls `ChatWindow.RefreshCredentials()` on every tray click, including newly-created windows.
- `ChatWindow.RefreshCredentials()` always rebuilds the URL and navigates initialized WebView2 to it; it no longer returns early when the same stale URL is cached.
- Added diagnostic logs: `[ChatWindow] Quick-chat credentials resolved from ...` and `[ChatWindow] Refreshing to ...`.
- Applied Mattingly Bug 4 handoff: bootstrap injection now runs from `ChatWindow` after successful WebView navigation.

Manual validation for Mike: click tray icon; tail `%LOCALAPPDATA%\OpenClawTray\openclaw-tray.log` and look for `[ChatWindow] Refreshing to ...`, then verify chat loads without login loop.

## Bug 3 — pairing toast notification storm

Searched toast paths and traced pairing notifications through `WindowsNodeClient` direct `PairingStatusChanged` emitters (`pairing.requested`, `pairing.resolved`, `NOT_PAIRED`, and `hello-ok`) plus tray toasts in `App.OnPairingStatusChanged()` and `App.OnNodeStatusChanged()`.

Changes:
- Routed all `WindowsNodeClient` pairing emitters through `EmitPairingStatusOnTransition()`; duplicates now log `[NODE] Suppressing duplicate pairing status event: ...`.
- Added a toast-boundary 30-second dedupe in `App.ShowToast(builder, toastTag, deviceId)`, keyed by `(toastTag, deviceId)`.
- Tagged node pairing pending/paired/rejected and node-connected toasts.
- Suppressed the node-connected toast if a node-paired toast was just shown for the same device.
- Added diagnostic logs: `[ToastDeduper] Showing toast tag=... deviceId=...` and `[ToastDeduper] Suppressed duplicate toast tag=... deviceId=...`.

Manual validation for Mike: complete pairing; expect exactly one node-paired toast and log line `[ToastDeduper] Showing toast tag=node-paired deviceId=...`; duplicates should log suppression.

## Validation

Ran `./build.ps1`: passed. Per fast-loop directive, skipped `dotnet test`.
45 changes: 45 additions & 0 deletions .squad/decisions/inbox/mattingly-actually-fix-1-4-5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Mattingly: actual fixes for PR #274 bugs 1, 4, 5

## Bug 1 — chat window auto-launch on Finish

Changed `OnboardingWindow.OnWizardComplete()` to ignore `WizardLifecycleState == "complete"`. The signal now is: the window is completing from `OnboardingRoute.Ready` and `StartupSetupState.RequiresSetup(settings, identityDataPath)` is false. That is the path the Finish button actually takes: `Ready` page Finish -> `OnboardingState.Complete()` -> `OnOnboardingFinished()` -> `OnWizardComplete()`.

Log to validate: `[OnboardingWindow] OnWizardComplete launching chat`.

## Bug 4 — BOOTSTRAP.md kickoff injection

Hardened `BootstrapMessageInjector`:

- Traverses shadow DOM for Lit UI controls.
- Probes and logs visible control count: `[OpenClaw] Bootstrap probe controls=N`.
- Supports `textarea`, text inputs, contenteditable, and role=textbox.
- Uses native value setters so controlled inputs see the value.
- Clicks Send/form-submit/Enter fallbacks.
- Does **not** burn `HasInjectedFirstRunBootstrap` when the script returns `no-input`; the gate is only persisted on `sent`.

Aaron still needs to move the call site to after successful chat navigation because current `App.ShowChatWindow()` can see `TryGetScriptExecutor()==null` when the WebView2 is still initializing.

Exact handoff line for Aaron in `ChatWindow.xaml.cs` NavigationCompleted success branch after `RequestChatInputFocus();`:

```csharp
OpenClawTray.Services.BootstrapMessageInjector.ScriptExecutor exec = script => WebView.CoreWebView2.ExecuteScriptAsync(script).AsTask();
_ = OpenClawTray.Services.BootstrapMessageInjector.InjectAsync(exec, ((App)Microsoft.UI.Xaml.Application.Current).Settings, initialDelayMs: 500);
```

If `App.Settings` is not exposed, add an internal property returning `_settings`, or route the existing `_settings` from `App.ShowChatWindow()` into a ChatWindow method. The important point is that the call must happen inside `NavigationCompleted` when `e.IsSuccess` is true.

## Bug 5 — autostart default/toggle

Changed `ReadyPage` to render the toggle ON as a safety default, then sync to `Settings.AutoStart` on mount and immediately call `AutoStartManager.SetAutoStart()` so a user who never toggles still gets the Run-key. The toggle handler still persists settings and updates the Run-key immediately.

Changed `AutoStartManager.SetAutoStart()` to use `Registry.CurrentUser.CreateSubKey(...)` instead of `OpenSubKey(...)`, so it can create the Run key/value when missing instead of silently returning.

Manual registry validation:

```powershell
Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Run' -Name OpenClawTray -ErrorAction SilentlyContinue
```

## Validation

Ran `./build.ps1`: passed. Per fast-loop directive, skipped `dotnet test`.
58 changes: 58 additions & 0 deletions .squad/decisions/inbox/mattingly-finish-actually-hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Mattingly — PR #274 finish should open Hub chat

## Audit

Command requested: `grep -rn "launching chat\|ShowChatWindow\|ShowHub\|OnWizardComplete" src/OpenClaw.Tray.WinUI` (run with ripgrep equivalent because `rg` was not on PATH in PowerShell; Copilot rg tool was used against the same tree).

HEAD before this fix: `8c68111 Launch hub chat after onboarding`.

Matches found:

- `src/OpenClaw.Tray.WinUI/App.xaml.cs:498` — tray icon click calls `ShowChatWindow()`.
- `src/OpenClaw.Tray.WinUI/App.xaml.cs:501` — `ShowChatWindow()` method.
- `src/OpenClaw.Tray.WinUI/App.xaml.cs:542` — `ShowChatWindow` deferred-show warning string.
- `src/OpenClaw.Tray.WinUI/App.xaml.cs:644` — tray menu `openchat` calls `ShowChatWindow()`.
- `src/OpenClaw.Tray.WinUI/App.xaml.cs:562,581,647,652,654,710,1043,1855,2809,2928,3048,3101,3603,4265` — `ShowHub(...)` method/call sites.
- `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs:587` — Finish event calls `OnWizardComplete()`.
- `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs:596` — X/Closed path calls `OnWizardComplete()`.
- `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs:620` — single `OnWizardComplete()` implementation.
- `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs:649` — required diagnostic log line.
- `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs:650,658,660,667,671,675,679` — deferred Hub chat launch helper.
- Documentation/comment-only references in `ChatWindow.xaml.cs`, `HubWindow.xaml.cs`, `VoiceOverlayWindow.xaml.cs`, and `OnboardingState.cs`.

The literal old string `launching chat` has no remaining source match in this worktree.

## Diagnosis

The log Mike captured (`[OnboardingWindow] OnWizardComplete launching chat`) corresponds to the pre-`8c68111` body of `OnboardingWindow.OnWizardComplete` in `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs`, the only wizard-completion implementation. In the current clean worktree, `8c68111` did change that exact method to log `[OnboardingWindow] OnWizardComplete launching HubWindow on chat tab` and call `App.ShowHub("chat")`.

I did not find a second `OnWizardComplete`, overload, post-finish hook, or hidden `ShowHub` fallback to `ChatWindow`. `App.ShowHub(...)` creates a `HubWindow` when `_hubWindow` is null/closed, sets state, navigates, and activates it. The remaining `ShowChatWindow()` calls are tray quick-chat entry points, not wizard finish paths.

The prior fix therefore did not take in the live run because that run was not executing source/binaries containing `8c68111` (or was launched from another stale build/worktree). To make the wizard finish path more robust and easier to verify, this follow-up keeps the exact required log line and dispatches `ShowHub("chat")` at low priority after the wizard close event settles, so the Hub opens after the wizard finishes closing and cannot lose an ordering fight to wizard teardown.

## Changes

- `src/OpenClaw.Tray.WinUI/Onboarding/OnboardingWindow.cs`
- Keeps the required log line: `[OnboardingWindow] OnWizardComplete launching HubWindow on chat tab`.
- Replaces the inline post-finish call with `ShowHubChatAfterWizardClose()`.
- The helper dispatches `App.ShowHub("chat")` on the UI dispatcher at low priority, with a direct fallback if enqueue fails.
- Adds an explicit warning if `Application.Current` is not the tray `App`.
- Updates stale bootstrap comment from `App.ShowChatWindow()` to HubWindow chat navigation.

- `src/OpenClaw.Tray.WinUI/Onboarding/Services/OnboardingState.cs`
- Updates stale route comment to say the Ready path launches the Hub chat tab, not the old chat window.

- `src/OpenClaw.Tray.WinUI/Services/BootstrapMessageInjector.cs`
- Updates stale comment to describe HubWindow chat page injection instead of post-wizard `App.ShowChatWindow()`.

## Validation

- `git pull --rebase fork feat/wsl-gateway-clean` before commit: already up to date.
- `./build.ps1`: passed.
- Tests intentionally not run per active directive: NO tests, incremental `./build.ps1` only.

## Verification log line

Mike should verify this exact line on the next finish run:

`[OnboardingWindow] OnWizardComplete launching HubWindow on chat tab`
21 changes: 21 additions & 0 deletions .squad/decisions/inbox/mattingly-finish-launch-hubwindow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mattingly: Finish opens HubWindow chat

## Summary
Onboarding completion from Ready now launches the full HubWindow directly on the Chat tab instead of the standalone quick-chat ChatWindow.

## Changes
- `src\OpenClaw.Tray.WinUI\App.xaml.cs`
- Made `ShowHub(string? navigateTo = null, bool activate = true)` internal so onboarding can reuse the existing hub-opening path.
- `src\OpenClaw.Tray.WinUI\Onboarding\OnboardingWindow.cs`
- Replaced `ShowChatWindow()` completion launch with `ShowHub("chat")`.
- Added diagnostic log: `[OnboardingWindow] OnWizardComplete launching HubWindow on chat tab`.
- `src\OpenClaw.Tray.WinUI\Pages\ChatPage.xaml.cs`
- Wired `BootstrapMessageInjector.InjectAsync` into the Hub chat WebView2 `NavigationCompleted` success path, matching the standalone `ChatWindow` gated injection behavior.

## Validation
- Ran `./build.ps1` successfully after the code change.
- Per active session directive, did not run tests after the fix.

## Architectural notes
- Hub already exposes tag-based navigation through `NavigateTo("chat")`; `ShowHub("chat")` selects the existing NavigationView item and navigates to `ChatPage`.
- Bootstrap injection remains wired in both standalone `ChatWindow` and Hub `ChatPage`; the existing global `Settings.HasInjectedFirstRunBootstrap` gate ensures only one path injects.
Loading
Loading