Commit Graph

338 Commits

Author SHA1 Message Date
github-actions[bot]
c7630fa008
[Repo Assist] feat: wire WebView2 bidirectional nativeΓåöSPA bridge in WebChatWindow
Some checks failed
Build and Test / test (push) Has been cancelled
Copilot Setup Steps / copilot-setup-steps (push) Has been cancelled
Build and Test / build (win-arm64) (push) Has been cancelled
Build and Test / build (win-x64) (push) Has been cancelled
Build and Test / build-msix (ARM64, win-arm64) (push) Has been cancelled
Build and Test / build-msix (x64, win-x64) (push) Has been cancelled
Build and Test / build-extension (arm64) (push) Has been cancelled
Build and Test / build-extension (x64) (push) Has been cancelled
Build and Test / release (push) Has been cancelled
Adds the WebView2 native-to-SPA bridge and hardens it with origin validation, dispatcher marshaling for native posts, closed-window guards, sanitized bridge logging, and validated payload JSON.\n\nValidated locally with build.ps1, Shared tests, and Tray tests; GitHub CI is green.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 20:25:28 -07:00
github-actions[bot]
e35da4b6a4
[Repo Assist] test: add CommandCenterDiagnostics and ScreenCapability coverage
Resolved conflicts against current master and validated locally.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:50:33 -07:00
dependabot[bot]
e217438026
chore(deps): bump actions/setup-dotnet from 4 to 5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:26:53 -07:00
dependabot[bot]
aa093339f7
chore(deps): bump github/gh-aw-actions from 0.68.3 to 0.71.1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:26:49 -07:00
dependabot[bot]
6cfb8af383
chore(deps): bump actions/cache from 4 to 5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:26:44 -07:00
dependabot[bot]
30d02486ac
chore(deps): bump softprops/action-gh-release from 2 to 3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:26:40 -07:00
dependabot[bot]
209bf6fccc
chore(deps): bump actions/checkout from 4 to 6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:26:36 -07:00
Scott Hanselman
e63228e87e fix: polish tray submenu flyouts
Add monitor-aware cascading submenu windows for tray flyouts, apply rounded HWND clipping so corners do not reveal the backing window, and reduce hover repaint flicker by reusing flyout windows with no-activate tool-window styling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 18:13:07 -07:00
Scott Hanselman
f7800d87fe Merge PR #234 local MCP server mode
Some checks are pending
Build and Test / test (push) Waiting to run
Build and Test / build (win-arm64) (push) Blocked by required conditions
Build and Test / build (win-x64) (push) Blocked by required conditions
Build and Test / build-msix (ARM64, win-arm64) (push) Blocked by required conditions
Build and Test / build-msix (x64, win-x64) (push) Blocked by required conditions
Build and Test / build-extension (arm64) (push) Blocked by required conditions
Build and Test / build-extension (x64) (push) Blocked by required conditions
Build and Test / release (push) Blocked by required conditions
Copilot Setup Steps / copilot-setup-steps (push) Waiting to run
Adds the Windows tray local MCP HTTP server mode with loopback-only transport hardening, localized Settings UI, MCP-only startup support, and test coverage for the JSON-RPC bridge, HTTP security gates, cancellation, shutdown drain, and capability argument clamps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 11:50:33 -07:00
Chris Anderson
ced450f53c fix: localize MCP settings strings and lock capability list
Two follow-ups from code review:

1. Hardcoded i18n strings in SettingsWindow are now resource-driven.
   New x:Uid bindings cover the MCP toggle header, description,
   Endpoint/Status labels, plus a new "Developer Mode" section header
   above the toggle so the use case is visually scoped. Status text
   ("Disabled", "Listening", "Stopped", "Will start/stop on Save",
   "Failed to start: ") routed through LocalizationHelper. Translations
   added to en-us, fr-fr, nl-nl, zh-cn, and zh-tw. The diagnostic detail
   appended after "Failed to start:" intentionally stays in English —
   it embeds a literal `netsh http add urlacl` command that does not
   localize meaningfully.

2. NodeService._capabilities is now guarded by _capabilitiesLock on
   every read and write. The MCP bridge was previously snapshotting
   _capabilities.ToArray() on threadpool threads while the UI thread
   could be in the middle of RegisterCapabilities (Clear + adds). Low
   probability but real — a tools/list mid-rebuild could observe an
   empty or partial list. RegisterCapabilities now holds the lock for
   the full sync rebuild; DisconnectAsync's Clear and the bridge
   snapshot lambda also take it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 11:42:07 -07:00
Chris Anderson
353a4b9a53 fix: address GPT 5.5 review feedback for local MCP server
Per code review (GPT 5.5), tightens stability and operability of the
local MCP transport without changing the loopback-only trust model.

