Commit Graph

4727 Commits

Author SHA1 Message Date
Peter Steinberger
04cdc33731 test: fix unit coverage scope 2026-04-20 23:36:33 +01:00
Peter Steinberger
72571f0d38 test: decouple outbound target tests from bundled plugins 2026-04-20 23:14:50 +01:00
Peter Steinberger
8f4920e2eb refactor: share line sdk types 2026-04-20 23:04:10 +01:00
Peter Steinberger
60fea81cf1 fix(telegram): harden polling transport liveness (#69476)
* fix(telegram): release undici dispatchers via TelegramTransport.close()

TelegramTransport now exposes an explicit close() that destroys every
owned undici dispatcher (default Agent plus lazily-created IPv4 and
IP-pinned fallback Agents) and the TCP sockets they hold. Dispatcher
constructors are also given bounded keep-alive defaults
(keepAliveTimeout, keepAliveMaxTimeout, connections, pipelining) as a
defence-in-depth layer so the pool cannot grow unbounded even if a
caller forgets to call close().

Without this, every transport that went through a fallback retry left
its fallback Agents anchored forever in a closure; long-running polling
sessions accumulated hundreds of ESTABLISHED keep-alive sockets to
api.telegram.org, saturating the per-IP quota on upstream forward
proxies and making the currently-active outbound node time out while
every other node still tested healthy.

Mock dispatchers in fetch.test.ts gain destroy() spies so the close()
chain is assertable. Call sites that built caller-owned transports from
globalThis.fetch (delivery.resolve-media, test helpers) return an async
no-op close(), matching the new required surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(telegram): dispose polling transport on shutdown and dirty rebuild

Every recoverable network error and stall-watchdog trip sets
TelegramPollingTransportState.#transportDirty so the next polling
cycle rebuilds the transport inside acquireForNextCycle(). Previously
the rebuild simply overwrote the field, leaving the old transport's
keep-alive sockets anchored in the now-unreferenced dispatcher — the
polling loop has no natural GC point for these resources, and Node's
object GC never touches OS-level sockets.

acquireForNextCycle() now closes the previous transport (fire-and-
forget so the polling cycle is not blocked by a slow destroy) before
swapping in the rebuilt one. dispose() is a new method that the owning
TelegramPollingSession calls from the finally block of runUntilAbort(),
so a single transport is always tied to a single polling session
lifetime. After dispose(), acquireForNextCycle() returns undefined to
prevent zombie rebuilds.

Under high sustained polling traffic over long-lived sessions, this is
what stops the per-gateway connection count to api.telegram.org from
growing indefinitely and saturating upstream proxy quotas.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(changelog): note Telegram undici dispatcher lifecycle fix

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(telegram): disable HTTP/2 for all Telegram polling dispatchers

Undici 8 enables HTTP/2 ALPN by default, but Telegram's long-polling
connections stall on Windows due to IPv6 + H2 multiplexing issues. The
core fetch-guard already sets allowH2:false for guarded paths, but the
Telegram extension creates its own Agent/ProxyAgent/EnvHttpProxyAgent
instances directly from undici without this flag.

Apply allowH2:false to all dispatcher constructors in the Telegram
transport layer, matching the approach used in src/infra/net/undici-runtime.ts.

Fixes #66885

* fix: avoid false telegram polling stall restarts

* fix(telegram): publish polling health liveness

---------

Co-authored-by: Ethan Chen <ethanbit@qq.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Magicray1217 <magicray1217@users.noreply.github.com>
Co-authored-by: aoao <aoao@openclaw>
2026-04-20 23:03:57 +01:00
Peter Steinberger
f5305afcfb test: speed changed lanes and channel contracts 2026-04-20 20:53:38 +01:00
Peter Steinberger
d8cf947f6b perf(gateway): streamline startup sidecars 2026-04-20 20:52:42 +01:00
JC
ebb53d8dab docs(plugins): add Prometheus Avatar community plugin (#52752)
Add Prometheus Avatar to the community plugins docs.\n\nThanks @jc-myths.
2026-04-20 20:22:37 +01:00
Gökdeniz Kaymak
c9d3c3022f docs(plugins): add Apify community plugin (#45263)
Add Apify to the community plugins docs.\n\nThanks @protoss70.
2026-04-20 20:22:31 +01:00
Peter Steinberger
704feda9da ci: split channel contract shards further 2026-04-20 20:17:57 +01:00
Sebastian B Otaegui
f48d040bf5 feat: send compaction start and completion notices (#67830)
Merged via squash.

Prepared head SHA: abedf6cf11
Co-authored-by: feniix <91633+feniix@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-20 11:55:17 -07:00
Peter Steinberger
cf7b906216 perf: defer unconfigured gateway hooks 2026-04-20 19:47:35 +01:00
Peter Steinberger
b3a0da7c5e test(extensions): split outbound payload contracts 2026-04-20 19:37:20 +01:00
Kris Wu
0a761a9eac fix(agents): rename auto_compaction_start/end to compaction_start/end [AI] (#67713)
Merged via squash.

Prepared head SHA: 03e0c69038
Co-authored-by: mpz4life <32388289+mpz4life@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-20 11:35:40 -07:00
Peter Steinberger
a292cbf46f docs: clarify optional Docker sandboxing 2026-04-20 19:27:45 +01:00
Feelw00
4be6ff9d5f feat(cron): split jobs.json into config and runtime state files (#63105)
Merged via squash.

Prepared head SHA: 470bb2561f
Co-authored-by: Feelw00 <45638585+Feelw00@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-20 14:23:18 -04:00
Peter Steinberger
7aebac697e ci: split remaining slow test shards 2026-04-20 19:15:45 +01:00
Peter Steinberger
0c75b9ce00 ci: speed up fast security checks 2026-04-20 18:47:02 +01:00
Omar Shahine
e89b41fce7 fix(bluebubbles): configurable sendTimeoutMs, bump send default to 30s (#69193)
Merged via squash.

Prepared head SHA: 358204f963
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-04-20 10:04:52 -07:00
Peter Steinberger
47d42606ac fix: repair bundled plugin runtime deps on startup 2026-04-20 17:47:55 +01:00
Peter Steinberger
97e79bb5f6 test: balance extension shard scheduling 2026-04-20 17:41:38 +01:00
Peter Steinberger
b225d31179 ci: split remaining slow CI lanes 2026-04-20 17:29:11 +01:00
Peter Steinberger
6a4d633e42 perf(test): keep session init thread parsing hot path lazy 2026-04-20 17:14:42 +01:00
Peter Steinberger
0603ceba23 test: split heavy extension test shards 2026-04-20 16:50:01 +01:00
Peter Steinberger
788b47536c feat: add changed-lane local gate 2026-04-20 15:48:20 +01:00
Peter Steinberger
0a9edac632 refactor: share parsed chat allowlist matcher 2026-04-20 15:18:44 +01:00
Peter Steinberger
3ecb713b00 perf: speed local checks and warm builds 2026-04-20 15:08:41 +01:00
Peter Steinberger
8642137252 refactor: share model allowlist entry helper 2026-04-20 15:02:51 +01:00
Peter Steinberger
9d17871ff0 refactor: share computed status adapter base 2026-04-20 14:46:20 +01:00
Peter Steinberger
8dc756747b docs: update GitHub Copilot default model 2026-04-20 14:19:26 +01:00
Peter Steinberger
46ae3d314a perf: parallelize local check gate 2026-04-20 13:55:55 +01:00
Peter Steinberger
91d31197be ci: run architecture check before release 2026-04-20 13:24:49 +01:00
Peter Steinberger
ffb1628727 fix: recover invalid gateway configs 2026-04-20 13:18:07 +01:00
Peter Steinberger
897c50e1a4 perf: speed up type check gate 2026-04-20 13:17:43 +01:00
Peter Steinberger
8116e638f3 chore: release 2026.4.20 2026-04-20 13:16:40 +01:00
Peter Steinberger
976306641d fix(matrix): resolve live allowlist updates 2026-04-20 13:10:02 +01:00
Ayaan Zaidi
d63671fce0 docs(pairing): explain approval upgrades 2026-04-20 13:08:04 +05:30
Ayaan Zaidi
41a01cdae5 fix(control-ui): explain pairing access upgrades 2026-04-20 13:08:04 +05:30
Ayaan Zaidi
67d2026e22 feat(cli): show pairing access upgrades 2026-04-20 13:08:04 +05:30
Ayaan Zaidi
4bc5eab390 fix(gateway): enrich pairing connect errors 2026-04-20 12:33:03 +05:30
Ayaan Zaidi
a80874a4c1 docs(gateway): clarify probe capability wording 2026-04-20 11:59:27 +05:30
Ayaan Zaidi
c68a582e6e docs(doctor): document device pairing drift checks 2026-04-20 11:36:25 +05:30
Ayaan Zaidi
3c354c0907 docs(telegram): clarify allowFrom setup ids 2026-04-20 10:03:25 +05:30
竹田賢史
1d5b58ac18 feat(plugins): pass attachment metadata to before_model_resolve hook (#67322)
Merged via squash.

Prepared head SHA: 8af0ba9703
Co-authored-by: estack-takeda-yorichika <47170408+estack-takeda-yorichika@users.noreply.github.com>
Co-authored-by: sallyom <11166065+sallyom@users.noreply.github.com>
Reviewed-by: @sallyom
2026-04-20 00:14:50 -04:00
Josh Avant
d5b326523f qa-lab: make live lanes CI-ready for v1 E2E automation (#69122)
* qa-lab: harden CI defaults and failure semantics for live lanes

* qa-lab: add unit tests for suite progress logging defaults

* qa-lab: cover malformed multipass summary edge cases

* qa-lab: share suite summary failure counting helper

* qa-lab: test allow-failures parse wiring and sanitize progress ids

* fix: note qa CI live-lane defaults in changelog (#69122) (thanks @joshavant)
2026-04-19 21:13:27 -05:00
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