Commit Graph

4683 Commits

Author SHA1 Message Date
Mariano
8cb73844c8 browser: route existing-session user profile through browser nodes (#68891)
* browser: route user profile through browser nodes

* browser: align existing-session node docs

* browser: preserve host fallback on node discovery errors

* browser: preserve configured node pin errors

* browser: widen config mock in node pin test
2026-04-19 12:21:23 +02:00
Viz
4cfc8cd5be fix(browser): discover CDP websocket from bare ws:// URL before attach (#68715)
* fix(browser): discover CDP websocket from bare ws:// URL before attach

When browser.cdpUrl is set to a bare ws://host:port (no /devtools/ path), ensureBrowserAvailable would call isChromeReachable -> canOpenWebSocket against the URL verbatim. Chrome only accepts WebSocket upgrades at the specific path returned by /json/version, so the handshake failed immediately with HTTP 400. With attachOnly: true, that surfaced as:

  Browser attachOnly is enabled and profile "openclaw" is not running.

even though the CDP endpoint was reachable and the profile was healthy. Reproduced by the new tests in chrome.test.ts and cdp.test.ts (#68027).

Fix: introduce isDirectCdpWebSocketEndpoint(url) — true only when a ws/wss URL has a /devtools/<kind>/<id> handshake path. Route any other ws/wss cdpUrl (including the bare ws://host:port shape) through HTTP /json/version discovery by normalising the scheme via the existing normalizeCdpHttpBaseForJsonEndpoints helper. Apply this in isChromeReachable, getChromeWebSocketUrl, and createTargetViaCdp. Direct WS endpoints with a /devtools/ path are still opened without an extra discovery round-trip.

Fixes #68027

* test(browser): add seeded fuzz coverage for CDP URL helpers

Adds property-based / seeded-fuzz tests for the URL helpers the
attachOnly CDP fix depends on (#68027):

  - isWebSocketUrl
  - isDirectCdpWebSocketEndpoint
  - normalizeCdpHttpBaseForJsonEndpoints
  - parseBrowserHttpUrl
  - redactCdpUrl
  - appendCdpPath
  - getHeadersWithAuth

Follows the existing repo convention (see
src/gateway/http-common.fuzz.test.ts): no fast-check dep, small
mulberry32 PRNG + hand-rolled generators, deterministic per-describe
seeds so failures are reproducible.

Lifts cdp.helpers.ts coverage from 77.77% -> 89.54% statements,
67.9% -> 80.24% branches, 78% -> 90% lines. Remaining uncovered
lines are inside the WS sender internals (createCdpSender,
withCdpSocket, fetchCdpChecked rate-limit branch), which require
integration-style mocks and are unrelated to the attachOnly fix.

* test(browser): drive cdp.helpers/cdp/chrome to 100% coverage

Lifts the three files touched by the #68027 attachOnly fix to 100% statements/branches/functions/lines across the extensions test suite. Adds cdp.helpers.internal.test.ts, cdp.internal.test.ts, and chrome.internal.test.ts covering error paths, branch matrices, CDP session helpers, Chrome spawn/launch/stop flows, and canRunCdpHealthCommand. Defensively unreachable guards are annotated with c8 ignore + inline justifications.

* fix(browser): restore WS fallback for non-/devtools ws:// CDP URLs

When /json/version discovery is unavailable (or returns no
webSocketDebuggerUrl), fall back to treating the original bare ws/wss
URL as a direct WebSocket endpoint. This preserves the #68027 fix for
Chrome's debug port while restoring compatibility with Browserless/
Browserbase-style providers that expose a direct WebSocket root without
a /json/version endpoint.

Priority order for bare ws/wss cdpUrl inputs:
  1. /devtools/<kind>/<id> URL \u2192 direct handshake, no discovery (unchanged)
  2. bare ws/wss root \u2192 try HTTP discovery first; if discovery returns a
     webSocketDebuggerUrl use it; otherwise fall back to the original URL
     as a direct WS endpoint
  3. HTTP/HTTPS URL \u2192 HTTP discovery only, no fallback (unchanged)

Affected call sites: isChromeReachable, getChromeWebSocketUrl,
createTargetViaCdp.

Also renames a misleading test ('still enforces SSRF policy for direct
WebSocket URLs') to accurately describe what it tests: SSRF enforcement
on the navigation target URL, not on the CDP endpoint.

New tests added for all three fallback paths. Coverage remains 100% on
all three touched files (238 tests).

* fix: browser attachOnly bare ws CDP follow-ups (#68715) (thanks @visionik)
2026-04-19 05:43:39 -04:00
Rubén Cuevas
6d427f8c2a docs: clarify source control-ui dev/build flow (#68814) 2026-04-19 16:48:32 +10:00
Peter Steinberger
ac8f0c9c0d chore: prepare 2026.4.19-beta.1 release 2026-04-19 02:09:43 +01:00
Peter Steinberger
e069169765 perf: decouple plugin facades from extension types 2026-04-18 22:06:45 +01:00
Peter Steinberger
85826c83e4 refactor(google): move Gemini transport into plugin 2026-04-18 21:41:54 +01:00
Peter Steinberger
e8b401d0c8 chore: refresh plugin sdk api baseline (#68284) (thanks @vincentkoc) 2026-04-18 21:27:27 +01:00
Peter Steinberger
2fc429dfbf fix: keep codex oauth bridge extension-owned (#68284) (thanks @vincentkoc) 2026-04-18 21:27:27 +01:00
Vincent Koc
a018257487 fix(auth): harden codex oauth bridge security 2026-04-18 21:27:27 +01:00
Vincent Koc
78288e37ed fix(auth): close codex review gaps 2026-04-18 21:27:27 +01:00
Vincent Koc
859eb06662 refactor(auth): route codex runtimes through canonical oauth 2026-04-18 21:27:27 +01:00
Peter Steinberger
2d59395883 refactor: move provider endpoint metadata into manifests 2026-04-18 21:06:50 +01:00
Peter Steinberger
afebeb5e9a fix: align active-memory timeout schema (#68480) (thanks @Bartok9) 2026-04-18 20:31:41 +01:00
Peter Steinberger
85912849cc refactor: move extension markers into manifests 2026-04-18 20:16:44 +01:00
Peter Steinberger
796f272f7d refactor: move synthetic auth refs to manifests 2026-04-18 19:53:54 +01:00
Peter Steinberger
ec86d0f64a fix: keep google thinking helpers within SDK boundary 2026-04-18 19:46:00 +01:00
Peter Steinberger
28fe0296c4 fix: support Gemini latest thinking config 2026-04-18 19:22:27 +01:00
Peter Steinberger
630f2bcabe fix: harden published gateway secret placeholders 2026-04-18 18:29:10 +01:00
Coy Geek
960bc52e3c fix(install): remove published gateway token placeholder
Co-authored-by: opencode <opencode@users.noreply.github.com>
2026-04-18 18:29:10 +01:00
Peter Steinberger
1a7d89e85b docs: add WeChat channel guide 2026-04-18 18:26:40 +01:00
Peter Steinberger
3d994aa03b docs: clarify tsgo typecheck lanes 2026-04-18 18:24:07 +01:00
Vincent Koc
68502c90d1 fix(openrouter): parse visible reasoning_details output (#68577)
* fix(openrouter): parse visible reasoning_details output

* fix(openrouter): preserve reasoning_details ordering

* fix(openrouter): harden reasoning details compat

* fix(openrouter): queue post-tool-call reasoning text

* chore(config): refresh generated schema baselines

* fix(openrouter): keep fallback reasoning with visible details

* fix(openrouter): bound streaming tool-call buffers
2026-04-18 08:18:13 -07:00
Peter Steinberger
3f2e73b723 chore(release): bump version to 2026.4.18 2026-04-18 15:46:33 +01:00
Val Alexander
f45bc09206 [codex] fix(auth): harden OAuth refresh and Codex CLI bootstrap flows (#68396)
* Harden OAuth refresh and Codex CLI bootstrap flows

- Treat near-expiry OAuth credentials as unusable for bootstrap and refresh
- Add clearer timeout and callback validation handling for OpenAI Codex OAuth
- Tighten file lock retry behavior for stale OAuth refresh contention

* fix(auth): address PR review threads

* fix(auth): adopt fresher imported refresh tokens

* test(auth): align oauth expiry fixtures with refresh margin

* fix(auth): tighten Codex OAuth bootstrap and local fallback

* Keep explicit local auth over CLI bootstrap

- Preserve existing non-OAuth local profiles during external CLI OAuth sync
- Add regression coverage for OpenAI Codex and generic external OAuth overlays

* fix(auth): distinguish oauth lock timeout sources

* fix(auth): reject cross-account external oauth bootstrap

* fix(auth): narrow refresh contention classification
2026-04-18 01:02:29 -05:00
Rubén Cuevas
a0dd5f7e8e Align documented bootstrap context defaults with runtime values (#67968)
* Fix bootstrap default limit docs to match runtime

* docs(context): fix stale bootstrap max/file example
2026-04-18 09:00:21 +05:30
Peter Steinberger
576ce7c656 perf: slim zalo group access facade 2026-04-18 01:36:15 +01:00
Gustavo Madeira Santana
5ae059db16 test: speed legacy state migration discovery
Keep bundled legacy migration discovery on narrow setup-entry surfaces so
state-migration tests and doctor cold paths avoid unrelated channel runtime
loads. Add targeted setup feature metadata, narrow Telegram/WhatsApp legacy
contracts, and a path-only pairing SDK helper.
2026-04-17 16:41:43 -04:00
Peter Steinberger
48aa076d12 perf: optimize remaining core tests 2026-04-17 16:05:10 +01:00
Peter Steinberger
418056f7a0 perf: narrow plugin SDK import surfaces 2026-04-17 16:05:09 +01:00
Gustavo Madeira Santana
82fe6f50ef QA: organize scenarios by theme 2026-04-17 11:03:47 -04:00
Val Alexander
f377db1015 feat: add macOS screen snapshots for monitor preview (#67954) thanks @BunsDev
Co-authored-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
2026-04-17 02:58:21 -05:00
Val Alexander
0b6c39be18 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev
Co-authored-by: Val Alexander <bunsthedev@gmail.com>
2026-04-17 02:48:30 -05:00
Peter Steinberger
77e6e4cf87 refactor: move memory embeddings into provider plugins 2026-04-17 02:57:18 +01:00
Gustavo Madeira Santana
bb7e9823a8 QA Lab: add provider registry
Move mock and live provider behavior behind provider-owned definitions so suite, manual, Matrix, and transport lanes share defaults, auth staging, model config, and standalone server startup.

Add AIMock as a first-class local provider mode while keeping mock-openai as the scenario-aware deterministic lane.
2026-04-16 21:24:59 -04:00
Peter Steinberger
a2753e2d9f fix: keep Opus 4.7 effort separate from adaptive thinking 2026-04-17 01:26:11 +01:00
Peter Steinberger
c73a6d2f68 feat: support xhigh for Claude Opus 4.7 2026-04-17 01:26:11 +01:00
Gustavo Madeira Santana
56a9fd4b34 QA Matrix: capture full runner output 2026-04-16 16:18:54 -04:00
Peter Steinberger
15c7f478da docs: update plugin sdk api baseline 2026-04-16 19:58:08 +01:00
Peter Steinberger
c635efd233 chore: prepare 2026.4.15-beta.2 release 2026-04-16 19:58:08 +01:00
Daniel Salmerón Amselem
687ede50a5 fix(agents): add prompt cache compatibility opt-out
Add compat.supportsPromptCacheKey for OpenAI Responses prompt_cache_key handling, update generated config baseline, changelog, and A2UI dependency-layout test compatibility.
2026-04-16 10:48:51 -07:00
Peter Steinberger
1183832d4f fix: pin codex resume sandbox override 2026-04-16 17:31:41 +01:00
Peter Steinberger
461d0050d9 fix: keep codex resume runs non-interactive (#67666) (thanks @plgonzalezrx8) 2026-04-16 08:41:57 -07:00
Barron Roth
bf59917cd1 fix: add Google Gemini TTS provider (#67515) (thanks @barronlroth)
* Add Google Gemini TTS provider

* Remove committed planning artifact

* Explain Google media provider type shape

* google: distill Gemini TTS provider

* fix: add Google Gemini TTS provider (#67515) (thanks @barronlroth)

* fix: honor cfg-backed Google TTS selection (#67515) (thanks @barronlroth)

* fix: narrow Google TTS directive aliases (#67515) (thanks @barronlroth)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-16 11:54:35 +05:30
Tak Hoffman
b10ae0bf13 fix(docs): add active memory speed recommendations 2026-04-16 01:11:08 -05:00
Omar Shahine
489404d75e docs(gateway): correct protocol.md schema path, hello-ok example, auth precedence, and add client constants table (#67372)
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
2026-04-15 17:41:32 -07:00
Josh Lehman
5dcf526a43 fix: dedupe replayed exec.finished node events (#67281)
* docs: add async exec duplicate completion investigation

Add an internal refactor note tracing the node exec completion to system event to heartbeat to transcript path for duplicate async exec injections. Document the most likely gateway-side gap as missing idempotency for replayed exec.finished events, and note why plain outbound delivery retry is a weaker fit for duplicate user turns.

Regeneration-Prompt: |
  Investigate a live duplicate async exec completion that appeared as two identical user turns in an OpenClaw session. Trace the completion path from exec producers into enqueueSystemEvent, heartbeat wake scheduling, prompt assembly, and embedded transcript persistence. Decide whether duplicate wake handling, outbound delivery retry, or duplicate completion event ingestion is the more likely cause, cite the exact code locations, and capture the smallest plausible fix seam without making runtime changes.

* fix: dedupe replayed exec finished node events

Add a narrow idempotency guard in the gateway node-event handler for repeated exec.finished events with the same canonical session key and runId. This blocks replayed async exec completions from being enqueued and heartbeated twice into the parent session. Also only request a heartbeat when the system event was actually queued, and add a regression test for duplicate runId injection.

Regeneration-Prompt: |
  Prevent duplicate async exec completion events from being injected twice into the parent session. Keep the scope tight around the highest-confidence path: node exec.finished events entering gateway server-node-events and becoming system-event-driven heartbeat prompts. Add a small idempotency guard keyed by canonical session plus exec runId, avoid broader delivery or retry changes unless needed, and add regression coverage that fails if the same exec.finished replay is enqueued and woken twice.

* fix: note exec finished replay dedupe
2026-04-15 13:06:18 -07:00
Peter Steinberger
a177d8d454 build: refresh release baselines 2026-04-15 19:41:32 +01:00
Tak Hoffman
4f00b76925 fix(context-window): Tighten context limits and bound memory excerpts (#67277)
* Tighten context limits and bound memory excerpts

* Align startup context defaults in config docs

* Align qmd memory_get bounds with shared limits

* Preserve qmd partial memory reads

* Fix shared memory read type import

* Add changelog entry for context bounds
2026-04-15 13:06:02 -05:00
Gustavo Madeira Santana
78ac118427 fix(plugins): stabilize bundled setup runtimes (#67200)
Merged via squash.

Prepared head SHA: e8d6738fd0
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-15 12:35:18 -04:00
saram ali
b2753fd0de fix(matrix): fix E2EE SSSS bootstrap for passwordless token-auth bots (#66228)
Merged via squash.

Prepared head SHA: c62cebf7c3
Co-authored-by: SARAMALI15792 <140950904+SARAMALI15792@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-15 11:48:29 -04:00