CR-003 — bound request and tool execution
  * McpHttpServer: per-request linked CTS with 90s deadline; CT propagated
    through ReadBodyAsync (slow-body defense) and bridge dispatch.
  * McpToolBridge.HandleRequestAsync(body, ct) overload uses Task.WaitAsync
    so a wedged tool surfaces as a "request timed out" tool error instead
    of pinning a handler slot.
  * SystemCapability.HandleRunAsync clamps timeoutMs <= 0 to the default
    and caps at 10 minutes — closes the "wait forever" hole that
    LocalCommandRunner.TimeoutMs <= 0 previously enabled.

CR-005 — drain in-flight handlers before disposal
  * Track active handler tasks; StopAsync(drainTimeout) cancels CT, stops
    the listener, awaits in-flight handlers (5s) before Dispose tears the
    semaphore down. Removes the Task.Run(..., ct) cancellation race that
    could leak a slot, and defensively swallows ObjectDisposedException
    on semaphore release during shutdown.

CR-007 — clamp arguments at the capability boundary
  * Screen / camera / canvas capabilities now clamp dimensions, quality,
    monitor index, durations, fps, and window position to safe ranges
    before any allocation. camera.clip floor-clamps duration so 0/-N can
    no longer slip through the original Math.Min cap.

CR-008 — surface MCP startup status in Settings
  * Categorize HttpListenerException by NativeErrorCode (5 = URL ACL
    access denied with the exact netsh remediation; 32/183 = port in use).
  * Settings status replaces the misleading "save and restart" wording
    with "Will start/stop on Save", reflecting the OnSettingsSaved flow
    that reinitializes services immediately.

Tests: 22 new test cases (timeout tool error, dispose-during-handler
hygiene, slow-body recovery, clamp behavior). Full Shared.Tests suite
remains green at 933 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 10:35:07 -07:00
Chris Anderson
86dad64f11 fix: harden local MCP server (CSRF, body cap, concurrency, tests)
Addresses review of the initial MCP HTTP server cut. Loopback bind alone
does not protect against browser-driven attacks — any page in the user's
browser is also on loopback. Adds a three-layer security gate, a body
size cap, a handler concurrency limit, and full HTTP-transport coverage.

Security
- McpHttpServer rejects requests with an Origin header (browsers always
  set it; real MCP clients never do). Validates Host against loopback
  names (DNS-rebinding pivot defense). Requires application/json on
  POST so a cross-origin browser fetch must trigger a CORS preflight,
  which we never satisfy.
- 4 MiB body cap with bounded streaming read (413 on overrun).
- 8-handler concurrency cap so a misbehaving local client cannot pin
  every threadpool thread on long-running screen/camera calls.
- Settings migration: legacy McpOnlyMode=false no longer silently
  inherits EnableNodeMode (would have flipped MCP on without consent).

Bridge
- _capabilities snapshotted to array per call (was racing concurrent
  enumeration vs UI-thread mutation).
- Non-integer / out-of-range / string ids round-trip via GetRawText
  instead of GetInt64 (used to strip the id from error responses on
  fractional or big-int ids, breaking client correlation).
- tools/call validates 'arguments' is an object if present and rejects
  empty 'name'.
- Generic 'internal error' on the wire for unhandled exceptions; full
  exception with stack goes to the log via Error(string, Exception).
- Empty resources/list and prompts/list for Cursor compat (was
  MethodNotFound).
- Non-object root → InvalidRequest.

Lifecycle
- Start() failure now disposes the half-constructed listener/CTS
  instead of leaking the port reservation.
- _disposed guarded with Interlocked.Exchange (idempotent across
  threads).
- App.xaml.cs warns when both modes are enabled but gateway
  prerequisites are missing — silent fall-back to MCP-only was
  confusing.
- NodeService.McpStartupError surfaces the actual failure to Settings
  UI; status text shows 'Failed to start: <reason>' instead of the
  misleading 'Stopped — save and restart to start'.

Refactor
- McpHttpServer moved from OpenClaw.Tray.WinUI/Services to
  OpenClaw.Shared/Mcp (no WinUI deps; lets it be unit-tested).

Tests
- 10 new McpToolBridgeTests: non-object root, missing/non-string
  params, non-object arguments, fractional/big-int/string ids,
  empty resources/prompts, generic-message guarantee on internal
  errors.
- New McpHttpServerTests (13): GET probe, valid POST, Origin reject,
  rebind-Host reject, localhost-Host accept, text/plain reject,
  json+charset accept, PUT reject, oversized body reject, notification
  204, idempotent dispose, ctor null guards.

Docs
- MCP_MODE.md: rewritten Security Model section with the three-layer
  model and curl-based 'verify the gate' examples; tool list updated
  to reflect master (screen.snapshot, camera.clip, location.get).

