Commit graph

5946 commits

Author SHA1 Message Date
Roy Martin
72abd42d4c
fix(bluebubbles): respect explicit target.service and never short-circuit on weaker matches
Codex review on c905b3a flagged two real issues:

1. Explicit `service: 'sms'` (e.g. `sms:+15551234567`) was still being
   routed to iMessage whenever both chats existed, because the iMessage-
   first preference was hardcoded. Make the preferred service
   parameterized off `target.service`: SMS for explicit `sms` intent,
   iMessage otherwise (covers `imessage`, `auto`, and undefined).

2. Codex also flagged on the prior commit that breaking on
   `participantIMessageMatch` could skip a higher-priority direct
   `iMessage;-;<handle>` match on a later page. Direct > participant in
   our preference order, so the early break was unsound. Remove it
   entirely \u2014 only a direct preferred-service match can short-circuit
   pagination (and that branch already `return`s immediately).

Final return preference is now:
  participantPreferredMatch
    \u2192 directHandleOtherServiceMatch
    \u2192 participantOtherServiceMatch
    \u2192 directHandleUnknownServiceMatch
    \u2192 participantUnknownServiceMatch

Adds three regression tests:
- explicit `service: 'sms'` prefers SMS direct over iMessage direct
- explicit `service: 'sms'` falls back to iMessage when no SMS exists
- later-page direct iMessage beats earlier participant iMessage
2026-04-20 04:01:43 +00:00
Roy Martin
d5b64d294b
fix(bluebubbles): don't let unknown-service direct match short-circuit pagination
Greptile flagged that directHandleIMessageMatch was misnamed: real
iMessage;-;<handle> direct hits return immediately, so the variable
only ever held unknown-service GUIDs. It was then used in the early-
break guard, which could stop pagination before a genuine iMessage
participant match on a later page was discovered.

- Rename to directHandleUnknownServiceMatch to reflect actual usage
- Drop it from the early-break guard (only break on real iMessage hit)
- Reorder return preference: participant iMessage > SMS direct >
  unknown-service direct > SMS participant
- Add regression test covering the unknown-service short-circuit case
2026-04-20 04:01:43 +00:00
Roy Martin
8a6e715470
fix(bluebubbles): prefer iMessage over SMS when both chats exist
When sending to a handle (phone number) that has both an iMessage and an
SMS chat in BlueBubbles, resolveChatGuidForTarget returned whichever chat
it encountered first in the page. This caused messages to silently
downgrade from iMessage to SMS for recipients who use iMessage, which is
never what the user wants.

The fix tracks iMessage and SMS matches separately and returns the
iMessage match when available, falling back to SMS only when no iMessage
chat exists for the handle. Applies to both direct handle matches (chat
guid contains the handle) and participant matches.

Also short-circuits page iteration once an iMessage match is found.

