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

推荐订阅源

The Cloudflare Blog
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
博客园 - 司徒正美
V
Visual Studio Blog
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
D
Docker
Vercel News
Vercel News
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
爱范儿
爱范儿
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏

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(agents): classify direct fallback targets by channel ...
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -3,6 +3,8 @@ import {

33

testing as sessionBindingServiceTesting,

44

registerSessionBindingAdapter,

55

} from "../infra/outbound/session-binding-service.js";

6+

import { setActivePluginRegistry } from "../plugins/runtime.js";

7+

import { createChannelTestPluginBase, createTestRegistry } from "../test-utils/channel-plugins.js";

68

import type { AgentInternalEvent } from "./internal-events.js";

79

import type {

810

EmbeddedPiQueueFailureReason,

@@ -23,6 +25,7 @@ import { resolveAnnounceOrigin } from "./subagent-announce-origin.js";

23252426

afterEach(() => {

2527

sessionBindingServiceTesting.resetSessionBindingAdaptersForTests();

28+

setActivePluginRegistry(createTestRegistry());

2629

testing.setDepsForTest();

2730

});

2831

@@ -135,6 +138,27 @@ function asMock(fn: unknown) {

135138

return fn as ReturnType<typeof vi.fn>;

136139

}

137140141+

function registerDirectTargetTestChannel(channelId: string): void {

142+

setActivePluginRegistry(

143+

createTestRegistry([

144+

{

145+

pluginId: channelId,

146+

source: "test",

147+

plugin: {

148+

...createChannelTestPluginBase({

149+

id: channelId,

150+

capabilities: { chatTypes: ["direct", "channel"] },

151+

}),

152+

messaging: {

153+

inferTargetChatType: ({ to }: { to: string }) =>

154+

to.startsWith("channel:") || to.startsWith("thread:") ? "channel" : "direct",

155+

},

156+

},

157+

},

158+

]),

159+

);

160+

}

161+138162

function mockCallArg(fn: unknown, callIndex = 0, argIndex = 0) {

139163

const call = asMock(fn).mock.calls[callIndex];

140164

if (!call) {

@@ -979,6 +1003,59 @@ describe("deliverSubagentAnnouncement completion delivery", () => {

9791003

);

9801004

});

98110051006+

it("directly delivers unprefixed direct targets recognized by the channel grammar", async () => {

1007+

registerDirectTargetTestChannel("qa-channel");

1008+

const callGateway = createGatewayMock({

1009+

result: {

1010+

payloads: [],

1011+

},

1012+

});

1013+

const sendMessage = createSendMessageMock();

1014+1015+

const result = await deliverSlackChannelAnnouncement({

1016+

callGateway,

1017+

sendMessage,

1018+

sessionId: "requester-session-qa",

1019+

isActive: false,

1020+

expectsCompletionMessage: true,

1021+

directIdempotencyKey: "announce-qa-fallback-empty",

1022+

requesterSessionKey: "agent:qa:subagent-direct-fallback:1234",

1023+

requesterOrigin: {

1024+

channel: "qa-channel",

1025+

to: "qa-operator",

1026+

accountId: "default",

1027+

},

1028+

internalEvents: [

1029+

{

1030+

type: "task_completion",

1031+

source: "subagent",

1032+

childSessionKey: "agent:worker:subagent:child",

1033+

childSessionId: "child-session-id",

1034+

announceType: "subagent task",

1035+

taskLabel: "qa direct completion smoke",

1036+

status: "ok",

1037+

statusLabel: "completed successfully",

1038+

result: "child completion output",

1039+

replyInstruction: "Summarize the result.",

1040+

},

1041+

],

1042+

});

1043+1044+

expectRecordFields(result, {

1045+

delivered: true,

1046+

path: "direct",

1047+

});

1048+

expect(sendMessage).toHaveBeenCalledWith(

1049+

expect.objectContaining({

1050+

channel: "qa-channel",

1051+

accountId: "default",

1052+

to: "qa-operator",

1053+

content: "child completion output",

1054+

idempotencyKey: "announce-qa-fallback-empty:text-direct",

1055+

}),

1056+

);

1057+

});

1058+9821059

it("directly delivers direct-message subagent text when the announce agent returns incomplete", async () => {

9831060

const callGateway = vi.fn(async () => {

9841061

throw new Error(