refactor(telegram): simplify provider delivery and auth#78762
refactor(telegram): simplify provider delivery and auth#78762obviyus merged 6 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. this is a refactor PR rather than a bug report. The prior poll-cap concern is covered at PR head by Real behavior proof Next step before merge Security Review detailsBest possible solution: Have a maintainer review and land the refactor if they want the adapter/auth consolidation, preserving the restored poll cap and coordinating with overlapping Telegram outbound work. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor PR rather than a bug report. The prior poll-cap concern is covered at PR head by Is this the best way to solve the issue? Likely yes: using the existing channel outbound adapter and command-auth seams is the maintainable direction, and I found no line-level blocker. Final landing still needs maintainer ownership because this is broad Telegram refactor work. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against be33b68fd4a0. |
e6a8f62 to
98c7060
Compare
3395185 to
fc2365d
Compare
|
Landed via rebase onto main.
Thanks @obviyus! |
Summary
Real behavior proof
Behavior or issue addressed: Telegram polls must preserve the channel-specific 10-option cap after the outbound adapter refactor, so over-limit polls fail before send instead of reaching Telegram and failing late.
Real environment tested: Local OpenClaw checkout at PR head
fc2365d04a7006d38454c49df70792cf1d805b5c, realpnpm openclaw message pollCLI path, Telegram channel dry-run. Also rebuilt and restarted the WSL2 gateway from this PR stack for manual Telegram testing onubuntu@100.79.136.128. No separate live Telegram poll send was automated from the local CLI.Exact steps or command run after this patch: Ran
/opt/homebrew/bin/bunx pnpm openclaw message poll --channel telegram --target 12345 --poll-question 'Cap proof?' --poll-option one --poll-option two --poll-option three --poll-option four --poll-option five --poll-option six --poll-option seven --poll-option eight --poll-option nine --poll-option ten --dry-run --json, then ran the same command with--poll-option elevenadded. On the WSL2 box, built/home/ubuntu/openclaw-pr-78762and restartedopenclaw-gateway.servicefrom/home/ubuntu/openclaw-pr-78762/dist/index.js gateway --port 18789.Evidence after fix:
Observed result after fix: The real CLI dry-run accepted exactly 10 Telegram poll options and rejected 11 options before send with
Poll supports at most 10 options; the WSL2 Telegram gateway restarted from the PR build and reported a healthy connectivity probe.What was not tested: Automated live Telegram API poll send from local CLI; WSL2 gateway was left running for maintainer manual Telegram testing.
Verification
/opt/homebrew/bin/bunx pnpm test extensions/telegram/src/telegram-outbound.test.ts extensions/telegram/src/outbound-adapter.test.ts extensions/telegram/src/bot-message-context.reactions.test.ts extensions/telegram/src/bot-message-context.dm-threads.test.ts extensions/telegram/src/bot-message-context.thread-binding.test.ts extensions/telegram/src/bot-message-context.require-mention.test.ts extensions/telegram/src/bot-native-commands.test.ts extensions/telegram/src/bot-native-commands.group-auth.test.ts extensions/telegram/src/bot-native-commands.skills-allowlist.test.ts extensions/telegram/src/bot-handlers.runtime.test.ts extensions/telegram/src/group-access.base-access.test.ts extensions/telegram/src/dm-access.test.ts -- --reporter=verbose/opt/homebrew/bin/bunx pnpm check:changed/opt/homebrew/bin/bunx pnpm openclaw message poll --channel telegram --target 12345 --poll-question 'Cap proof?' --poll-option one --poll-option two --poll-option three --poll-option four --poll-option five --poll-option six --poll-option seven --poll-option eight --poll-option nine --poll-option ten --dry-run --json/opt/homebrew/bin/bunx pnpm openclaw message poll --channel telegram --target 12345 --poll-question 'Cap proof?' --poll-option one --poll-option two --poll-option three --poll-option four --poll-option five --poll-option six --poll-option seven --poll-option eight --poll-option nine --poll-option ten --poll-option eleven --dry-run --json(expected failure)