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

推荐订阅源

G
Google Developers Blog
博客园 - 司徒正美
Last Week in AI
Last Week in AI
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
博客园 - 聂微东
M
MIT News - Artificial intelligence
博客园_首页
Jina AI
Jina AI
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
Vercel News
Vercel News
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
B
Blog
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

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(cron): route topic targets through channel plugins · ...
steipete · 2026-05-23 · via Recent Commits to openclaw:main

@@ -1,4 +1,3 @@

1-

import { parseExplicitTargetForLoadedChannel } from "../../channels/plugins/target-parsing-loaded.js";

21

import type { ChannelId } from "../../channels/plugins/types.public.js";

32

import { resolveAgentMainSessionKey } from "../../config/sessions/main-session.js";

43

import { resolveStorePath } from "../../config/sessions/paths.js";

@@ -9,7 +8,10 @@ import { formatErrorMessage } from "../../infra/errors.js";

98

import { maybeResolveIdLikeTarget } from "../../infra/outbound/target-id-resolution.js";

109

import { normalizeTargetForProvider } from "../../infra/outbound/target-normalization.js";

1110

import { tryResolveLoadedOutboundTarget } from "../../infra/outbound/targets-loaded.js";

12-

import { resolveSessionDeliveryTarget } from "../../infra/outbound/targets-session.js";

11+

import {

12+

resolveSessionDeliveryTarget,

13+

type ExplicitTargetParser,

14+

} from "../../infra/outbound/targets-session.js";

1315

import type { OutboundChannel } from "../../infra/outbound/targets.js";

1416

import { normalizeAccountId } from "../../routing/session-key.js";

1517

import { createLazyImportLoader } from "../../shared/lazy-promise.js";

@@ -64,6 +66,7 @@ async function resolveOutboundTargetWithRuntime(

6466

function normalizeTargetForThreadCarry(

6567

channel: Exclude<OutboundChannel, "none"> | undefined,

6668

to: string | undefined,

69+

parseExplicitTarget: ExplicitTargetParser,

6770

): string | undefined {

6871

if (!channel || !to) {

6972

return undefined;

@@ -74,7 +77,7 @@ function normalizeTargetForThreadCarry(

7477

if (!comparable) {

7578

return undefined;

7679

}

77-

const parsed = parseExplicitTargetForLoadedChannel(channel, comparable);

80+

const parsed = parseExplicitTarget(channel, comparable);

7881

const base = parsed?.to ?? comparable;

7982

return normalizeTargetForProvider(channel, base) ?? base;

8083

} catch {

@@ -86,15 +89,24 @@ function deliveryTargetsShareThreadRoute(params: {

8689

channel: Exclude<OutboundChannel, "none"> | undefined;

8790

to: string | undefined;

8891

lastTo: string | undefined;

92+

parseExplicitTarget: ExplicitTargetParser;

8993

}): boolean {

9094

if (!params.to || !params.lastTo) {

9195

return false;

9296

}

9397

if (params.to === params.lastTo) {

9498

return true;

9599

}

96-

const normalizedTo = normalizeTargetForThreadCarry(params.channel, params.to);

97-

const normalizedLastTo = normalizeTargetForThreadCarry(params.channel, params.lastTo);

100+

const normalizedTo = normalizeTargetForThreadCarry(

101+

params.channel,

102+

params.to,

103+

params.parseExplicitTarget,

104+

);

105+

const normalizedLastTo = normalizeTargetForThreadCarry(

106+

params.channel,

107+

params.lastTo,

108+

params.parseExplicitTarget,

109+

);

98110

return Boolean(normalizedTo && normalizedLastTo && normalizedTo === normalizedLastTo);

99111

}

100112

@@ -128,6 +140,13 @@ export async function resolveDeliveryTarget(

128140

const requestedChannel = typeof jobPayload.channel === "string" ? jobPayload.channel : "last";

129141

const explicitTo = typeof jobPayload.to === "string" ? jobPayload.to : undefined;

130142

const allowMismatchedLastTo = requestedChannel === "last";

143+

const deliveryTargetRuntime = await loadDeliveryTargetRuntime();

144+

const parseExplicitTarget: ExplicitTargetParser = (channel, rawTarget) =>

145+

deliveryTargetRuntime.parseExplicitTargetForDelivery({

146+

cfg,

147+

channel,

148+

rawTarget,

149+

});

131150132151

const sessionCfg = cfg.session;

133152

const mainSessionKey = resolveAgentMainSessionKey({ cfg, agentId });

@@ -167,6 +186,7 @@ export async function resolveDeliveryTarget(

167186

explicitTo,

168187

explicitThreadId: jobPayload.threadId,

169188

allowMismatchedLastTo,

189+

parseExplicitTarget,

170190

});

171191172192

let fallbackChannel: Exclude<OutboundChannel, "none"> | undefined;

@@ -197,6 +217,7 @@ export async function resolveDeliveryTarget(

197217

fallbackChannel,

198218

allowMismatchedLastTo,

199219

mode: preliminary.mode,

220+

parseExplicitTarget,

200221

})

201222

: preliminary;

202223

@@ -213,8 +234,11 @@ export async function resolveDeliveryTarget(

213234

: undefined;

214235

let accountId = explicitAccountId ?? resolved.accountId;

215236

if (!accountId && channel) {

216-

const { resolveFirstBoundAccountId } = await loadDeliveryTargetRuntime();

217-

accountId = resolveFirstBoundAccountId({ cfg, channelId: channel, agentId });

237+

accountId = deliveryTargetRuntime.resolveFirstBoundAccountId({

238+

cfg,

239+

channelId: channel,

240+

agentId,

241+

});

218242

}

219243220244

// job.delivery.accountId takes highest precedence — explicitly set by the job author.

@@ -233,20 +257,11 @@ export async function resolveDeliveryTarget(

233257

channel,

234258

to: resolved.to,

235259

lastTo: resolved.lastTo,

260+

parseExplicitTarget,

236261

}))

237262

? resolved.threadId

238263

: undefined;

239264240-

if (channel === "telegram" && typeof toCandidate === "string") {

241-

const topicMatch = toCandidate.match(/:topic:(\d+)$/i);

242-

if (topicMatch) {

243-

if (jobPayload.threadId == null || jobPayload.threadId === "") {

244-

threadId = Number(topicMatch[1]);

245-

}

246-

toCandidate = toCandidate.replace(/:topic:\d+$/i, "");

247-

}

248-

}

249-250265

if (!channel) {

251266

return {

252267

ok: false,

@@ -263,8 +278,7 @@ export async function resolveDeliveryTarget(

263278264279

let effectiveAllowFrom: string[] | undefined;

265280

if (mode === "implicit") {

266-

const { getLoadedChannelPluginForRead, mapAllowFromEntries } =

267-

await loadDeliveryTargetRuntime();

281+

const { getLoadedChannelPluginForRead, mapAllowFromEntries } = deliveryTargetRuntime;

268282

const channelPlugin = getLoadedChannelPluginForRead(channel);

269283

const resolvedAccountId = normalizeAccountId(accountId);

270284

const configuredAllowFromRaw = channelPlugin?.config.resolveAllowFrom?.({