All 715 tests pass (32 MCP, 20 integration, 663 other).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 09:33:09 -07:00
Chris Anderson
a3d884f4c4 feat: local MCP HTTP server mode, independent of node mode
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 09:33:09 -07:00
Scott Hanselman
c64484e392 docs: document release flow
Document the tag-driven release process, versioning expectations, and retagging steps for OpenClaw Windows Hub releases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 08:54:11 -07:00
Scott Hanselman
124f488d3f fix: localize support diagnostics labels
Move the new tray Support & Debug and Command Center labels into localized resources across all supported tray locales. Update tray markup coverage so the compact diagnostics menu keeps using resource-backed labels instead of English literals.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 07:36:14 -07:00
Scott Hanselman
811b848514 Merge mission-control parity and tray UX polish
Bring in the Windows tray parity work: Command Center support/debug entrypoints, diagnostics and summary copy surfaces, compact tray flyouts, Activity Stream history expansion, browser proxy guidance, manual update checks, SSH tunnel restart access, and refreshed Mission Control parity documentation.

Remaining parity blockers are intentionally documented: browser.proxy live smoke still needs matching gateway/browser-control auth or remote host setup, and Voice/TTS remains blocked pending a shared Mac/gateway contract and safer PR split.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 07:16:38 -07:00
Scott Hanselman
2bcfaf17d5 feat: further compact tray flyouts
Group recent activity previews and support file shortcuts into flyouts so the main tray menu stays compact while preserving all existing actions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 07:16:19 -07:00
Scott Hanselman
a38674e6aa feat: compact support diagnostics tray menu
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 07:10:23 -07:00
Scott Hanselman
65542764f2 docs: sync mission control parity status
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 07:01:37 -07:00
Scott Hanselman
64a5221e99 feat: expand activity stream history
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:56:30 -07:00
Scott Hanselman
6b880ccf96 feat: expose tray diagnostics copy actions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:49:09 -07:00
Scott Hanselman
dd51149a5e docs: record voice mode parity blockers
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:45:57 -07:00
Scott Hanselman
16d3003356 feat: add tray ssh restart action
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:38:48 -07:00
Scott Hanselman
62d7e0c28b feat: add debug bundle entrypoint
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:32:21 -07:00
Scott Hanselman
4184e12751 feat: add tray support debug actions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:24:13 -07:00
Scott Hanselman
ec4ce4aafc feat: add summary copy entrypoints
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:17:46 -07:00
Scott Hanselman
582cec5557 feat: add diagnostics copy entrypoints
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:13:14 -07:00
Scott Hanselman
51c14f38d1 feat: add port diagnostics entrypoint
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 06:08:12 -07:00
Scott Hanselman
65339ab658 feat: add manual update check entrypoint
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 05:57:54 -07:00
Scott Hanselman
8bba19ca9d feat: add browser setup guidance entrypoint
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 05:44:45 -07:00
Scott Hanselman
cd67ae8485 fix: preserve packaged deeplink registration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 05:21:39 -07:00
Scott Hanselman
0ca2014244 fix: redact support context paths
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 05:13:58 -07:00
Scott Hanselman
18b43a50e8 feat: add support debug entrypoints
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 05:04:09 -07:00
Scott Hanselman
7fa9aef4d1 fix: report ssh restart failures
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:54:21 -07:00
Scott Hanselman
9a4fe87642 docs: update mission control parity status
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:52:21 -07:00
Scott Hanselman
44262559b9 feat: add command center ssh restart
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:50:48 -07:00
Scott Hanselman
9bce622daa docs: sync deep link list
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:41:10 -07:00
Scott Hanselman
4be273c9eb feat: add tray utility palette actions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:39:30 -07:00
Scott Hanselman
4ccf2ad923 feat: add notification history entrypoint
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:36:27 -07:00
Scott Hanselman
ef10882fff fix: align command center support rows
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:32:17 -07:00
Scott Hanselman
966422d8b6 docs: update powertoys command list
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:30:35 -07:00
Scott Hanselman
fafe76e660 feat: add activity stream deep link
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:25:32 -07:00
Scott Hanselman
dfb1e6a04d feat: add command center to palette
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:19:37 -07:00
Scott Hanselman
38f9042654 docs: record browser host smoke status
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:16:03 -07:00
Scott Hanselman
bed283a579 fix: add browser host repair guidance
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 04:02:07 -07:00
Scott Hanselman
10847ebd35 fix: clarify browser proxy auth guidance
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 03:58:49 -07:00
Scott Hanselman
6cef6d7ee2 docs: add browser proxy testing guidance
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 03:33:25 -07:00
Scott Hanselman
1e0ced8c58 docs: correct voice tts parity status
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 03:31:31 -07:00
Scott Hanselman
0dc9be4b73 docs: align browser parity status
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 03:28:08 -07:00
Scott Hanselman
25c364da11 fix: use tunnel local port for browser diagnostics
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 03:22:34 -07:00