Commit Graph

32396 Commits

Author SHA1 Message Date
Ayaan Zaidi
d83215084f test(tasks): align detached runtime mock return types 2026-04-19 15:21:03 +05:30
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
ZC
25e51bba52 fix: parse PowerShell cron tools allow-list (#68858) (thanks @chen-zhang-cs-code)
* fix(cron): parse PowerShell tools allow list

* fix(cron): clarify tools allow-list help

* fix: parse PowerShell cron tools allow-list (#68858) (thanks @chen-zhang-cs-code)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-19 15:11:14 +05:30
Peter Steinberger
53495f5136 test: complete workspace setup in update smokes 2026-04-19 10:28:10 +01:00
Mariano
0787266637 tasks: extract detached task lifecycle runtime (#68886)
* tasks: extract detached task lifecycle runtime

* tests: relax gateway seam expectation

---------

Co-authored-by: Mariano Belinky <mariano@mb-server-643.local>
2026-04-19 10:56:31 +02:00
Peter Steinberger
2ecea9395b test: make OpenWebUI smoke deterministic 2026-04-19 09:22:20 +01:00
Peter Steinberger
ec193a2b82 test: tolerate empty fireworks live responses 2026-04-19 09:09:53 +01:00
Peter Steinberger
8c4ecf42df fix: stabilize release smoke reruns 2026-04-19 09:05:33 +01:00
Subash Natarajan
6682b12563 fix: strip orphaned OpenAI reasoning blocks before responses API call (#55787)
Merged via squash.

Prepared head SHA: 263b952d88
Co-authored-by: suboss87 <11032439+suboss87@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-19 00:57:03 -07:00
Peter Steinberger
beb2fded6d test: stabilize standalone Parallels smoke lanes 2026-04-19 08:43:15 +01:00
Rubén Cuevas
a1f277e30e fix(ui): stop unsupported wiki RPC probes during startup (#67905)
* UI: gate wiki method probes by advertised methods

* test(ui): cover legacy wiki method fallback
2026-04-19 17:06:30 +10:00
Rubén Cuevas
6d427f8c2a docs: clarify source control-ui dev/build flow (#68814) 2026-04-19 16:48:32 +10:00
cuitianhao
39cb6ecbb9 fix: keep cron last delivery sentinel runtime-only (#68829) (thanks @tianhaocui)
* fix(cron): stop persisting "last" as literal delivery channel value

The UI controller writes the sentinel value "last" into jobs.json when
the delivery channel field is empty. This overwrites user-configured
channels (e.g. "telegram") because the form populates with "last" as
the default fallback, and saving the form materializes it as a literal
persisted value.

"last" is a runtime-only sentinel meaning "use whatever channel was
last used in the session" and should never be written to jobs.json.
When the channel field is empty, write `undefined` instead so the
runtime delivery plan resolver applies the "last" fallback at
execution time without polluting the persisted state.

Fixes #68760

* fix(cron): keep last delivery sentinel runtime-only

* fix: keep cron last delivery sentinel runtime-only (#68829) (thanks @tianhaocui)

* fix: preserve clear-to-last cron updates (#68829) (thanks @tianhaocui)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-19 12:09:16 +05:30
Peter Steinberger
dc3df91e95 chore: release 2026.4.19-beta.2 v2026.4.19-beta.2 2026-04-19 06:53:19 +01:00
Peter Steinberger
bb6ba38a10 fix: keep qa lab compat shim out of release inventory 2026-04-19 06:24:34 +01:00
Peter Steinberger
9a93ea9d7a refactor: share channel status account formatting 2026-04-19 05:33:19 +01:00
Peter Steinberger
3e081c5d21 refactor: share task executor param types 2026-04-19 05:28:03 +01:00
Peter Steinberger
c72f539ced refactor: share status memory resolver types 2026-04-19 05:25:13 +01:00
Peter Steinberger
83801c49f7 refactor: share config observe recovery helpers 2026-04-19 05:22:28 +01:00
Peter Steinberger
812f96cf24 refactor: share gateway reload params 2026-04-19 05:19:19 +01:00
Peter Steinberger
2f84c47b8b refactor: share task flow create params 2026-04-19 05:16:38 +01:00
Peter Steinberger
d385b96451 refactor: share status scan bootstrap params 2026-04-19 05:14:22 +01:00
Peter Steinberger
d4e1a790ab refactor: share media dimension parsing 2026-04-19 05:11:58 +01:00
Peter Steinberger
34abb441f6 refactor: share provider plugin id filtering 2026-04-19 05:09:57 +01:00
Peter Steinberger
984ecd98ca refactor: share legacy config migration pipeline 2026-04-19 05:06:58 +01:00
Peter Steinberger
528f296cfc refactor: share acp identity construction 2026-04-19 05:04:19 +01:00
Peter Steinberger
45381135df refactor: share conversation target normalization 2026-04-19 05:02:03 +01:00
Peter Steinberger
2a14f76964 refactor: share plugin validation diagnostics 2026-04-19 04:59:40 +01:00
Peter Steinberger
ca3e5ffd89 refactor: reduce subagent requester wrapper duplication 2026-04-19 04:52:51 +01:00
Peter Steinberger
9686e518bc test: share media generation reset helpers 2026-04-19 04:48:52 +01:00
Peter Steinberger
5ca33f7cb4 refactor: share model resolve fallback lookup 2026-04-19 04:46:11 +01:00
Peter Steinberger
dfe2e81829 refactor: share provider replay hook params 2026-04-19 04:40:22 +01:00
Peter Steinberger
3eed321081 refactor: share model allowlist parsing 2026-04-19 04:34:51 +01:00
Peter Steinberger
2a35ea4f07 test: share pi embedded helper setup 2026-04-19 04:31:01 +01:00
Peter Steinberger
efda761724 refactor: share cron flat recovery 2026-04-19 04:28:03 +01:00
Peter Steinberger
c63d6bf508 refactor: reuse codex search config types 2026-04-19 04:25:12 +01:00
Peter Steinberger
bcbb3de760 test: reuse run attempt fixture 2026-04-19 04:22:05 +01:00
Peter Steinberger
590474a9a4 test: share compact session fixture 2026-04-19 04:19:35 +01:00
Peter Steinberger
10e14bd5be test: reuse sanitize assistant fixture 2026-04-19 04:16:58 +01:00
Peter Steinberger
bfea6bebc9 test: share subagent cleanup lookup 2026-04-19 04:14:55 +01:00
Peter Steinberger
ab4eb5aa94 test: share anthropic cache payload fixture 2026-04-19 04:12:37 +01:00
Peter Steinberger
f5c49758fc test: share gateway exec allowlist fixture 2026-04-19 04:10:19 +01:00
Peter Steinberger
394c7a2357 test: share exec approval disabled fixture 2026-04-19 04:07:54 +01:00
Peter Steinberger
91ad6c2739 test: share mcp cache tool turn helper 2026-04-19 04:05:28 +01:00
Peter Steinberger
04697eca88 refactor: share channel action params 2026-04-19 04:03:16 +01:00
Peter Steinberger
1908967cfa test: share auth profile env cleanup 2026-04-19 04:00:36 +01:00
Peter Steinberger
f54cf74ef6 test: share BTW sanitized user assertion 2026-04-19 03:58:08 +01:00
Peter Steinberger
44166f7cfe test: share live model switch params 2026-04-19 03:55:35 +01:00
Peter Steinberger
6a87d6e814 test: share model fallback probe assertions 2026-04-19 03:52:57 +01:00
Peter Steinberger
0f871664c5 test: share bootstrap heartbeat fixture 2026-04-19 03:49:35 +01:00