Commit Graph

1849 Commits

Author SHA1 Message Date
Ted Li
b67df3797a fix(telegram): explain disabled plugin approval failures (#95973)
* fix: explain disabled Telegram plugin approvals

* fix: handle disabled Telegram native plugin approvals

* fix: resolve exec approval surface independently

* fix: tie plugin approval setup guidance to plugin surface

* Revert "fix: tie plugin approval setup guidance to plugin surface"

This reverts commit 34e3c10e23.

* fix: gate plugin approval setup guidance

* fix: gate plugin approval availability by delivery

* fix: preserve plugin approval approver auth

* fix: make plugin setup guidance explicit

* test: trim approval guidance proof radius

* Avoid setup guidance on routed approval timeout

* Carry plugin approval delivery route into timeouts

* Keep turn-source approval route visible

* fix(approvals): prefer delivered approval clients

* fix(approvals): prefer delivered approval clients

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-02 14:15:25 -07:00
Ayaan Zaidi
dad7768da8 docs(telegram): document group history removal 2026-07-02 09:22:59 -07:00
Ayaan Zaidi
b07fd6f1b4 fix(telegram): keep group history always on 2026-07-02 09:22:59 -07:00
rabsef-bicrym
c8dba85b5d fix: keep Telegram outbound context on transcript time (#98769) 2026-07-01 22:15:10 -07:00
Ayaan Zaidi
6a96bbc7ad fix(telegram): keep timed-out webhook lanes guarded (#98806) 2026-07-01 20:33:38 -07:00
Ayaan Zaidi
2643c8cbfb fix(telegram): stop rate-limiting authenticated webhook traffic 2026-07-01 20:33:38 -07:00
Ayaan Zaidi
ac10e6bff5 fix(telegram): close webhook and evicted probe transports 2026-07-01 20:33:38 -07:00
Ayaan Zaidi
b23500a935 fix(telegram): retry transient webhook startup init errors 2026-07-01 20:33:38 -07:00
Ayaan Zaidi
b7ec2851f3 fix(telegram): spool webhook updates durably before acking Telegram 2026-07-01 20:33:38 -07:00
Ayaan Zaidi
13613ecaf1 fix(telegram): align account inspection default routing 2026-07-01 20:29:18 -07:00
yetval
85771aec05 fix(telegram): honor configured defaultAccount for omitted-account sends and actions
When no accountId was provided, resolveTelegramAccount and resolveTelegramToken
resolved the implicit default account first. Any leftover TELEGRAM_BOT_TOKEN or
top-level channels.telegram.botToken then shadowed the configured
channels.telegram.defaultAccount and default-agent binding, so gateway sends,
heartbeats, and message actions went out through the wrong bot and typically
failed with chat not found in groups the stale bot never joined. Message
actions could also fail with a missing-token error when only the named default
account had a token.

Resolve the configured default account id up front in both optional-account
entry points, matching the nextcloud-talk resolver and createTelegramActionGate.
2026-07-01 20:29:18 -07:00
Vincent Koc
cc76e06e7a test(plugins): align release fixtures with runtime contracts 2026-07-01 18:34:53 -07:00
Ayaan Zaidi
3558391a75 docs(telegram): move maintainer decisions into scoped AGENTS.md 2026-07-01 17:19:16 -07:00
Ayaan Zaidi
f8769559ae fix(telegram): honor long flood-wait retry_after on outbound sends 2026-07-01 16:22:34 -07:00
Ayaan Zaidi
fd18e39e51 fix(telegram): drop rejected native quotes instead of failing the send 2026-07-01 16:22:34 -07:00
Ayaan Zaidi
a53833e842 fix(telegram): fall back to plain captions when Telegram rejects caption HTML 2026-07-01 16:22:34 -07:00
Ayaan Zaidi
6ef0abbaae fix(telegram): fall back to plain text when rich entities are rejected on the durable send path 2026-07-01 16:22:34 -07:00
Ayaan Zaidi
55d31beeef fix(telegram): age-gate retry-limit spool tombstones (#98776) 2026-07-01 15:32:00 -07:00
Ayaan Zaidi
ce9ec4e1c3 fix(telegram): tombstone completed spooled updates to dedupe refetches 2026-07-01 15:32:00 -07:00
Ayaan Zaidi
eb41c7d2d3 fix(telegram): requeue spooled replays on transient store errors 2026-07-01 15:32:00 -07:00
Ayaan Zaidi
8dbcf6db16 fix(telegram): back off and dead-letter poisoned spooled updates 2026-07-01 15:32:00 -07:00
Ayaan Zaidi
5a10a29807 fix(telegram): retry transient getUpdates API errors in ingress worker 2026-07-01 15:24:05 -07:00
Ayaan Zaidi
abaef63a35 fix(telegram): persist only new sent-message cache entries 2026-07-01 15:24:05 -07:00
Ayaan Zaidi
44e88f550b fix(telegram): keep media retry policy local 2026-07-01 13:05:42 -07:00
luoyanglang
f9d7afda10 fix(telegram): narrow durable inbound media retry to transient + abort (#98076)
Review on #98102: the durable-retry classifier treated every MediaFetchError
`fetch_failed` as retryable, but `fetch_failed` also covers permanent failures
(SSRF/guard denials, local Bot API path/read errors). On spooled replay those
would requeue forever with the user-facing warning suppressed.

Move the policy to its owner: add `isDurablyRetryableMediaFetchError` to
`src/media/fetch.ts`, defined as `shouldRetryMediaFetch` (the canonical in-loop
transient policy) plus shutdown/abort `fetch_failed`. A restart-window abort is
the primary inbound-media loss vector and is recoverable on replay, whereas
in-loop retry mid-shutdown is futile; permanent `fetch_failed`, other 4xx, and
size limits stay non-retryable so they cannot loop in the spool.

Telegram reuses the shared helper instead of a local classifier
(`isAbortError`/`isTransientNetworkError` live in core; the classification must
not drift). Adds permanent-`fetch_failed` regression coverage at the unit and
behavioral level. Media-group partial delivery (#55216) unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 13:05:42 -07:00
luoyanglang
14a6cd9ee6 fix(telegram): durably retry inbound media dropped during restart (#98076)
A single-message inbound media fetch failure was handled best-effort: warn
and let the update complete, so bot-core acked the spooled update. During a
restart window the warning send also failed and the document was silently
lost with no durable retry.

Classify transient media fetch failures (network/abort fetch_failed and
408/429/5xx HTTP) and record them as failed-retryable, so spooled-replay
updates are kept and re-driven by the ingress spool with backoff instead of
acked. Live updates still ack and warn; permanent failures (size limit, 4xx)
stay best-effort. The retry notice is suppressed on spooled replay to avoid
repeating it on each replay.

The durable-retry classifier deliberately diverges from media/fetch.ts
shouldRetryMediaFetch on shutdown aborts: in-loop retry of a shutdown abort
is futile, but durable re-spool must retry it -- that abort is the primary
restart-window loss vector. Media-group partial delivery (#55216) is left
unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 13:05:42 -07:00
Mark
5db7c3797d Fix Telegram plugin callback routing (#97174)
* fix telegram plugin callback routing

* Add Telegram callback proof coverage

* Fix proof script lint

* Fix Telegram proof CI regressions

* test: fix telegram callback proof CI regressions

* fix: retire registry-owned callbacks

* fix: retire registry-owned callbacks

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-01 19:49:54 +01:00
Ayaan Zaidi
477b27b6f8 refactor(telegram): reuse rich message extraction 2026-07-01 11:27:52 -07:00
Ayaan Zaidi
404e86f09a test(telegram): cover inbound rich message text 2026-07-01 11:27:52 -07:00
Ayaan Zaidi
8c7050423e fix(telegram): extract inbound rich message text 2026-07-01 11:27:52 -07:00
Josh Lehman
bde0e4541e refactor: share codex login flow helpers 2026-07-01 11:16:49 -07:00
Eva
af8a4540ed Address Codex login review feedback 2026-07-01 11:16:49 -07:00
Eva
918612513f Use nondeprecated provider auth SDK path 2026-07-01 11:16:49 -07:00
Eva
72653b600c Narrow Codex login SDK export 2026-07-01 11:16:49 -07:00
Eva
77edfe7414 Add Telegram Codex login pairing 2026-07-01 11:16:49 -07:00
Eva
bfc4e1dcb5 fix(telegram): restore active-run steering 2026-07-01 10:34:20 -07:00
Ayaan Zaidi
a5e11c0083 fix(plugin-sdk): honor suppressReply across native commands 2026-07-01 09:09:45 -07:00
Alexander Chen
a1553c96fd test(telegram): restore DM binding regression test alongside suppression test
ClawSweeper review flagged that the new suppressReply test replaced the
existing direct-message binding regression test instead of being added
beside it. Restore the DM binding test to maintain coverage for the
plugin command dispatch surface.
2026-07-01 09:09:45 -07:00
alexuser
20fcd4a39c fix(telegram): suppress fallback reply when plugin command returns suppressReply: true
Adds  to the  type so plugin
commands that handle their own transport delivery (e.g. via Telegram Bot API
directly with retry logic, IPv4 forcing, etc.) can signal the channel adapter
to skip the fallback reply.

When a plugin command handler returns , the Telegram
native command dispatcher now:
1. Cleans up any progress placeholder
2. Returns early without sending the "No response generated. Please try again." fallback

Includes detailed JSDoc for the new  flag explaining its use
for plugin commands that deliver their own responses via channel-native APIs.

Fixes #80756
2026-07-01 09:09:45 -07:00
Marvinthebored
b3b51b0c91 fix(anthropic): surface Discord pre-tool commentary
Route Anthropic pre-tool narration through the commentary progress lane, preserve shared channel progress defaults, and keep Discord/Telegram reasoning gates explicit.

Thanks @Marvinthebored!
2026-06-30 18:12:07 -07:00
Peter Lee
e1724474d6 test(telegram): add regression test for forum topic message_thread_id with streamed reasoning (#94526)
* test(telegram): add regression test for forum topic message_thread_id with streamed reasoning

After thorough code tracing of all delivery paths (draft stream, durable,
non-durable, preview hooks), the current main branch already correctly
passes message_thread_id through all paths for the streaming reasoning +
final answer scenario in forum topics. The bug reported in #89352 may have
been resolved by earlier merged changes (media-path preservation,
draft/progress streaming, etc.).

This commit adds a focused regression test covering the combined
scenario to prevent future regressions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(telegram): assert forum thread at draft-stream boundary for both lanes

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 17:58:00 -07:00
Vincent Koc
6528912e90 fix(telegram): recover stalled ingress spool claims
Backport of #97118 to release/2026.6.11.

(cherry picked from commit 8346e87808)
2026-06-30 15:54:11 -07:00
Vincent Koc
66e676d29b chore(release): close out 2026.6.11 on main 2026-06-30 11:31:08 -07:00
Ayaan Zaidi
86bdfec6b7 refactor(telegram): simplify album prompt selection 2026-06-30 10:45:44 -07:00
NianJiuZst
44f3c3e43a test(telegram): satisfy album context lint 2026-06-30 10:45:44 -07:00
NianJiuZst
bba63d3fe0 fix(telegram): omit skipped album context 2026-06-30 10:45:44 -07:00
NianJiuZst
9aec0f089b fix(telegram): hydrate album sibling media context 2026-06-30 10:45:44 -07:00
Jason (Json)
455f813d6e fix(telegram): deliver durable reasoning when enabled
Preserve shared reasoning suppression by default while letting Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane. Covers persistent /reasoning on, separate reasoning stream lanes, and progress-stream suppression.\n\nVerification:\n- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts\n- git diff --check upstream/main...HEAD\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output\n- CI run 28411526182 green, including QA Smoke CI and check-test-types\n- Real behavior proof run 28411676681 passed\n\nPR: #97875
2026-06-29 17:31:06 -07:00
moguangyu5-design
b28fcfe843 fix(telegram): fall back to plain text when rich message entity validation fails (#96642)
When Telegram rejects a rich message with RICH_MESSAGE_*_INVALID
(e.g., RICH_MESSAGE_EMAIL_INVALID on /status replies), the delivery
path now falls back to a plain text sendMessage instead of dropping
the reply.

Fixes #96363
2026-06-28 19:00:07 -07:00
llagy009
46434f0c71 fix(telegram): reject surrogate/out-of-range numeric HTML entities 2026-06-28 18:54:24 -07:00