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

推荐订阅源

J
Java Code Geeks
M
MIT News - Artificial intelligence
D
Docker
S
SegmentFault 最新的问题
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
C
Check Point Blog
GbyAI
GbyAI
美团技术团队
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers 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: harden release stability diagnostics · openclaw/open...
2026-05-18 · via Recent Commits to openclaw:main

@@ -1,5 +1,7 @@

11

import { resolveModelAgentRuntimeMetadata } from "../agents/agent-runtime-metadata.js";

22

import { DEFAULT_CONTEXT_TOKENS } from "../agents/defaults.js";

3+

import { resolveRuntimePolicySessionKey } from "../auto-reply/reply/runtime-policy-session-key.js";

4+

import { normalizeChatType } from "../channels/chat-type.js";

35

import { getRuntimeConfig } from "../config/config.js";

46

import { loadSessionStore, resolveSessionTotalTokens } from "../config/sessions.js";

57

import type { SessionEntry } from "../config/sessions/types.js";

@@ -10,7 +12,10 @@ import { type RuntimeEnv, writeRuntimeJson } from "../runtime.js";

1012

import { classifySessionKind, type SessionKind } from "../sessions/classify-session-kind.js";

1113

import { isAcpSessionKey } from "../sessions/session-key-utils.js";

1214

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

13-

import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";

15+

import {

16+

normalizeOptionalLowercaseString,

17+

normalizeOptionalString,

18+

} from "../shared/string-coerce.js";

1419

import { resolveAgentRuntimeLabel } from "../status/agent-runtime-label.js";

1520

import { isRich, theme } from "../terminal/theme.js";

1621

import { resolveSessionStoreTargetsOrExit } from "./session-store-targets.js";

@@ -220,6 +225,76 @@ function toJsonSessionRow(row: SessionRow): Omit<SessionRow, "runtimeLabel"> {

220225

return jsonRow;

221226

}

222227228+

function stripChannelRecipientPrefix(

229+

value: string | undefined,

230+

channel: string | undefined,

231+

): string | undefined {

232+

const raw = normalizeOptionalString(value);

233+

const normalizedChannel = normalizeOptionalLowercaseString(channel);

234+

if (!raw || !normalizedChannel) {

235+

return raw;

236+

}

237+

const prefix = `${normalizedChannel}:`;

238+

if (!raw.toLowerCase().startsWith(prefix)) {

239+

return raw;

240+

}

241+

const stripped = raw.slice(prefix.length);

242+

const topicMarkerIndex = stripped.toLowerCase().indexOf(":topic:");

243+

return topicMarkerIndex >= 0 ? stripped.slice(0, topicMarkerIndex) : stripped;

244+

}

245+246+

function resolveDisplayRuntimePolicySessionKey(params: {

247+

cfg: OpenClawConfig;

248+

key: string;

249+

entry: SessionEntry;

250+

}): string | undefined {

251+

const { cfg, entry, key } = params;

252+

const origin = entry.origin;

253+

const deliveryContext = entry.deliveryContext;

254+

const chatType = normalizeChatType(origin?.chatType ?? entry.chatType);

255+

if (chatType !== "direct") {

256+

return undefined;

257+

}

258+259+

const channel = normalizeOptionalString(

260+

origin?.provider ??

261+

deliveryContext?.channel ??

262+

entry.lastChannel ??

263+

entry.channel ??

264+

origin?.surface,

265+

);

266+

const to = normalizeOptionalString(origin?.to ?? deliveryContext?.to ?? entry.lastTo);

267+

const from = normalizeOptionalString(origin?.from);

268+

const nativeDirectUserId = normalizeOptionalString(origin?.nativeDirectUserId);

269+

const peerId =

270+

nativeDirectUserId ??

271+

stripChannelRecipientPrefix(to, channel) ??

272+

stripChannelRecipientPrefix(from, channel);

273+274+

const runtimePolicySessionKey = resolveRuntimePolicySessionKey({

275+

cfg,

276+

sessionKey: key,

277+

ctx: {

278+

SessionKey: key,

279+

Provider: channel,

280+

Surface: normalizeOptionalString(origin?.surface),

281+

AccountId: normalizeOptionalString(

282+

origin?.accountId ?? deliveryContext?.accountId ?? entry.lastAccountId,

283+

),

284+

ChatType: chatType,

285+

NativeDirectUserId: nativeDirectUserId,

286+

SenderId: peerId,

287+

OriginatingTo: to,

288+

From: from,

289+

To: to,

290+

},

291+

});

292+293+

return runtimePolicySessionKey && runtimePolicySessionKey !== key

294+

? runtimePolicySessionKey

295+

: undefined;

296+

}

297+223298

export async function sessionsCommand(

224299

opts: {

225300

json?: boolean;

@@ -303,6 +378,11 @@ export async function sessionsCommand(

303378

acpRuntime,

304379

agentRuntime,

305380

kind: classifySessionKind(row.key, store[row.key]),

381+

runtimePolicySessionKey: resolveDisplayRuntimePolicySessionKey({

382+

cfg,

383+

key: row.key,

384+

entry,

385+

}),

306386

runtimeLabel: resolveSessionRuntimeLabel({

307387

cfg,

308388

entry,