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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
IT之家
IT之家
博客园 - 聂微东
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
小众软件
小众软件
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
量子位
月光博客
月光博客
博客园 - 【当耐特】
博客园 - 叶小钗

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(outbound): defer reserved-literal errors to async ses...
zhangguiping · 2026-06-25 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -738,8 +738,9 @@ outbound host generic and use the messaging adapter surface for provider rules:

738738

- `messaging.targetResolver.looksLikeId(raw, normalized)` tells core whether an

739739

input should skip straight to id-like resolution instead of directory search.

740740

- `messaging.targetResolver.reservedLiterals` lists bare words that are

741-

channel/session references for that provider and must fail closed before

742-

directory or default-target fallback.

741+

channel/session references for that provider. Resolution preserves configured

742+

directory entries before rejecting reserved literals, then fails closed on a

743+

directory miss.

743744

- `messaging.targetResolver.resolveTarget(...)` is the plugin fallback when

744745

core needs a final provider-owned resolution after normalization or after a

745746

directory miss.

Original file line numberDiff line numberDiff line change

@@ -313,14 +313,13 @@ describe("agent delivery helpers", () => {

313313

expect(plan.resolvedTo).toBe("1470130713209602050");

314314

});

315315
316-

it("carries explicit target resolution errors from session-route preparation", async () => {

317-

const targetResolutionError = new Error('reserved target "current"');

316+

it("defers reserved-literal errors to async session-route resolution", async () => {

318317

mocks.resolveOutboundChannelPlugin.mockReturnValue({

319318

messaging: { resolveOutboundSessionRoute: vi.fn() },

320319

});

321320

mocks.resolveOutboundTarget.mockReturnValueOnce({

322321

ok: false,

323-

error: targetResolutionError,

322+

error: new Error('Reserved target "current" for Telegram'),

324323

});

325324
326325

const plan = await resolveAgentDeliveryPlanWithSessionRoute({

@@ -333,9 +332,12 @@ describe("agent delivery helpers", () => {

333332

wantsDelivery: true,

334333

});

335334
336-

expect(mocks.resolveOutboundSessionRoute).not.toHaveBeenCalled();

335+

// Reserved-literal errors do not block session route resolution; the

336+

// async resolver (resolveMessagingTarget) does directory-first lookup

337+

// before rejecting reserved literals.

338+

expect(mocks.resolveOutboundSessionRoute).toHaveBeenCalled();

337339

expect(plan.resolvedTo).toBe("current");

338-

expect(plan.targetResolutionError).toBe(targetResolutionError);

340+

expect(plan.targetResolutionError).toBeUndefined();

339341

});

340342
341343

it("surfaces stored explicit target errors even when explicit validation is disabled", () => {

Original file line numberDiff line numberDiff line change

@@ -163,9 +163,16 @@ export async function resolveAgentDeliveryPlanWithSessionRoute(

163163

accountId: plan.resolvedAccountId,

164164

mode: plan.deliveryTargetMode ?? "explicit",

165165

});

166-

if (!normalizedTarget.ok) {

166+

// Reserved-literal errors are not fatal for explicit delivery: the async

167+

// session-route resolver (resolveChannelTarget → resolveMessagingTarget)

168+

// does directory-first lookup before rejecting reserved literals, so a

169+

// configured directory entry named like a reserved word still resolves.

170+

const isReservedLiteralError =

171+

!normalizedTarget.ok && normalizedTarget.error.message.includes("Reserved target");

172+

if (!normalizedTarget.ok && !isReservedLiteralError) {

167173

return { ...plan, targetResolutionError: normalizedTarget.error };

168174

}

175+

const sessionRouteTarget = normalizedTarget.ok ? normalizedTarget.to : (plan.resolvedTo ?? "");

169176

const explicitThreadId =

170177

params.explicitThreadId != null && params.explicitThreadId !== ""

171178

? params.explicitThreadId

@@ -177,7 +184,7 @@ export async function resolveAgentDeliveryPlanWithSessionRoute(

177184

channel: plan.resolvedChannel as ChannelId,

178185

agentId: params.agentId,

179186

accountId: plan.resolvedAccountId,

180-

target: normalizedTarget.to,

187+

target: sessionRouteTarget,

181188

currentSessionKey: params.currentSessionKey,

182189

threadId: plan.deliveryTargetMode === "explicit" ? explicitThreadId : plan.resolvedThreadId,

183190

});