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

推荐订阅源

腾讯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(agents): suggest recovery for unknown tool ids (#9337...
mushuiyu886 · 2026-06-23 · via Recent Commits to openclaw:main

@@ -305,13 +305,24 @@ class CodeModeLimitError extends ToolInputError {

305305

}

306306

}

307307308+

function isRuntimeInterruptedError(error: unknown): boolean {

309+

return errorMessage(error) === "interrupted";

310+

}

311+308312

function codeModeFailureCode(error: unknown): CodeModeFailureCode {

309313

if (error instanceof CodeModeLimitError) {

310314

return error.code;

311315

}

316+

if (isRuntimeInterruptedError(error)) {

317+

return "timeout";

318+

}

312319

return error instanceof ToolInputError ? "invalid_input" : "internal_error";

313320

}

314321322+

function codeModeFailureMessage(error: unknown): string {

323+

return isRuntimeInterruptedError(error) ? "code mode timeout exceeded" : errorMessage(error);

324+

}

325+315326

function enforceOutputLimit(output: unknown[], config: CodeModeConfig): void {

316327

if (jsonByteLength(output) > config.maxOutputBytes) {

317328

throw new CodeModeLimitError("output_limit_exceeded", "code mode output limit exceeded");

@@ -505,15 +516,21 @@ async function runBridgeRequest(params: {

505516

if (typeof id !== "string") {

506517

throw new ToolInputError("describe id must be a string.");

507518

}

508-

value = await params.runtime.describe(id, { includeMcp: false });

519+

value = await params.runtime.describe(id, {

520+

includeMcp: false,

521+

recoverySurface: "tools",

522+

});

509523

break;

510524

}

511525

case "call": {

512526

const id = values[0];

513527

if (typeof id !== "string") {

514528

throw new ToolInputError("call id must be a string.");

515529

}

516-

const described = await params.runtime.describe(id, { includeMcp: false });

530+

const described = await params.runtime.describe(id, {

531+

includeMcp: false,

532+

recoverySurface: "tools",

533+

});

517534

value = await params.runtime.callExactId(described.id, values[1] ?? {}, {

518535

parentToolCallId: params.parentToolCallId,

519536

signal: params.signal,

@@ -606,24 +623,26 @@ function failedCodeModeWorkerResult(

606623

};

607624

}

608625609-

function isQuickJsInterruptedWorkerError(error: unknown): boolean {

610-

return String(error) === "interrupted";

611-

}

612-613-

function normalizeCodeModeWorkerResult(result: CodeModeWorkerResult): CodeModeWorkerResult {

626+

function normalizeCodeModeTimeoutResult<

627+

T extends { status: string; code?: unknown; error?: unknown },

628+

>(result: T): T {

614629

if (

615630

result.status === "failed" &&

616631

result.code === "timeout" &&

617-

isQuickJsInterruptedWorkerError(result.error)

632+

!String(result.error).includes("timeout exceeded")

618633

) {

619634

return {

620635

...result,

621636

error: "code mode timeout exceeded",

622-

};

637+

} as T;

623638

}

624639

return result;

625640

}

626641642+

function normalizeCodeModeWorkerResult(result: CodeModeWorkerResult): CodeModeWorkerResult {

643+

return normalizeCodeModeTimeoutResult(result);

644+

}

645+627646

async function runCodeModeWorker(

628647

workerData: unknown,

629648

timeoutMs: number,

@@ -855,7 +874,7 @@ async function runExec(params: {

855874

} catch (error) {

856875

return {

857876

status: "failed" as const,

858-

error: errorMessage(error),

877+

error: codeModeFailureMessage(error),

859878

code: codeModeFailureCode(error),

860879

output: [],

861880

telemetry: telemetry(runtime),

@@ -889,7 +908,7 @@ async function runExec(params: {

889908

} catch (error) {

890909

return {

891910

status: "failed" as const,

892-

error: errorMessage(error),

911+

error: codeModeFailureMessage(error),

893912

code: codeModeFailureCode(error),

894913

output: [],

895914

telemetry: telemetry(runtime),

@@ -1094,7 +1113,7 @@ async function runWait(params: {

10941113

} catch (error) {

10951114

return {

10961115

status: "failed" as const,

1097-

error: errorMessage(error),

1116+

error: codeModeFailureMessage(error),

10981117

code: codeModeFailureCode(error),

10991118

output: state.output,

11001119

telemetry: telemetry(state.runtime),

@@ -1135,14 +1154,16 @@ export function createCodeModeTools(ctx: CodeModeToolContext): AnyAgentTool[] {

11351154

) => {

11361155

const input = readCode(args);

11371156

return jsonResult(

1138-

await runExec({

1139-

toolCallId,

1140-

ctx,

1141-

code: input.code,

1142-

language: input.language,

1143-

signal,

1144-

onUpdate,

1145-

}),

1157+

normalizeCodeModeTimeoutResult(

1158+

await runExec({

1159+

toolCallId,

1160+

ctx,

1161+

code: input.code,

1162+

language: input.language,

1163+

signal,

1164+

onUpdate,

1165+

}),

1166+

),

11461167

);

11471168

},

11481169

} as AnyAgentTool);

@@ -1160,13 +1181,15 @@ export function createCodeModeTools(ctx: CodeModeToolContext): AnyAgentTool[] {

11601181

onUpdate?: AgentToolUpdateCallback,

11611182

) =>

11621183

jsonResult(

1163-

await runWait({

1164-

toolCallId,

1165-

ctx,

1166-

runId: readRunId(args),

1167-

signal,

1168-

onUpdate,

1169-

}),

1184+

normalizeCodeModeTimeoutResult(

1185+

await runWait({

1186+

toolCallId,

1187+

ctx,

1188+

runId: readRunId(args),

1189+

signal,

1190+

onUpdate,

1191+

}),

1192+

),

11701193

),

11711194

} as AnyAgentTool);

11721195

return [execTool, waitTool];