Commit Graph

2453 Commits

Author SHA1 Message Date
hnshah c7f021f70f
fix: preflight invalid telegram photos (#52545) (thanks @hnshah)
* fix(telegram): validate photo dimensions before sendPhoto

Prevents PHOTO_INVALID_DIMENSIONS errors by checking image dimensions
against Telegram Bot API requirements before calling sendPhoto.

If dimensions exceed limits (width + height > 10,000px), automatically
falls back to sending as document instead of crashing with 400 error.

Tested in production (openclaw 2026.3.13) where this error occurred:
  [telegram] tool reply failed: GrammyError: Call to 'sendPhoto' failed!
  (400: Bad Request: PHOTO_INVALID_DIMENSIONS)

Uses existing sharp dependency to read image metadata. Gracefully
degrades if sharp fails (lets Telegram handle validation, backward
compatible behavior).

Closes: #XXXXX (will reference OpenClaw issue if one exists)

* fix(telegram): validate photo aspect ratio

* refactor: use shared telegram image metadata

* fix: fail closed on telegram image metadata

* fix: preflight invalid telegram photos (#52545) (thanks @hnshah)

---------

Co-authored-by: Bob Shah <bobshah@Macs-Mac-Studio.local>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 12:00:20 +05:30
Peter Steinberger 8b80690a1a test: accept fenced discord pairing codes (#54058) (thanks @byungsker) 2026-03-24 23:09:04 -07:00
Peter Steinberger fac0a172e5 test: refresh pairing reply assertions for fenced codes (#54058) (thanks @byungsker) 2026-03-24 23:09:04 -07:00
lbo728 a322059efa test(feishu): update config-schema test for removed requireMention default 2026-03-24 23:09:04 -07:00
lbo728 69195f7e9d fix(feishu): default requireMention to false for groupPolicy open
Groups configured with groupPolicy: open are expected to respond to all
messages. Previously, requireMention defaulted to true regardless of
groupPolicy, causing image (and other non-text) messages to be silently
dropped because they cannot carry @-mentions.

Fix: when groupPolicy is 'open' and requireMention is not explicitly
configured, resolve it to false instead of true. Users who want
mention-required behaviour in open groups can still set requireMention: true
explicitly.

Adds three regression tests covering the new default, explicit override, and
the unchanged allowlist-policy behaviour.

Closes #52553
2026-03-24 23:09:04 -07:00
VACInc 89b7fee352
fix: preserve Telegram forum topic last-route delivery (#53052) (thanks @VACInc)
* fix(telegram): preserve forum topic thread in last-route delivery

* style(telegram): format last-route update

* test(telegram): cover General topic last-route thread

* test(telegram): align topic route helper

* fix(telegram): skip bound-topic last-route writes

---------

Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 11:31:01 +05:30
Peter Steinberger 1c82b06645 test: collapse msteams state and monitor suites 2026-03-25 05:57:02 +00:00
Peter Steinberger e53809035e test: collapse msteams graph suites 2026-03-25 05:57:02 +00:00
Peter Steinberger b99b521a92 test: collapse msteams helper suites 2026-03-25 05:57:02 +00:00
Liren Pan 5dec3dddc4 style(auth): wrap codex fallback formatting 2026-03-24 22:49:06 -07:00
Liren Pan 773427470a test(auth): cover codex jwt fallback branches 2026-03-24 22:49:06 -07:00
Liren Pan b6e70a5cdd auth: derive codex oauth profile ids from jwt claims 2026-03-24 22:49:06 -07:00
nimbleenigma abec3ed645
fix: keep Telegram native commands on runtime snapshot (#53179) (thanks @nimbleenigma)
* fix(telegram): use runtime snapshot for native commands

* fix: keep Telegram native commands on runtime snapshot (#53179) (thanks @nimbleenigma)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 11:18:54 +05:30
Peter Steinberger 57e2223eec test: align pairing reply assertions 2026-03-25 05:48:31 +00:00
Peter Steinberger 6c3e767289
refactor: centralize Discord gateway supervision 2026-03-24 22:47:12 -07:00
Peter Steinberger efafbece17 test: collapse nextcloud-talk send and helper suites 2026-03-25 05:39:11 +00:00
Peter Steinberger 7467f304a7 test: collapse nextcloud-talk helper suites 2026-03-25 05:33:57 +00:00
Peter Steinberger e8e45a4936 test: collapse synology-chat helper suites 2026-03-25 05:33:57 +00:00
Peter Steinberger c22f3c514b test: collapse googlechat helper suites 2026-03-25 05:33:57 +00:00
SUMUKH 149c4683a3
fix: scope Telegram pairing code blocks (#52784) (thanks @sumukhj1219)
* Telegram: format pairing challenge for easier copy

* test: restore Telegram pairing chatId assertion

* fix: scope Telegram pairing code blocks (#52784) (thanks @sumukhj1219)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 11:03:33 +05:30
sfwn 9ab226d275 fix(discord): remove safety error listener after teardown to prevent leak 2026-03-24 22:31:03 -07:00
sfwn 731016472c fix(discord): prevent uncaught gateway errors from crashing the process
Move cleanup() after disconnect() in waitForDiscordGatewayStop so the
error listener is still active during disconnect. Add a safety error
listener in the lifecycle finally block to suppress late errors emitted
by Carbon during teardown.

Fixes the "Max reconnect attempts (0) reached after code 1006" uncaught
exception that kills the entire gateway process when a Discord WebSocket
drops and reconnection fails.
2026-03-24 22:31:03 -07:00
w-sss 247f82119c
fix: improve Telegram 403 membership delivery errors (#53635) (thanks @w-sss)
* fix(telegram): improve error messages for 403 bot not member errors

- Detect 403 'bot is not a member' errors specifically
- Provide actionable guidance for users to fix the issue
- Fixes #48273 where outbound sendMessage fails with 403

Root cause:
When a Telegram bot tries to send a message to a channel/group it's not
a member of, the API returns 403 'bot is not a member of the channel chat'.
The error message was not clear about how to fix this.

Fix:
1. Detect 403 errors in wrapTelegramChatNotFoundError
2. Provide clear error message explaining the issue
3. Suggest adding the bot to the channel/group

* fix(telegram): fix regex precedence for 403 error detection

- Group alternatives correctly: /403.*(bot.*not.*member|bot was blocked)/i
- Require 403 for both alternatives (previously bot.*blocked matched any error)
- Update error message to cover both scenarios
- Fixes Greptile review feedback

* fix(telegram): correct regex alternation precedence for 403 errors

- Fix: /403.*(bot.*not.*member|bot was blocked)/ → /403.*(bot.*not.*member|bot.*blocked)/
- Ensures 403 requirement applies to both alternatives
- Fixes Greptile review comment on PR #48650

* fix(telegram): add 'bot was kicked' to 403 error regex and message

* fix(telegram): preserve membership delivery errors

* fix: improve Telegram 403 membership delivery errors (#53635) (thanks @w-sss)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 10:59:29 +05:30
Peter Steinberger 33d31e2b0d test: collapse imessage test suites 2026-03-25 05:21:16 +00:00
Peter Steinberger bc8622c659 test: collapse helper extension test suites 2026-03-25 05:21:16 +00:00
Peter Steinberger 6f137fff76 test: collapse telegram and whatsapp target suites 2026-03-25 05:21:16 +00:00
Neerav Makwana 1a815e323c test(memory): unmock infra runtime cleanup 2026-03-25 10:50:00 +05:30
Neerav Makwana 09a4453026 fix(memory): bootstrap proxy for LanceDB embeddings 2026-03-25 10:50:00 +05:30
Jealous 2c3cf4f387 chore(tts): rename VOICE_BUBBLE identifiers to OPUS and update docs 2026-03-25 10:49:21 +05:30
Peter Steinberger 61dd61e917
refactor: tighten split-runtime live-state guardrails 2026-03-24 21:58:50 -07:00
Peter Steinberger 8a463e7aa9 test: collapse helper plugin test suites 2026-03-25 04:52:36 +00:00
Peter Steinberger fe84148724 test: collapse messaging target test suites 2026-03-25 04:52:36 +00:00
Peter Steinberger 6e050808ef test: collapse channel setup test suites 2026-03-25 04:52:36 +00:00
Peter Steinberger 039e87c942
fix: restore WhatsApp active listener singleton (#54232) 2026-03-24 21:36:20 -07:00
Peter Steinberger 43058c021e test: collapse setup and monitor channel suites 2026-03-25 04:25:02 +00:00
Peter Steinberger cb76ba2406 test: collapse line channel suites 2026-03-25 04:25:02 +00:00
Peter Steinberger ed9646516d test: collapse utility plugin suites 2026-03-25 04:25:02 +00:00
Peter Steinberger 410c2dba65 test: collapse provider plugin suites 2026-03-25 04:25:02 +00:00
Ted Li 5799322d9e
Discord: resolve /think autocomplete from session model (#49176)
* Discord: use session model for /think autocomplete

* Discord: use cached session store in think autocomplete

* Discord: align think autocomplete with effective bound route

* Discord: fix think autocomplete route-resolution test mocks

* Discord: stabilize think autocomplete CI coverage

* Discord: gate think autocomplete context behind auth

* Discord: share slash auth for think autocomplete

* Discord: localize think autocomplete auth gate

* Discord: drop think autocomplete auth gating

* Discord: align native autocomplete auth and route readiness

* Discord: use effective route for model picker

---------

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-03-24 20:13:11 -05:00
Peter Steinberger f7de5c3b83 test: collapse search helper suites 2026-03-25 00:42:09 +00:00
Peter Steinberger 83591fabfb test: consolidate plugin provider suites 2026-03-25 00:42:09 +00:00
Peter Steinberger 3a1b517581 fix: repair CI regression checks 2026-03-25 00:20:24 +00:00
Peter Steinberger f6205de73a
refactor: split feishu helpers and tests 2026-03-24 17:12:25 -07:00
Peter Steinberger 561acd1675
test: tighten shared card schema coverage 2026-03-24 17:04:07 -07:00
Peter Steinberger 3664c2ce46 fix: polish feishu retry helper (#43788) (thanks @lefarcen) 2026-03-24 16:55:37 -07:00
Elian b9f48707dc fix(feishu): prevent silent group message drops when bot-info probe times out
When OpenClaw restarts under load, the Feishu bot-info probe
(`/open-apis/bot/v3/info`) can exceed the 10-second timeout due to
event-loop contention during channel initialization. This leaves
`botOpenId` empty, causing `checkBotMentioned()` to return `false`
for every group message — silently dropping them all while DMs
continue to work fine.

Two fixes:

1. **Increase startup probe timeout from 10s to 30s** and make it
   configurable via `OPENCLAW_FEISHU_STARTUP_PROBE_TIMEOUT_MS` env var.
   The previous 10s budget was too tight when multiple channels
   (Slack, Discord, Feishu) initialize concurrently.

2. **Graceful degradation in `checkBotMentioned()`**: when `botOpenId`
   is unknown, return `true` (assume mentioned) instead of `false`.
   This prevents group messages from being silently discarded when the
   probe fails for any reason. The trade-off is that the bot may
   respond to non-@-mentioned messages temporarily until the next
   successful probe, which is far preferable to total silence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 16:55:37 -07:00
grassylcao ca578a9183 fix: mark card field as optional in message tool schema
The `createMessageToolCardSchema()` helper returned a bare `Type.Object()`
which TypeBox treats as required when merged into the parent tool schema via
`Type.Object({ card: ... })`. This caused schema validation to reject
media-only sends on Feishu and MSTeams with "must have required property
card", even though the implementation correctly treats card as optional.

Wrap the return value in `Type.Optional()` so the card field is excluded
from the JSON Schema `required` array. Fixes the catch-22 where omitting
card fails validation and including an empty card triggers the runtime
"does not support card with media" guard.

Closes #53697

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:53:56 -07:00
Kwanghee Park (hugh.k) ac7ca52090 Gateway: harden Compose-style gateway port parsing 2026-03-24 16:51:36 -07:00
Peter Steinberger 6f6468027a refactor: dedupe test and runtime seams 2026-03-24 23:33:30 +00:00
Peter Steinberger 40ab7aca3d test: speed up slack monitor suites 2026-03-24 22:17:12 +00:00