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

推荐订阅源

Recent Announcements
Recent Announcements
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园_首页
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
月光博客
月光博客
小众软件
小众软件
S
SegmentFault 最新的问题
量子位
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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: hide unsupported best effort message option · opencl...
steipete · 2026-05-26 · via Recent Commits to openclaw:main

@@ -1,7 +1,11 @@

11

import { Type, type TSchema } from "typebox";

22

import type { SourceReplyDeliveryMode } from "../../auto-reply/get-reply-options.types.js";

33

import type { InboundEventKind } from "../../channels/inbound-event/kind.js";

4-

import { listChannelPlugins } from "../../channels/plugins/index.js";

4+

import {

5+

getChannelPlugin,

6+

getLoadedChannelPlugin,

7+

listChannelPlugins,

8+

} from "../../channels/plugins/index.js";

59

import {

610

channelSupportsMessageCapability,

711

channelSupportsMessageCapabilityForChannel,

@@ -158,7 +162,11 @@ const presentationMessageSchema = Type.Object(

158162

},

159163

);

160164161-

function buildSendSchema(options: { includePresentation: boolean; includeDeliveryPin: boolean }) {

165+

function buildSendSchema(options: {

166+

includePresentation: boolean;

167+

includeDeliveryPin: boolean;

168+

includeBestEffort: boolean;

169+

}) {

162170

const props: Record<string, TSchema> = {

163171

message: Type.Optional(Type.String()),

164172

effectId: Type.Optional(

@@ -207,7 +215,6 @@ function buildSendSchema(options: { includePresentation: boolean; includeDeliver

207215

asVoice: Type.Optional(Type.Boolean()),

208216

silent: Type.Optional(Type.Boolean()),

209217

quoteText: Type.Optional(Type.String({ description: "Telegram reply quote text." })),

210-

bestEffort: Type.Optional(Type.Boolean()),

211218

gifPlayback: Type.Optional(Type.Boolean()),

212219

forceDocument: Type.Optional(

213220

Type.Boolean({

@@ -223,6 +230,14 @@ function buildSendSchema(options: { includePresentation: boolean; includeDeliver

223230

if (options.includePresentation) {

224231

props.presentation = Type.Optional(presentationMessageSchema);

225232

}

233+

if (options.includeBestEffort) {

234+

props.bestEffort = Type.Optional(

235+

Type.Boolean({

236+

description:

237+

"Optional delivery mode. Omit or set true for ordinary replies. Set false only when required durable delivery is necessary.",

238+

}),

239+

);

240+

}

226241

if (options.includeDeliveryPin) {

227242

props.delivery = Type.Optional(

228243

Type.Object(

@@ -466,6 +481,7 @@ function buildChannelManagementSchema() {

466481

function buildMessageToolSchemaProps(options: {

467482

includePresentation: boolean;

468483

includeDeliveryPin: boolean;

484+

includeBestEffort: boolean;

469485

extraProperties?: Record<string, TSchema>;

470486

}) {

471487

return {

@@ -494,6 +510,7 @@ function isSendOnlyActions(actions: readonly string[]): boolean {

494510

function buildSendOnlyMessageToolSchemaProps(options: {

495511

includePresentation: boolean;

496512

includeDeliveryPin: boolean;

513+

includeBestEffort: boolean;

497514

extraProperties?: Record<string, TSchema>;

498515

}) {

499516

return {

@@ -509,6 +526,7 @@ function buildMessageToolSchemaFromActions(

509526

options: {

510527

includePresentation: boolean;

511528

includeDeliveryPin: boolean;

529+

includeBestEffort: boolean;

512530

extraProperties?: Record<string, TSchema>;

513531

},

514532

) {

@@ -524,6 +542,7 @@ function buildMessageToolSchemaFromActions(

524542

const MessageToolSchema = buildMessageToolSchemaFromActions(AllMessageActions, {

525543

includePresentation: true,

526544

includeDeliveryPin: true,

545+

includeBestEffort: false,

527546

});

528547529548

type MessageToolOptions = {

@@ -743,10 +762,27 @@ function resolveIncludeDeliveryPin(params: MessageToolDiscoveryParams): boolean

743762

return resolveIncludeCapability(params, "delivery-pin");

744763

}

745764765+

function resolveIncludeBestEffort(params: MessageToolDiscoveryParams): boolean {

766+

const currentChannel = normalizeMessageChannel(params.currentChannelProvider);

767+

if (!currentChannel) {

768+

return false;

769+

}

770+

const adapter =

771+

listChannelPlugins().find((plugin) => plugin.id === currentChannel)?.message ??

772+

getLoadedChannelPlugin(currentChannel as Parameters<typeof getLoadedChannelPlugin>[0])

773+

?.message ??

774+

getChannelPlugin(currentChannel as Parameters<typeof getChannelPlugin>[0])?.message;

775+

return (

776+

adapter?.durableFinal?.capabilities?.reconcileUnknownSend === true &&

777+

typeof adapter.durableFinal.reconcileUnknownSend === "function"

778+

);

779+

}

780+746781

function buildMessageToolSchema(params: MessageToolDiscoveryParams) {

747782

const actions = resolveMessageToolActionSchemaActions(params);

748783

const includePresentation = resolveIncludePresentation(params);

749784

const includeDeliveryPin = resolveIncludeDeliveryPin(params);

785+

const includeBestEffort = resolveIncludeBestEffort(params);

750786

const extraProperties = resolveChannelMessageToolSchemaProperties(

751787

buildMessageActionDiscoveryInput(

752788

params,

@@ -756,6 +792,7 @@ function buildMessageToolSchema(params: MessageToolDiscoveryParams) {

756792

return buildMessageToolSchemaFromActions(actions.length > 0 ? actions : ["send"], {

757793

includePresentation,

758794

includeDeliveryPin,

795+

includeBestEffort,

759796

extraProperties,

760797

});

761798

}