Skip to content

Cherry-pick batch: Telegram adapter (44 commits)#1961

Merged
alexey-pelykh merged 54 commits intomainfrom
staging/cherry-pick-1872
Mar 24, 2026
Merged

Cherry-pick batch: Telegram adapter (44 commits)#1961
alexey-pelykh merged 54 commits intomainfrom
staging/cherry-pick-1872

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Cherry-pick batch from upstream

Issue: #1872
Commits: 33 cherry-picked (28 PICK + 5 PARTIAL), 11 skipped/conflict

See issue for full commit list.

Closes #1872

🤖 Generated with Claude Code

steipete and others added 30 commits March 24, 2026 04:32
(cherry picked from commit 5f78057)
…enclaw#41932)

Merged via squash.

Prepared head SHA: 2f50c51
Co-authored-by: hougangdev <[email protected]>
Co-authored-by: obviyus <[email protected]>
Reviewed-by: @obviyus

(cherry picked from commit e37e1ed)
* 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 (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 466debb)
(cherry picked from commit 5fb7a13)
obviyus and others added 20 commits March 24, 2026 05:00
)

* fix: increase shutdown timeout to avoid SIGTERM hang

* fix(telegram): abort polling fetch on shutdown to prevent SIGTERM hang

* fix(gateway): enforce hard exit on shutdown timeout for SIGTERM

* fix: tighten gateway shutdown watchdog

* fix: harden gateway SIGTERM shutdown (openclaw#51242) (thanks @juliabush)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit e94ebfa)
- Remove duplicate renameForumTopicTelegram function in send.ts
- Restore tts.test.ts to fork version (upstream version has gutted pi-ai deps)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- monitor.test.ts: upstream version references tagTelegramNetworkError not in fork
- send.test.ts: upstream version references missing test helpers and unexported functions

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Use direct proxyTls spread instead of upstream's withPinnedLookup helper
which was removed during fork restructuring.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add missing GetReplyOptions/MsgContext imports to bot test
- Fix warn parameter typing in draft-stream test

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Upstream versions have deeply entangled barrel import paths that don't
exist in the fork's restructured module layout.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Rename createNativeCommandTestParams -> createNativeCommandsHarness
- Widen matchPluginCommand mock return type for test flexibility

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Upstream harness refactoring changed return types incompatible with
the test's existing assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The upstream refactoring of test helpers is incompatible with the fork's
existing test patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Upstream version uses telegramDeps injection pattern not in fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Restore test files overwritten by upstream full-gate commit
- Fix OpenClawConfig -> RemoteClawConfig in extension files
- Fix barrel import paths in extension test files

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Remove setup/shared files that depend on upstream barrel exports
- Move extension test files to src/telegram/ where their modules live
- Restore channel.ts to fork version

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Restore types.plugin.ts to fork version (setup-wizard removed)
- Remove normalize/status-issues tests (modules at extension paths)
- Fix readonly array spread in allowed-updates test
- Add explicit types for dm-access test callback parameters

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) March 24, 2026 04:15
alexey-pelykh and others added 3 commits March 24, 2026 05:16
Upstream version references vitest.channel-paths.mjs which doesn't exist
in the fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Upstream test changes reference infrastructure patterns (gateway injection,
plugin runtime seams) not available in the fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The upstream sendTelegramPayloadMessages refactor may have side effects
on channel registration in tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@alexey-pelykh alexey-pelykh force-pushed the staging/cherry-pick-1872 branch from fa5950a to 31c586f Compare March 24, 2026 04:36
Upstream's symbol-based registry lookup breaks channel resolution in
test isolation without the full gateway injection infrastructure.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@alexey-pelykh alexey-pelykh merged commit a862b7c into main Mar 24, 2026
7 checks passed
@alexey-pelykh alexey-pelykh deleted the staging/cherry-pick-1872 branch March 24, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cherry-pick: Telegram adapter (44 commits)

9 participants