Tests: 5 new unit tests covering iMessage preference, SMS fallback, and
participant-match preference.
2026-04-20 04:01:43 +00:00
zqchris
77b424b15e
BlueBubbles/reactions: fall back unsupported reactions to love (#64693)
* bluebubbles: fall back unsupported reactions to love

iMessage tapback only supports love/like/dislike/laugh/emphasize/question.
Previously, `normalizeBlueBubblesReactionInput` threw when the input did
not map to one of those (e.g. a non-standard unicode emoji like 👀 used
to mean "seen, working on it"), which aborted the whole reaction request
and left the user with no feedback.

This splits the normalizer into a strict and lenient variant:

- `normalizeBlueBubblesReactionInputStrict` throws on unsupported input
  and is used by validator-style callers (e.g. `resolveBlueBubblesAckReaction`
  in monitor-processing.ts) that rely on the throw to detect misconfigured
  ack reactions and skip them cleanly. This preserves the previous silent-skip
  + warn-once behavior for ack reactions configured with an unsupported
  emoji.
- `normalizeBlueBubblesReactionInput` stays lenient and falls back to
  `love` (or `-love` when removing) on unsupported input, so agent-driven
  `sendBlueBubblesReaction` still produces a visible tapback instead of
  failing the whole reaction request. Contract errors (empty input)
  continue to bubble up.

`love` is chosen over `like` as the neutral default: `❤️` reads as a
general acknowledgment across chat norms, while `👍` carries an
agreement connotation that does not match the "seen, working on it"
semantic.

* CHANGELOG: note BlueBubbles reaction fallback

---------

Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
2026-04-19 20:52:36 -07: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
Gustavo Madeira Santana
f9a1875127
qa-matrix: cover Matrix allowlist hot reload
Add a Matrix QA scenario that removes an observer from the running account group allowlist and verifies the existing gateway stops replying without relying on a channel restart.

The scenario disables generic config reload and defers restart during the probe so it specifically covers the Matrix handler per-message live allowlist read.
2026-04-19 18:10:51 -04:00
Gustavo Madeira Santana
f309656325
fix(matrix): align mention-stripped command body 2026-04-19 17:34:37 -04:00
Mr.NightQ
733c0c2fda
fix(matrix): strip mention prefix before slash command matching (#68570)
Merged via squash.

Prepared head SHA: d2c1ed5832
Co-authored-by: nightq <3429433+nightq@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-19 16:50:06 -04:00
Gustavo Madeira Santana
efc19f0ddb
Add Matrix QA coverage for MXID-prefixed commands
Add a qa-matrix contract scenario that sends a Matrix self MXID-prefixed
control command from an observer and expects no SUT reply. This captures the
regression fixed by the Matrix command precheck change.
2026-04-19 16:46:49 -04:00
Omar Shahine
8fbf0972e7
bluebubbles: always set method explicitly on text sends, force Private API on macOS 26 (#69070)
Merged via squash.

Prepared head SHA: e3af5c5d83
Co-authored-by: omarshahine <198016546+xqing3@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-04-19 13:42:56 -07:00
澄潭
f38a498985
fix(matrix): hot-reload dm.allowFrom and groupAllowFrom on each inbound message (#68546)
Merged via squash.

Prepared head SHA: ab369851c8
Co-authored-by: johnlanni <6763318+johnlanni@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-19 15:55:18 -04:00
Masato Hoshino
517801282a
fix(matrix): pin event-helpers import to canonical matrix-js-sdk subpath (refs #50477) (#68498)
Merged via squash.

Prepared head SHA: 32e08e4d8e
Co-authored-by: masatohoshino <246810661+masatohoshino@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-19 15:35:34 -04:00
Marcus Castro
aa76cf43f0
fix(whatsapp): stabilize auth state and reconcile local runtime after CLI login (#67815)
* WhatsApp: harden auth persistence and backup recovery

* WhatsApp: model unstable auth state across runtime and setup

* WhatsApp: recover login and monitor startup from unstable auth

* Channels: surface auth stabilizing in status and health

* Gateway protocol: add channels.start surface

* Gateway: reconcile local channel runtime after CLI login

* Channels UI: reflect recovered login start state

* Changelog: note WhatsApp auth stabilization

* Gateway: fix lint in call test
2026-04-19 14:20:46 -03:00
Omar Shahine
055c17b088
bluebubbles: consolidate HTTP traffic through typed BlueBubblesClient (#68234)
Merged via squash.

Prepared head SHA: ee72657bc8
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-19 08:43:32 -07:00
Bob
84cd786911
fix: tolerate partial discord channel metadata (#68953)
Merged via squash.

Prepared head SHA: 2026540d3e
Co-authored-by: dutifulbob <261991368+dutifulbob@users.noreply.github.com>
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
Reviewed-by: @osolmaz
2026-04-19 17:00:30 +02:00
Frank Yang
4ca5f51430
fix: default kimi thinking to off (#68907)
Co-authored-by: termtek <termtek@ubuntu.tail2b72cd.ts.net>
2026-04-19 18:50:54 +08: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
Peter Steinberger
ac8f0c9c0d
chore: prepare 2026.4.19-beta.1 release 2026-04-19 02:09:43 +01:00
Peter Steinberger
58da2f5897
fix(browser): improve CDP startup diagnostics 2026-04-18 23:44:27 +01:00
Peter Steinberger
73728127b6
refactor(browser): share SSRF hostname allowlist helper 2026-04-18 23:28:37 +01:00
Cyrus Forbes
9a94194329 fix: avoid cumulative codex usage as context (#64669) (thanks @cyrusaf) 2026-04-18 23:09:05 +01:00
Peter Steinberger
1fd049e307 fix: scope remote CDP host allowlist (#68207) 2026-04-18 22:54:54 +01:00
HansY
e90c89cf8b fix(browser): auto-allowlist configured CDP hostnames in SSRF policy 2026-04-18 22:54:54 +01:00
Peter Steinberger
8bfa06e992
refactor: enforce plugin-owned channel boundaries 2026-04-18 22:48:27 +01:00
Peter Steinberger
1af8bd90c3
fix: satisfy google transport fetch boundary 2026-04-18 21:48:44 +01:00
Peter Steinberger
85826c83e4
refactor(google): move Gemini transport into plugin 2026-04-18 21:41:54 +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
f1cc8f0cfc fix(codex): reuse bound auth profile for app-server startup 2026-04-18 21:27:27 +01:00
Vincent Koc
b2ca265f11 test(openai): align codex import profile expectation 2026-04-18 21:27:27 +01:00
Vincent Koc
4a4f52b097 fix(auth): restore codex oauth error and resume handling 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
20debfab90 test(auth): align codex bootstrap expectations 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
Vincent Koc
d97d5c04f0 fix(auth): harden oauth bootstrap identity checks 2026-04-18 21:27:27 +01:00
Vincent Koc
554507b413 fix(auth): align codex cli bootstrap policy 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
b3a97df754
refactor: cache reply and visibility runtimes 2026-04-18 20:54:30 +01:00
Peter Steinberger
0195da6b0e
refactor: cache optional runtime imports 2026-04-18 20:45:26 +01:00
Peter Steinberger
7d728afa12
test(matrix): harden thread binding stop flush test 2026-04-18 20:37:13 +01:00
Peter Steinberger
155162a8cd
chore(lint): enable additional cleanup rules 2026-04-18 20:37:13 +01:00
Peter Steinberger
4fa961d4f1
refactor(lint): enable map spread rule 2026-04-18 20:37:12 +01:00
Peter Steinberger
afebeb5e9a fix: align active-memory timeout schema (#68480) (thanks @Bartok9) 2026-04-18 20:31:41 +01:00
Bartok
866d1eef0a fix(active-memory): raise timeoutMs ceiling from 60s to 120s
The normalizePluginConfig clamp hard-coded a 60_000 ms ceiling for
config.timeoutMs, silently reducing any configured value above 60
seconds down to 60 000 ms at runtime. This made it impossible for
operators to set longer recall budgets even though the docs
(docs/pi.md) showed 120_000 as a valid example.

Raise the ceiling to 120_000 ms so values between 60 001 and 120 000
are honored. Values above 120 000 are still clamped to prevent
unbounded blocking.

Adds two regression tests:
  - 90 000 ms is passed through unchanged
  - 200 000 ms is clamped to 120 000 ms

Fixes #68410.
2026-04-18 20:31:41 +01:00
Peter Steinberger
73e497f9be
refactor: cache hot channel imports 2026-04-18 20:19:53 +01:00
Peter Steinberger
85912849cc
refactor: move extension markers into manifests 2026-04-18 20:16:44 +01:00
Peter Steinberger
a5d6330f87
refactor: cache remaining runtime imports 2026-04-18 20:08:04 +01:00
Peter Steinberger
796f272f7d
refactor: move synthetic auth refs to manifests 2026-04-18 19:53:54 +01:00
Lucenx9
90b8f3fba2 fix(telegram): tighten permanent edit error match 2026-04-18 19:52:31 +01:00