惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
量子位
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
爱范儿
爱范儿
博客园 - 【当耐特】
Vercel News
Vercel News
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
博客园 - 叶小钗
博客园_首页
V
Visual Studio Blog
宝玉的分享
宝玉的分享
B
Blog
MyScale Blog
MyScale Blog
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
V
V2EX

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(telegram): honor forced document videos · openclaw/op...
jbetala7 · 2026-05-11 · via Recent Commits to openclaw:main

@@ -814,12 +814,13 @@ export async function sendMessageTelegram(

814814

fileName: media.fileName,

815815

});

816816817-

// Validate photo dimensions before attempting sendPhoto

818817

let sendImageAsPhoto = true;

819-

if (kind === "image" && !isGif && !opts.forceDocument) {

818+

const deliveryKind =

819+

opts.forceDocument === true && (kind === "image" || kind === "video") ? "document" : kind;

820+

if (deliveryKind === "image" && !isGif) {

820821

sendImageAsPhoto = await shouldSendTelegramImageAsPhoto(media.buffer);

821822

}

822-

const isVideoNote = kind === "video" && opts.asVideoNote === true;

823+

const isVideoNote = deliveryKind === "video" && opts.asVideoNote === true;

823824

const fileName =

824825

media.fileName ?? (isGif ? "animation.gif" : inferFilename(kind ?? "document")) ?? "file";

825826

const file = new InputFileCtor(media.buffer, fileName);

@@ -845,7 +846,9 @@ export async function sendMessageTelegram(

845846

...(!needsSeparateText && replyMarkup ? { reply_markup: replyMarkup } : {}),

846847

};

847848

const videoDimensions =

848-

kind === "video" && !isVideoNote ? await probeVideoDimensions(media.buffer) : undefined;

849+

deliveryKind === "video" && !isVideoNote

850+

? await probeVideoDimensions(media.buffer)

851+

: undefined;

849852

const mediaParams = {

850853

...(htmlCaption ? { caption: htmlCaption, parse_mode: "HTML" as const } : {}),

851854

...baseMediaParams,

@@ -868,7 +871,7 @@ export async function sendMessageTelegram(

868871

);

869872870873

const mediaSender = (() => {

871-

if (isGif && !opts.forceDocument) {

874+

if (isGif && deliveryKind !== "document") {

872875

return {

873876

label: "animation",

874877

sender: (effectiveParams: TelegramThreadScopedParams | undefined) =>

@@ -879,7 +882,7 @@ export async function sendMessageTelegram(

879882

) as Promise<TelegramMessageLike>,

880883

};

881884

}

882-

if (kind === "image" && !opts.forceDocument && sendImageAsPhoto) {

885+

if (deliveryKind === "image" && !isGif && sendImageAsPhoto) {

883886

return {

884887

label: "photo",

885888

sender: (effectiveParams: TelegramThreadScopedParams | undefined) =>

@@ -890,7 +893,7 @@ export async function sendMessageTelegram(

890893

) as Promise<TelegramMessageLike>,

891894

};

892895

}

893-

if (kind === "video") {

896+

if (deliveryKind === "video") {

894897

if (isVideoNote) {

895898

return {

896899

label: "video_note",

@@ -946,8 +949,6 @@ export async function sendMessageTelegram(

946949

api.sendDocument(

947950

chatId,

948951

file,

949-

// Only force Telegram to keep the uploaded media type when callers explicitly

950-

// opt into document delivery for image/GIF uploads.

951952

(opts.forceDocument

952953

? { ...effectiveParams, disable_content_type_detection: true }

953954

: effectiveParams) as Parameters<typeof api.sendDocument>[2],