openclaw/src/media
thepagent 0ee11d3321
feat: add --force-document to message.send for Telegram (bypass sendPhoto + image optimizer) (#45111)
* feat: add --force-document to message.send for Telegram

Adds --force-document CLI flag to bypass sendPhoto and use sendDocument
instead, avoiding Telegram image compression for PNG/image files.

- TelegramSendOpts: add forceDocument field
- send.ts: skip sendPhoto when forceDocument=true (mediaSender pattern)
- ChannelOutboundContext: add forceDocument field
- telegramOutbound.sendMedia: pass forceDocument to sendMessageTelegram
- ChannelHandlerParams / DeliverOutboundPayloadsCoreParams: add forceDocument
- createChannelOutboundContextBase: propagate forceDocument
- outbound-send-service.ts: add forceDocument to executeSendAction params
- message-action-runner.ts: read forceDocument from params
- message.ts: add forceDocument to MessageSendParams
- register.send.ts: add --force-document CLI option

* fix: pass forceDocument through telegram action dispatch path

The actual send path goes through dispatchChannelMessageAction ->
telegramMessageActions.handleAction -> handleTelegramAction, not
deliverOutboundPayloads. forceDocument was not being read in
readTelegramSendParams or passed to sendMessageTelegram.

* fix: apply forceDocument to GIF branch to avoid sendAnimation

* fix: add disable_content_type_detection=true to sendDocument for --force-document

* fix: add forceDocument to buildSendSchema for agent discoverability

* fix: scope telegram force-document detection

* test: fix heartbeat target helper typing

* fix: skip image optimization when forceDocument is set

* fix: persist forceDocument in WAL queue for crash-recovery replay

* test: tighten heartbeat target test entry typing

---------

Co-authored-by: thepagent <thepagent@users.noreply.github.com>
Co-authored-by: Frank Yang <frank.ekn@gmail.com>
2026-03-14 19:43:49 +08:00
..
audio-tags.ts
audio.test.ts
audio.ts
base64.test.ts
base64.ts
constants.ts fix(media): harden unknown mime handling from #39199 (thanks @nicolasgrasset) 2026-03-07 23:30:32 +00:00
fetch.telegram-network.test.ts refactor: remove channel shim directories, point all imports to extensions (#45967) 2026-03-14 03:43:07 -07:00
fetch.test.ts fix: retry Telegram inbound media downloads over IPv4 fallback (#45327) 2026-03-14 08:21:31 +08:00
fetch.ts fix: retry Telegram inbound media downloads over IPv4 fallback (#45327) 2026-03-14 08:21:31 +08:00
ffmpeg-exec.test.ts refactor(media): add shared ffmpeg helpers 2026-03-03 01:14:14 +00:00
ffmpeg-exec.ts refactor(media): add shared ffmpeg helpers 2026-03-03 01:14:14 +00:00
ffmpeg-limits.ts refactor(media): add shared ffmpeg helpers 2026-03-03 01:14:14 +00:00
host.test.ts
host.ts
image-ops.helpers.test.ts
image-ops.ts
inbound-path-policy.test.ts
inbound-path-policy.ts
input-files.fetch-guard.test.ts Media: reject spoofed input_image MIME payloads (#38289) 2026-03-06 14:34:28 -05:00
input-files.ts Media: reject spoofed input_image MIME payloads (#38289) 2026-03-06 14:34:28 -05:00
load-options.test.ts refactor: split telegram delivery and unify media/frontmatter/i18n pipelines 2026-03-02 04:14:06 +00:00
load-options.ts feat: add --force-document to message.send for Telegram (bypass sendPhoto + image optimizer) (#45111) 2026-03-14 19:43:49 +08:00
local-roots.ts
mime.test.ts fix(media): harden unknown mime handling from #39199 (thanks @nicolasgrasset) 2026-03-07 23:30:32 +00:00
mime.ts Memory: add multimodal image and audio indexing (#43460) 2026-03-11 22:28:34 +00:00
outbound-attachment.ts refactor: remove channel shim directories, point all imports to extensions (#45967) 2026-03-14 03:43:07 -07:00
parse.test.ts
parse.ts refactor(runtime): harden channel-registry cache invalidation and split outbound delivery flow 2026-03-03 00:05:39 +00:00
pdf-extract.ts feat: add PDF analysis tool with native provider support (#31319) 2026-03-01 22:39:12 -08:00
png-encode.ts
read-response-with-limit.test.ts fix(telegram): add download timeout to prevent polling loop hang (#40098) 2026-03-09 08:29:21 +05:30
read-response-with-limit.ts fix(media): accept reader read result type 2026-03-09 03:49:50 +00:00
server.outside-workspace.test.ts fix: harden sandbox media reads against TOCTOU escapes 2026-03-02 01:04:01 +00:00
server.test.ts security: add X-Content-Type-Options nosniff header to media route (#30356) 2026-03-03 13:35:46 -08:00
server.ts fix(media): retain inbound media with recursive cleanup TTL (#38292) 2026-03-06 22:06:09 -05:00
sniff-mime-from-base64.ts
store.outside-workspace.test.ts test: add outside-workspace error mapping coverage 2026-02-28 18:08:10 +05:30
store.redirect.test.ts fix: use 0o644 for inbound media files to allow sandbox read access (#17943) 2026-03-01 22:14:39 -08:00
store.test.ts fix(media): retain inbound media with recursive cleanup TTL (#38292) 2026-03-06 22:06:09 -05:00
store.ts refactor: deduplicate media store writes 2026-03-13 16:30:27 +00:00
temp-files.ts refactor(media): add shared ffmpeg helpers 2026-03-03 01:14:14 +00:00