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

推荐订阅源

腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
The Cloudflare Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Jina AI
Jina AI
V
V2EX
罗磊的独立博客
V
Visual Studio Blog
A
About on SuperTechFans
IT之家
IT之家
P
Proofpoint News Feed
B
Blog
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Y
Y Combinator 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: retire webchat channel config · openclaw/openclaw@d0...
steipete · 2026-05-31 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -255,6 +255,7 @@ That stages grounded durable candidates into the short-term dreaming store while

255255

- `routing.groupChat.historyLimit` → `messages.groupChat.historyLimit`

256256

- `routing.groupChat.mentionPatterns` → `messages.groupChat.mentionPatterns`

257257

- `channels.telegram.requireMention` → `channels.telegram.groups."*".requireMention`

258+

- `channels.webchat.textChunkLimit` → `gateway.webchat.chatHistoryMaxChars`; other retired `channels.webchat` fields are removed

258259

- `routing.queue` → `messages.queue`

259260

- `routing.bindings` → top-level `bindings`

260261

- `routing.agents`/`routing.defaultAgentId` → `agents.list` + `agents.list[].default`

Original file line numberDiff line numberDiff line change

@@ -85,7 +85,7 @@ Full configuration: [Configuration](/gateway/configuration)

8585
8686

WebChat options:

8787
88-

- `gateway.webchat.chatHistoryMaxChars`: maximum character count for text fields in `chat.history` responses. When a transcript entry exceeds this limit, Gateway truncates long text fields and may replace oversized messages with a placeholder. Per-request `maxChars` can also be sent by the client to override this default for a single `chat.history` call.

88+

- `gateway.webchat.chatHistoryMaxChars`: maximum character count for text fields in `chat.history` responses. When a transcript entry exceeds this limit, Gateway truncates long text fields and may replace oversized messages with a placeholder. The bundled Control UI uses this Gateway default; API clients can still send per-request `maxChars` to override it for a single `chat.history` call. Legacy `channels.webchat` config is retired; run `openclaw doctor --fix` to remove it.

8989
9090

Related global options:

9191
Original file line numberDiff line numberDiff line change

