Commit Graph

306 Commits

Author SHA1 Message Date
Peter Steinberger 5c8ea0a175 refactor: share channel setup status helpers 2026-03-23 01:56:01 +00:00
Peter Steinberger 6237cfc6a6 fix: finish telegram reply fallback landing (#52524) (thanks @moltbot886) 2026-03-22 18:54:01 -07:00
moltbot886 b12dc4d04d fix(telegram): update test expectations for allow_sending_without_reply
Update exact-match test assertions in send.test.ts to include the new
allow_sending_without_reply: true parameter. Tests using objectContaining
already pass, but several tests use exact object matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 18:54:01 -07:00
moltbot886 d264c761cb fix(telegram): add allow_sending_without_reply to prevent lost messages
When a Telegram message that OpenClaw is replying to gets deleted before
delivery, the Telegram API rejects the entire sendMessage call with
"message to be replied not found". This causes the bot's response to be
silently lost and stuck in the failed delivery queue permanently.

Setting allow_sending_without_reply: true tells Telegram to deliver the
message as a standalone message if the reply target no longer exists,
instead of failing the entire request.

Applied to all 6 locations across 4 source files where
reply_to_message_id is set:
- send.ts: buildTelegramReplyParams (both reply_parameters and plain reply)
- bot/delivery.send.ts: buildTelegramSendParams
- draft-stream.ts: draft stream reply params
- bot-handlers.runtime.ts: error reply messages (file too large, media download failed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 18:54:01 -07:00
Vincent Koc cbf9cd0acb fix(ci): repair main checks 2026-03-22 18:13:14 -07:00
Vincent Koc a61e5d17f0
deps: update fast-xml-parser and markdown-it (#52541)
* style: format test files

* deps: bump fast-xml-parser override
2026-03-22 17:55:47 -07:00
Vincent Koc a8f7c274bc fix(test): split telegram channel-post media coverage 2026-03-22 17:42:44 -07:00
Vincent Koc b21bcf6eb6 fix(test): reduce channel suite startup hotspots 2026-03-22 17:36:32 -07:00
Peter Steinberger 2cfc7bca10 refactor: simplify telegram status snapshots 2026-03-22 23:37:12 +00:00
Peter Steinberger 4cc0d05cfb refactor: share channel runtime state defaults 2026-03-22 23:37:12 +00:00
Peter Steinberger cac9de5326
perf: trim more vitest thread pins 2026-03-22 16:12:52 -07:00
Peter Steinberger e0af23106c ci: fix workflow sanity gate 2026-03-22 23:04:04 +00:00
Vincent Koc 377be1329d test(telegram): cover caption and forum service helpers 2026-03-22 15:58:33 -07:00
Vincent Koc bd8ca6dbd7 test(telegram): cover dm access and allowed updates 2026-03-22 15:57:41 -07:00
Vincent Koc 833d0dfeb0 test(telegram): cover normalization and status issues 2026-03-22 15:55:41 -07:00
Vincent Koc 82508e3931 test(extensions): add discord and telegram coverage 2026-03-22 15:55:41 -07:00
Peter Steinberger 7a2709c391 refactor: simplify channel allowlist resolvers 2026-03-22 20:30:21 +00:00
Peter Steinberger fa13c2960e refactor: share scoped account accessor adapters 2026-03-22 20:30:21 +00:00
Peter Steinberger 3c071a397f refactor: share account id selection helpers 2026-03-22 19:45:59 +00:00
Peter Steinberger d06413e335 refactor: share normalized account lookups 2026-03-22 19:01:52 +00:00
Peter Steinberger 412a3eb1ac
build: bump version to 2026.3.22 2026-03-22 11:58:33 -07:00
Peter Steinberger 89d65521fe refactor: dedupe extension runtime caches 2026-03-22 18:09:45 +00:00
Peter Steinberger 3382ef2724 perf: reduce plugin runtime startup overhead 2026-03-22 09:35:36 +00:00
Ayaan Zaidi 537115bbdc
test: fix channel interaction/media regressions 2026-03-22 11:56:19 +05:30
Peter Steinberger a2472dc31b refactor(test): dedupe channel startup test setup 2026-03-22 03:50:41 +00:00
Peter Steinberger 89bc66feef refactor(test): dedupe startup channel test helpers 2026-03-22 03:41:25 +00:00
Peter Steinberger f1b2c5639a refactor(test): dedupe startup and nostr test fixtures 2026-03-22 01:12:31 +00:00
Vincent Koc 2b4c3c2057
fix(plugin-sdk): remove relative extension boundary escapes (#51939)
* fix(plugin-sdk): remove relative extension boundary escapes

* Gate new plugin-sdk subpaths on host version

* Add changelog entry for #51939

* Fix local staging for plugin-sdk host version gate

* Raise host floor for line and googlechat plugins

---------

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-03-21 20:03:18 -05:00
Peter Steinberger 8b7f40580d perf: split telegram audit runtime seams 2026-03-22 00:53:12 +00:00
Peter Steinberger 30ad059da8 refactor(test): dedupe setup wizard helpers 2026-03-22 00:16:31 +00:00
Vincent Koc 80441baa15
perf(core): trim provider and inbound startup imports (#51927)
* fix(telegram): fail fast on stuck getUpdates

* perf(core): trim provider and inbound startup imports
2026-03-21 16:20:42 -07:00
Vincent Koc 805aaa4ee8 fix(agents): avoid model catalog startup tax on telegram replies 2026-03-21 15:03:55 -07:00
Peter Steinberger 4229ffe2b9 perf: reduce runtime and test startup overhead 2026-03-21 20:18:16 +00:00
Peter Steinberger bfcfc17a8b refactor: tighten plugin sdk entry surface 2026-03-21 20:08:01 +00:00
Pandadadadazxf 2fe0efc9e1
fix: compaction safeguard summary budget (#27727)
Merged via squash.

Prepared head SHA: a7ab64e394
Co-authored-by: Pandadadadazxf <200469161+Pandadadadazxf@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-21 09:27:51 -07:00
Vincent Koc a90c5092f2 fix(telegram): default fresh setups to mention-gated groups 2026-03-21 08:54:23 -07:00
Harold Hunt 5eb99a9b50
Infra: unify plugin split runtime state (#50725)
Merged via squash.

Prepared head SHA: 570b7b9459
Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com>
Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com>
Reviewed-by: @huntharo
2026-03-21 11:00:21 -04:00
Taras Lukavyi 466debb75c
feat(telegram): auto-rename DM topics on first message (#51502)
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-21 16:53:30 +05:30
Ayaan Zaidi 8a05c05596
fix: defer plugin runtime globals until use 2026-03-21 11:14:48 +05:30
Cypherm 6b4c24c2e5
feat(telegram): support custom apiRoot for alternative API endpoints (#48842)
* feat(telegram): support custom apiRoot for alternative API endpoints

Add `apiRoot` config option to allow users to specify custom Telegram Bot
API endpoints (e.g., self-hosted Bot API servers). Threads the configured
base URL through all Telegram API call sites: bot creation, send, probe,
audit, media download, and api-fetch. Extends SSRF policy to dynamically
trust custom apiRoot hostname for media downloads.

Closes #28535

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

* fix(telegram): thread apiRoot through allowFrom lookups

* fix(telegram): honor lookup transport and local file paths

* refactor(telegram): unify username lookup plumbing

* fix(telegram): restore doctor lookup imports

* fix: document Telegram apiRoot support (#48842) (thanks @Cypherm)

---------

Co-authored-by: Cypherm <28184436+Cypherm@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-21 10:10:38 +05:30
Josh Lehman 2364e45fe4
test: align extension runtime mocks with plugin-sdk (#51289)
* test: align extension runtime mocks with plugin-sdk

Update stale extension tests to mock the plugin-sdk runtime barrels that production code now imports, and harden the Signal tool-result harness around system-event assertions so the channels lane matches current extension boundaries.

Regeneration-Prompt: |
  Verify the failing channels-lane tests against current origin/main in an isolated worktree before changing anything. If the failures reproduce on main, keep the fix test-only unless production behavior is clearly wrong. Recent extension refactors moved Telegram, WhatsApp, and Signal code onto plugin-sdk runtime barrels, so update stale tests that still mock old core module paths to intercept the seams production code now uses. For Signal reaction notifications, avoid brittle assertions that depend on shared queued system-event state when a direct harness spy on enqueue behavior is sufficient. Preserve scope: only touch the failing tests and their local harness, then rerun the reproduced targeted tests plus the full channels lane and repo check gate.

* test: fix extension test drift on main

* fix: lazy-load bundled web search plugin registry

* test: make matrix sweeper failure injection portable

* fix: split heavy matrix runtime-api seams

* fix: simplify bundled web search id lookup

* test: tolerate windows env key casing
2026-03-20 15:59:53 -07:00
Peter Steinberger 62ddc9d9e0 refactor: consolidate plugin sdk surface 2026-03-20 19:24:10 +00:00
HCL 4e45a663e7 fix(telegram): prevent silent wrong-bot routing when accountId not in config
When a non-default accountId is specified but not found in the accounts
config, resolveTelegramToken() falls through to channel-level defaults
(botToken, tokenFile, env) — silently routing messages via the wrong
bot's token. This is a cross-bot message leak with no error or warning.

Root cause: extensions/telegram/src/token.ts:44-46, resolveAccountCfg()
returns undefined for unknown accountIds but code continues to fallbacks.
Introduced in e5bca0832f when Telegram moved to extensions/.

Fix: return { token: "", source: "none" } with a diagnostic log when
a non-default accountId is not found. Existing behavior for known
accounts (with or without per-account tokens) preserved.

Test: added "does not fall through when non-default accountId not in
config" — 1/1 new, 10/10 existing unaffected.

Closes #49383

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: HCL <chenglunhu@gmail.com>
2026-03-20 23:24:40 +05:30
Saurabh Mishra 4266e260e1
fix: emit message:sent hook on Telegram streaming preview finalization (#50917)
* fix: emit message:sent hook on Telegram streaming preview finalization

* fix: include messageId in preview-delivered hook callback

* fix: skip message:sent hook for preview-retained paths

* fix: correct JSDoc for onPreviewDelivered callback

* fix: pass visible preview text on regressive-skip path

* fix: remove dead fallbacks and add stopCreatesFirstPreview test

* Update extensions/telegram/src/lane-delivery-text-deliverer.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: align telegram preview sent hooks (#50917) (thanks @bugkill3r)

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-20 22:42:04 +05:30
Vincent Koc 9b6f286ac2 refactor(channels): share route format and binding helpers 2026-03-20 09:30:34 -07:00
Vincent Koc f1e012e0fc fix(telegram): serialize thread binding persists 2026-03-20 00:30:11 -07:00
ernestodeoliveira 80110c550f
fix(telegram): warn when setup leaves dmPolicy as pairing without allowFrom (#50710)
* fix(telegram): warn when setup leaves dmPolicy as pairing without allowFrom

* fix(telegram): scope setup warning to account config

* fix(telegram): quote setup allowFrom example

* fix: warn on insecure Telegram setup defaults (#50710) (thanks @ernestodeoliveira)

---------

Co-authored-by: Claude Code <claude-code@openclaw.ai>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-20 09:29:33 +05:30
Harold Hunt 65594f972c
Gateway: unify plugin interactive callback state (#50722)
Merged via squash.

Prepared head SHA: 7a2740b18a
Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com>
Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com>
Reviewed-by: @huntharo
2026-03-19 22:09:38 -04:00
Gustavo Madeira Santana 0c4fdf1284
Format: apply import ordering cleanup 2026-03-19 10:33:16 -04:00
Vincent Koc 79d7fdce93 test(telegram): inject media loader in delivery replies 2026-03-19 06:30:59 -07:00