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

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
U
Unit 42
L
LangChain Blog
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
I
InfoQ
P
Proofpoint News Feed
D
DataBreaches.Net
Martin Fowler
Martin Fowler
H
Help Net Security
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog

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(feishu): fetch quoted content before empty-message gu...
bladin · 2026-06-17 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -26,6 +26,7 @@ Docs: https://docs.openclaw.ai

2626
2727

- Channels and delivery: preserve account-scoped DM channel send policy, intentional rich-message line breaks in Telegram and status output, rich Telegram final replies, rich Telegram tables and lists, Telegram thread-create CLI remapping, Feishu dynamic-agent routes after persisted binding reuse, Slack outbound `message_sent` hooks, contributed message-tool schema optionality, same-channel generated media completions, and channel chunking around surrogate pairs and Infinity limits. (#92788, #93164, #92679, #89421, #89943, #42837, #92814, #91137, #91246, #92735) Thanks @yetval, @obviyus, @spacegeologist, @rishitamrakar, @liuhao1024, @lundog, @TurboTheTurtle, and @yhterrance.

2828

- Gemini CLI: use the selected OpenClaw OAuth/API-key auth profile in an isolated Gemini CLI runtime home, preventing ambient Google machine credentials from overriding the chosen profile. (#88748) Thanks @jason-allen-oneal and @shakkernerd.

29+

- Feishu: fetch quoted/replied message content before the empty-message guard so a mention-only reply that quotes a message with meaningful content is no longer dropped. (#90192) Thanks @bladin.

2930

- Discord: give generated auto-thread titles a 60-second timeout and 4,096-token reasoning-model output budget, clamped to the selected model output cap. (#64734) Thanks @hanamizuki.

3031

- Agent, cron, and Gateway runtime: mark active main sessions before restart shutdown aborts, pause yielded subagent runs whose terminal also signals abort, clamp trusted subagent thinking overrides through provider/model fallback, preserve yielded media completions, deliver channel message-tool final replies through auto-reply while hiding internal delivery hints, restore reset archive fallback reads when active async transcripts are missing, de-duplicate main-session heartbeat events, expose session identity in runtime prompts, reject unknown OpenAI agent selectors, keep generated media completions, slash-command block replies, and trajectory export commands in WebChat, and require admin privileges for HTTP session/model override surfaces. (#91357, #92631, #92412, #92146, #92879, #91287, #92468, #92510, #91246, #92651, #92646) Thanks @ooiuuii, @openperf, @IWhatsskill, @masatohoshino, @CadanHu, @ZengWen-DT, @zhangguiping-xydt, and @TurboTheTurtle.

3132

- Providers and model replay: preserve storeless OpenAI Responses replay compatibility, recover invalid OpenAI reasoning signatures and genericized Anthropic thinking-signature replay errors, route OAuth image defaults through Codex for eligible OpenAI profiles, avoid eager tool streaming for Claude 4.5 in Copilot, quarantine unreadable and post-hook OpenAI/Anthropic-family tool schemas without broadening allowed tool choices, deliver explicit thinking-off requests to LM Studio binary-thinking models, honor profile auth for SecretRef model entries, bound model browsing, strip provider prefixes where runtimes need bare IDs, and surface nested embedding fetch failures. (#90706, #92941, #92201, #92916, #92824, #75393, #92908, #92921, #92928, #92002, #90686, #92247, #92627, #91218, #92628) Thanks @snowzlm, @mmyzwl, @CarlCapital, @bek91, @Kailigithub, @vincentkoc, @rohitjavvadi, @samson910022, @nxmxbbd, @liuhao1024, @bymle, and @mushuiyu886.

Original file line numberDiff line numberDiff line change

@@ -424,6 +424,7 @@ async function dispatchMessage(params: {

424424

currentCfg?: ClawdbotConfig;

425425

event: FeishuMessageEvent;

426426

channelRuntime?: PluginRuntime["channel"];

427+

botOpenId?: string;

427428

}) {

428429

const runtime = createRuntimeEnv();

429430

const feishuConfig = params.cfg.channels?.feishu;

@@ -444,6 +445,7 @@ async function dispatchMessage(params: {

444445

await handleFeishuMessage({

445446

cfg,

446447

event: params.event,

448+

botOpenId: params.botOpenId,

447449

runtime,

448450

channelRuntime: params.channelRuntime,

449451

});

@@ -4164,6 +4166,150 @@ describe("handleFeishuMessage command authorization", () => {

41644166

// No reply should be dispatched: empty message is silently skipped

41654167

expect(mockDispatchReplyFromConfig).not.toHaveBeenCalled();

41664168

});

4169+
4170+

it("does not drop empty-text message when it quotes a parent message (#90177)", async () => {

4171+

// A Feishu reply containing only @bot (no additional text) was being

4172+

// dropped before the quoted message content was fetched. The handler

4173+

// should fetch quoted content first and only skip if all of current

4174+

// text, media, and quoted content are empty.

4175+

mockShouldComputeCommandAuthorized.mockReturnValue(false);

4176+

mockGetMessageFeishu.mockResolvedValueOnce({

4177+

messageId: "om_quoted_001",

4178+

chatId: "oc-dm",

4179+

content: "quoted message content from parent",

4180+

contentType: "text",

4181+

});

4182+
4183+

const cfg: ClawdbotConfig = {

4184+

channels: {

4185+

feishu: {

4186+

dmPolicy: "open",

4187+

allowFrom: ["*"],

4188+

},

4189+

},

4190+

} as ClawdbotConfig;

4191+
4192+

const event: FeishuMessageEvent = {

4193+

sender: {

4194+

sender_id: {

4195+

open_id: "ou-reply-only-bot",

4196+

},

4197+

},

4198+

message: {

4199+

message_id: "msg-empty-with-quote",

4200+

parent_id: "om_quoted_001",

4201+

chat_id: "oc-dm",

4202+

chat_type: "p2p",

4203+

message_type: "text",

4204+

// Empty text — only @bot mention, no additional content

4205+

content: JSON.stringify({ text: "" }),

4206+

},

4207+

};

4208+
4209+

await dispatchMessage({ cfg, event });

4210+
4211+

// A reply should be dispatched because quoted content provides context

4212+

expect(mockDispatchReplyFromConfig).toHaveBeenCalledTimes(1);

4213+

});

4214+
4215+

it("dispatches mention-only group reply with quoted content in requireMention:true group (#90177)", async () => {

4216+

// #90177 is specifically about group chats. The empty-message drop happens

4217+

// after the group admission/mention gate, so the fix must also work when

4218+

// the sender mentions the bot in a requireMention:true group and quotes a

4219+

// parent message with meaningful content — the reply should dispatch with

4220+

// the quoted text in the body.

4221+

mockShouldComputeCommandAuthorized.mockReturnValue(false);

4222+

mockGetMessageFeishu.mockResolvedValueOnce({

4223+

messageId: "om_group_quoted_001",

4224+

chatId: "oc-group-90177",

4225+

content: "parent message with context",

4226+

contentType: "text",

4227+

});

4228+
4229+

const cfg: ClawdbotConfig = {

4230+

channels: {

4231+

feishu: {

4232+

groupPolicy: "open",

4233+

groups: {

4234+

"oc-group-90177": {

4235+

requireMention: true,

4236+

},

4237+

},

4238+

},

4239+

},

4240+

} as ClawdbotConfig;

4241+
4242+

const event: FeishuMessageEvent = {

4243+

sender: {

4244+

sender_id: {

4245+

open_id: "ou-group-sender",

4246+

},

4247+

},

4248+

message: {

4249+

message_id: "msg-group-empty-with-quote",

4250+

parent_id: "om_group_quoted_001",

4251+

chat_id: "oc-group-90177",

4252+

chat_type: "group",

4253+

message_type: "text",

4254+

// Empty text — only @bot mention, no additional content

4255+

content: JSON.stringify({ text: "" }),

4256+

// Bot mention so the message passes the requireMention gate

4257+

mentions: [

4258+

{ key: "@_bot_1", id: { open_id: "ou-bot-90177" }, name: "Bot", tenant_key: "" },

4259+

],

4260+

},

4261+

};

4262+
4263+

await dispatchMessage({ cfg, event, botOpenId: "ou-bot-90177" });

4264+
4265+

expect(mockDispatchReplyFromConfig).toHaveBeenCalledTimes(1);

4266+

const context = mockCallArg<{ Body?: string }>(mockFinalizeInboundContext, 0, 0);

4267+

expect(context.Body).toContain("[Replying to:");

4268+

expect(context.Body).toContain("parent message with context");

4269+

});

4270+
4271+

it("does not over-fetch quoted message for unmentioned empty reply in requireMention:true group (#90177)", async () => {

4272+

// An empty-text reply that quotes a parent but does NOT mention the bot

4273+

// in a requireMention:true group should be rejected at the mention gate

4274+

// before the quoted message is fetched, so getMessageFeishu is never

4275+

// called and nothing is dispatched.

4276+

mockShouldComputeCommandAuthorized.mockReturnValue(false);

4277+
4278+

const cfg: ClawdbotConfig = {

4279+

channels: {

4280+

feishu: {

4281+

groupPolicy: "open",

4282+

groups: {

4283+

"oc-group-90177-neg": {

4284+

requireMention: true,

4285+

},

4286+

},

4287+

},

4288+

},

4289+

} as ClawdbotConfig;

4290+
4291+

const event: FeishuMessageEvent = {

4292+

sender: {

4293+

sender_id: {

4294+

open_id: "ou-group-sender-neg",

4295+

},

4296+

},

4297+

message: {

4298+

message_id: "msg-group-unmentioned-empty-quote",

4299+

parent_id: "om_group_quoted_neg",

4300+

chat_id: "oc-group-90177-neg",

4301+

chat_type: "group",

4302+

message_type: "text",

4303+

// Empty text with no bot mention

4304+

content: JSON.stringify({ text: "" }),

4305+

},

4306+

};

4307+
4308+

await dispatchMessage({ cfg, event, botOpenId: "ou-bot-90177-neg" });

4309+
4310+

expect(mockGetMessageFeishu).not.toHaveBeenCalled();

4311+

expect(mockDispatchReplyFromConfig).not.toHaveBeenCalled();

4312+

});

41674313

});

41684314
41694315

describe("createFeishuMessageReceiveHandler media dedupe", () => {

Original file line numberDiff line numberDiff line change

@@ -1026,15 +1026,57 @@ export async function handleFeishuMessage(params: {

10261026

log,

10271027

accountId: account.accountId,

10281028

});

1029-

// Skip messages with no text content and no media attachments. Feishu can

1030-

// deliver empty-text events (e.g. `{"text":""}`) when a user sends a blank

1031-

// message or when media parsing produces an empty string. Writing a blank

1032-

// user turn to the session causes downstream LLM providers (e.g. MiniMax)

1033-

// to reject the request with "messages must not be empty" errors. Logging

1034-

// the skip avoids silent loss without polluting the agent session.

1035-

if (!ctx.content.trim() && mediaList.length === 0) {

1029+

// Fetch quoted/replied message content before the empty-message guard

1030+

// so a reply with only @bot (no text, no media) is not dropped when

1031+

// the quoted message carries meaningful content.

1032+

let quotedMessageInfo: Awaited<ReturnType<typeof getMessageFeishu>> = null;

1033+

let quotedContent: string | undefined;

1034+

if (ctx.parentId) {

1035+

try {

1036+

quotedMessageInfo = await getMessageFeishu({

1037+

cfg,

1038+

messageId: ctx.parentId,

1039+

accountId: account.accountId,

1040+

});

1041+

if (

1042+

quotedMessageInfo &&

1043+

(await shouldIncludeFetchedGroupContextMessage({

1044+

cfg,

1045+

accountId: account.accountId,

1046+

chatId: ctx.chatId,

1047+

isGroup,

1048+

allowFrom: effectiveGroupSenderAllowFrom,

1049+

mode: contextVisibilityMode,

1050+

kind: "quote",

1051+

senderId: quotedMessageInfo.senderId,

1052+

senderType: quotedMessageInfo.senderType,

1053+

}))

1054+

) {

1055+

quotedContent = quotedMessageInfo.content;

1056+

log(

1057+

`feishu[${account.accountId}]: fetched quoted message: ${quotedContent?.slice(0, 100)}`,

1058+

);

1059+

} else if (quotedMessageInfo) {

1060+

log(

1061+

`feishu[${account.accountId}]: skipped quoted message from sender ${quotedMessageInfo.senderId ?? "unknown"} (mode=${contextVisibilityMode})`,

1062+

);

1063+

}

1064+

} catch (err) {

1065+

log(`feishu[${account.accountId}]: failed to fetch quoted message: ${String(err)}`);

1066+

}

1067+

}

1068+
1069+

// Skip messages with no text content, no media attachments, and no quoted

1070+

// content. Feishu can deliver empty-text events (e.g. `{"text":""}`) when

1071+

// a user sends a blank message or when media parsing produces an empty

1072+

// string. Writing a blank user turn to the session causes downstream LLM

1073+

// providers (e.g. MiniMax) to reject the request with "messages must not

1074+

// be empty" errors. Logging the skip avoids silent loss without polluting

1075+

// the agent session. Quoted content is checked too so a reply-only @bot

1076+

// with quoted context is not dropped.

1077+

if (!ctx.content.trim() && mediaList.length === 0 && !quotedContent?.trim()) {

10361078

log(

1037-

`feishu[${account.accountId}]: skipping empty message (no text, no media) from ${ctx.senderOpenId}`,

1079+

`feishu[${account.accountId}]: skipping empty message (no text, no media, no quoted) from ${ctx.senderOpenId}`,

10381080

);

10391081

return;

10401082

}

@@ -1107,44 +1149,6 @@ export async function handleFeishuMessage(params: {

11071149

).commandAccess.authorized

11081150

: undefined;

11091151
1110-

// Fetch quoted/replied message content if parentId exists

1111-

let quotedMessageInfo: Awaited<ReturnType<typeof getMessageFeishu>> = null;

1112-

let quotedContent: string | undefined;

1113-

if (ctx.parentId) {

1114-

try {

1115-

quotedMessageInfo = await getMessageFeishu({

1116-

cfg,

1117-

messageId: ctx.parentId,

1118-

accountId: account.accountId,

1119-

});

1120-

if (

1121-

quotedMessageInfo &&

1122-

(await shouldIncludeFetchedGroupContextMessage({

1123-

cfg,

1124-

accountId: account.accountId,

1125-

chatId: ctx.chatId,

1126-

isGroup,

1127-

allowFrom: effectiveGroupSenderAllowFrom,

1128-

mode: contextVisibilityMode,

1129-

kind: "quote",

1130-

senderId: quotedMessageInfo.senderId,

1131-

senderType: quotedMessageInfo.senderType,

1132-

}))

1133-

) {

1134-

quotedContent = quotedMessageInfo.content;

1135-

log(

1136-

`feishu[${account.accountId}]: fetched quoted message: ${quotedContent?.slice(0, 100)}`,

1137-

);

1138-

} else if (quotedMessageInfo) {

1139-

log(

1140-

`feishu[${account.accountId}]: skipped quoted message from sender ${quotedMessageInfo.senderId ?? "unknown"} (mode=${contextVisibilityMode})`,

1141-

);

1142-

}

1143-

} catch (err) {

1144-

log(`feishu[${account.accountId}]: failed to fetch quoted message: ${String(err)}`);

1145-

}

1146-

}

1147-
11481152

const isTopicSessionForThread =

11491153

isGroup &&

11501154

(groupSession?.groupSessionScope === "group_topic" ||