@@ -337,7 +337,7 @@ describe("resolveTextChunkLimit", () => {

337337

expected: 4000,

338338

},

339339

{

340-

name: "honors webchat textChunkLimit override from config",

340+

name: "ignores retired webchat textChunkLimit channel config",

341341

cfg: {

342342

channels: {

343343

webchat: { textChunkLimit: 16000 },

@@ -346,7 +346,7 @@ describe("resolveTextChunkLimit", () => {

346346

provider: "webchat" as const,

347347

accountId: undefined,

348348

options: undefined,

349-

expected: 16000,

349+

expected: 4000,

350350

},

351351

{

352352

name: "falls back to default when webchat has no override",

@@ -621,7 +621,7 @@ describe("resolveChunkMode", () => {

621621

cfg: { channels: { webchat: { chunkMode: "newline" as const } } },

622622

provider: "webchat",

623623

accountId: undefined,

624-

expected: "newline",

624+

expected: "length",

625625

},

626626

] as const)(

627627

"resolves default/provider/account/internal chunk mode for $provider $accountId",

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";

1313

import { resolveAccountEntry } from "../routing/account-lookup.js";

1414

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

1515

import { chunkTextByBreakResolver } from "../shared/text-chunking.js";

16+

import { INTERNAL_MESSAGE_CHANNEL } from "../utils/message-channel-constants.js";

1617
1718

export type TextChunkProvider = ChannelId;

1819

@@ -67,7 +68,7 @@ export function resolveTextChunkLimit(

6768

? opts.fallbackLimit

6869

: DEFAULT_CHUNK_LIMIT;

6970

const providerOverride = (() => {

70-

if (!provider) {

71+

if (!provider || provider === INTERNAL_MESSAGE_CHANNEL) {

7172

return undefined;

7273

}

7374

const channelsConfig = cfg?.channels as Record<string, unknown> | undefined;

@@ -105,7 +106,7 @@ export function resolveChunkMode(

105106

provider?: TextChunkProvider,

106107

accountId?: string | null,

107108

): ChunkMode {

108-

if (!provider) {

109+

if (!provider || provider === INTERNAL_MESSAGE_CHANNEL) {

109110

return DEFAULT_CHUNK_MODE;

110111

}

111112

const channelsConfig = cfg?.channels as Record<string, unknown> | undefined;

Original file line numberDiff line numberDiff line change

@@ -195,6 +195,22 @@ const DOCTOR_DEPRECATION_COMPAT_RECORDS = [

195195

docsPath: "/channels/channel-routing",

196196

tests: ["src/commands/doctor/shared/channel-legacy-config-migrate.test.ts"],

197197

}),

198+

deprecatedCompatRecord({

199+

code: "doctor-webchat-channel-config",

200+

status: "removed",

201+

owner: "channel",

202+

introduced: "2026-05-18",

203+

deprecated: "2026-05-31",

204+

warningStarts: "2026-05-31",

205+

removeAfter: "2026-08-31",

206+

source: "channels.webchat",

207+

migration: "src/commands/doctor/shared/legacy-config-migrations.channels.ts",

208+

replacement: "gateway.webchat.chatHistoryMaxChars for WebChat history limits",

209+

docsPath: "/web/webchat",

210+

tests: ["src/commands/doctor/shared/legacy-config-migrate.test.ts"],

211+

notes:

212+

"WebChat is an internal control surface, not a configurable outbound channel. Runtime ignores the retired channel key; doctor preserves the history-size intent when possible.",

213+

}),

198214

deprecatedCompatRecord({

199215

code: "doctor-tts-provider-aliases",

200216

owner: "tts",

Original file line numberDiff line numberDiff line change

@@ -760,6 +760,73 @@ describe("legacy diagnostics memory pressure snapshot migrate", () => {

760760

});

761761

});

762762
763+

describe("legacy WebChat channel config migrate", () => {

764+

it("moves WebChat textChunkLimit to the gateway history cap and removes channels.webchat", () => {

765+

const raw = {

766+

channels: {

767+

webchat: {

768+

textChunkLimit: 16000,

769+

chunkMode: "newline",

770+

},

771+

discord: {

772+

textChunkLimit: 2000,

773+

},

774+

},

775+

};

776+
777+

expect(findLegacyConfigIssues(raw).map((issue) => issue.path)).toEqual(["channels.webchat"]);

778+
779+

const res = migrateLegacyConfigForTest(raw);

780+
781+

expect(res.config?.gateway?.webchat?.chatHistoryMaxChars).toBe(16000);

782+

expect(res.config?.channels).toEqual({

783+

discord: {

784+

textChunkLimit: 2000,

785+

},

786+

});

787+

expect(res.changes).toStrictEqual([

788+

"Moved channels.webchat.textChunkLimit → gateway.webchat.chatHistoryMaxChars.",

789+

"Removed retired channels.webchat config.",

790+

]);

791+

});

792+
793+

it("removes channels.webchat without overwriting an existing gateway history cap", () => {

794+

const res = migrateLegacyConfigForTest({

795+

gateway: {

796+

webchat: {

797+

chatHistoryMaxChars: 8000,

798+

},

799+

},

800+

channels: {

801+

webchat: {

802+

textChunkLimit: 16000,

803+

},

804+

},

805+

});

806+
807+

expect(res.config?.gateway?.webchat?.chatHistoryMaxChars).toBe(8000);

808+

expect(res.config).not.toHaveProperty("channels");

809+

expect(res.changes).toStrictEqual(["Removed retired channels.webchat config."]);

810+

});

811+
812+

it("drops invalid WebChat textChunkLimit values instead of creating invalid gateway config", () => {

813+

const res = migrateLegacyConfigForTest({

814+

channels: {

815+

webchat: {

816+

textChunkLimit: 600000,

817+

},

818+

},

819+

});

820+
821+

expect(res.config).not.toHaveProperty("gateway");

822+

expect(res.config).not.toHaveProperty("channels");

823+

expect(res.changes).toStrictEqual([

824+

"Removed channels.webchat.textChunkLimit (not a valid gateway.webchat.chatHistoryMaxChars value).",

825+

"Removed retired channels.webchat config.",

826+

]);

827+

});

828+

});

829+
763830

describe("legacy thread binding spawn migrate", () => {

764831

it("moves matching split spawn flags to unified spawnSessions", () => {

765832

const res = migrateLegacyConfigForTest({

Original file line numberDiff line numberDiff line change

@@ -460,7 +460,59 @@ const FEISHU_ACCOUNT_RULES: LegacyConfigRule[] = [

460460

},

461461

];

462462
463+

const WEBCHAT_CHANNEL_RULES: LegacyConfigRule[] = [

464+

{

465+

path: ["channels", "webchat"],

466+

message:

467+

'channels.webchat is retired; use gateway.webchat.chatHistoryMaxChars for WebChat history limits. Run "openclaw doctor --fix".',

468+

},

469+

];

470+
471+

const WEBCHAT_CHAT_HISTORY_MAX_CHARS_LIMIT = 500_000;

472+
473+

function migrateRetiredWebchatChannelConfig(raw: Record<string, unknown>, changes: string[]): void {

474+

const channels = getRecord(raw.channels);

475+

if (!channels || !hasOwnKey(channels, "webchat")) {

476+

return;

477+

}

478+
479+

const webchat = getRecord(channels.webchat);

480+

const legacyTextChunkLimit = webchat?.textChunkLimit;

481+

const gateway = getRecord(raw.gateway) ?? {};

482+

const gatewayWebchat = getRecord(gateway.webchat) ?? {};

483+

const canMoveLegacyTextChunkLimit =

484+

Number.isInteger(legacyTextChunkLimit) &&

485+

legacyTextChunkLimit > 0 &&

486+

legacyTextChunkLimit <= WEBCHAT_CHAT_HISTORY_MAX_CHARS_LIMIT;

487+

if (canMoveLegacyTextChunkLimit && gatewayWebchat.chatHistoryMaxChars === undefined) {

488+

gatewayWebchat.chatHistoryMaxChars = legacyTextChunkLimit;

489+

gateway.webchat = gatewayWebchat;

490+

raw.gateway = gateway;

491+

changes.push("Moved channels.webchat.textChunkLimit → gateway.webchat.chatHistoryMaxChars.");

492+

} else if (

493+

legacyTextChunkLimit !== undefined &&

494+

gatewayWebchat.chatHistoryMaxChars === undefined

495+

) {

496+

changes.push(

497+

"Removed channels.webchat.textChunkLimit (not a valid gateway.webchat.chatHistoryMaxChars value).",

498+

);

499+

}

500+
501+

delete channels.webchat;

502+

raw.channels = channels;

503+

cleanupEmptyRecord(raw, "channels");

504+

changes.push("Removed retired channels.webchat config.");

505+

}

506+
463507

export const LEGACY_CONFIG_MIGRATIONS_CHANNELS: LegacyConfigMigrationSpec[] = [

508+

defineLegacyConfigMigration({

509+

id: "channels.webchat->gateway.webchat",

510+

describe: "Remove retired WebChat channel config",

511+

legacyRules: WEBCHAT_CHANNEL_RULES,

512+

apply: (raw, changes) => {

513+

migrateRetiredWebchatChannelConfig(raw, changes);

514+

},

515+

}),

464516

defineLegacyConfigMigration({

465517

id: "legacy-group-routing->channel-groups",

466518

describe:

Original file line numberDiff line numberDiff line change

@@ -240,7 +240,6 @@ describe("refreshChat", () => {

240240

expect(request).toHaveBeenCalledWith("chat.history", {

241241

sessionKey: "main",

242242

limit: 100,

243-

maxChars: 4000,

244243

});

245244

expect(request).not.toHaveBeenCalledWith("models.list", { view: "configured" });

246245

const sessionsListPayload = findRequestPayload(

@@ -286,7 +285,6 @@ describe("refreshChat", () => {

286285

sessionKey: "global",

287286

agentId: "work",

288287

limit: 100,

289-

maxChars: 4000,

290288

});

291289

const sessionsListPayload = findRequestPayload(

292290

request as unknown as MockCallSource,

@@ -320,7 +318,6 @@ describe("refreshChat", () => {

320318

sessionKey: "agent:work:main",

321319

agentId: "work",

322320

limit: 100,

323-

maxChars: 4000,

324321

});

325322

const sessionsListPayload = findRequestPayload(

326323

request as unknown as MockCallSource,

@@ -374,7 +371,6 @@ describe("refreshChat", () => {

374371

sessionKey: "global",

375372

agentId: "ops",

376373

limit: 100,

377-

maxChars: 4000,

378374

});

379375

const sessionsListPayload = findRequestPayload(

380376

request as unknown as MockCallSource,

@@ -400,7 +396,6 @@ describe("refreshChat", () => {

400396

expect(request).toHaveBeenCalledWith("chat.history", {

401397

sessionKey: "unknown",

402398

limit: 100,

403-

maxChars: 4000,

404399

});

405400

const sessionsListPayload = findRequestPayload(

406401

request as unknown as MockCallSource,

@@ -1869,7 +1864,6 @@ describe("handleSendChat", () => {

18691864

sessionKey: "global",

18701865

agentId: "work",

18711866

limit: 100,

1872-

maxChars: 4000,

18731867

});

18741868

expect(host.chatMessages).toStrictEqual([]);

18751869

});

Original file line numberDiff line numberDiff line change

@@ -1630,7 +1630,6 @@ describe("loadChatHistory retry handling", () => {

16301630

expect(request).toHaveBeenCalledWith("chat.history", {

16311631

sessionKey: "main",

16321632

limit: 100,

1633-

maxChars: 4000,

16341633

});

16351634

expect(state.chatMessages).toEqual([

16361635

{ role: "assistant", content: [{ type: "text", text: "visible answer" }] },

Original file line numberDiff line numberDiff line change

@@ -28,7 +28,6 @@ const SILENT_REPLY_PATTERN = /^\s*NO_REPLY\s*$/;

2828

const SYNTHETIC_TRANSCRIPT_REPAIR_RESULT =

2929

"[openclaw] missing tool result in session history; inserted synthetic error result for transcript repair.";

3030

const CHAT_HISTORY_REQUEST_LIMIT = 100;

31-

const CHAT_HISTORY_REQUEST_MAX_CHARS = 4_000;

3231

const STARTUP_CHAT_HISTORY_RETRY_TIMEOUT_MS = 60_000;

3332

const STARTUP_CHAT_HISTORY_DEFAULT_RETRY_MS = 500;

3433

const STARTUP_CHAT_HISTORY_MAX_RETRY_MS = 5_000;

@@ -467,7 +466,6 @@ async function loadChatHistoryUncached(

467466

sessionKey,

468467

...(requestAgentId ? { agentId: requestAgentId } : {}),

469468

limit: CHAT_HISTORY_REQUEST_LIMIT,

470-

maxChars: CHAT_HISTORY_REQUEST_MAX_CHARS,

471469

});

472470

break;

473471

} catch (err) {