Skip to content

fix(telegram): route outbound media downloads through proxy transport#776

Open
BingqingLyu wants to merge 2 commits into
mainfrom
fork-pr-47387-codex-issue-46282-telegram-media-proxy
Open

fix(telegram): route outbound media downloads through proxy transport#776
BingqingLyu wants to merge 2 commits into
mainfrom
fork-pr-47387-codex-issue-46282-telegram-media-proxy

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Problem: Telegram remote media sends/replies still downloaded media via the generic outbound media loader, which did not receive Telegram's proxy-aware transport.
  • Why it matters: In proxy-required environments, Telegram media sends could fail before sendPhoto/sendDocument because the prefetch path bypassed the configured proxy.
  • What changed: threaded Telegram transport options through outbound media loading so remote media prefetch uses the same proxy fetch + dispatcher/fallback policies as Telegram API traffic; added regression tests for send and reply paths.
  • What did NOT change (scope boundary): did not change Telegram inbound media handling semantics, message formatting behavior, or non-Telegram channel transports.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Integrations

Linked Issue/PR

User-visible / Behavior Changes

  • Telegram remote media sends/replies now honor configured Telegram proxy transport during outbound media prefetch.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)

Repro + Verification

Steps

  1. Configure Telegram with a proxy-required environment.
  2. Send or reply with a remote media URL through Telegram.
  3. Confirm the outbound media prefetch succeeds and the media is delivered.

Expected

  • Remote Telegram media delivery succeeds through the configured proxy transport.

Actual

  • Previously, outbound media prefetch could bypass the proxy-aware transport and fail before delivery.

Evidence

  • Failing path covered by regression tests

Human Verification (required)

  • Verified scenarios: targeted unit tests for outbound Telegram send path, Telegram reply delivery path, and outbound media load option plumbing.
  • Edge cases checked: cached transport reuse, fallback policy propagation, local media roots still passed through unchanged.
  • What you did not verify: live Telegram delivery against a real proxy server.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert commit 6f864e21f.
  • Files/config to restore: Telegram outbound media loading path and shared media loader option plumbing.
  • Known bad symptoms reviewers should watch for: remote media URLs loading without proxy transport, or non-Telegram outbound media loaders receiving unexpected option handling.

Risks and Mitigations

  • Risk: shared outbound media loader now accepts more transport options.
  • Mitigation: behavior remains opt-in; existing callers are unchanged unless they pass the new fields.

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.

[Bug]: Telegram media download uses native fetch instead of proxy-aware fetch

1 participant