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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
大猫的无限游戏
大猫的无限游戏
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Jina AI
Jina AI
GbyAI
GbyAI
云风的 BLOG
云风的 BLOG
B
Blog RSS Feed
Last Week in AI
Last Week in AI
The Cloudflare Blog
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 叶小钗
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recorded Future
Recorded Future
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
罗磊的独立博客
雷峰网
雷峰网
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
L
LINUX DO - 热门话题
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
C
Cybersecurity and Infrastructure Security Agency CISA
小众软件
小众软件
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Announcements
Recent Announcements
T
Threat Research - Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
宝玉的分享
宝玉的分享
D
DataBreaches.Net
T
The Exploit Database - CXSecurity.com
Vercel News
Vercel News
IT之家
IT之家
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Troy Hunt's Blog
aimingoo的专栏
aimingoo的专栏

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
refactor(agents): share error normalization helpers · openclaw/openclaw@80805ad
vincentkoc · 2026-06-23 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -15,6 +15,7 @@ import { redactSensitiveUrlLikeString } from "@openclaw/net-policy/redact-sensit

1515

import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";

1616

import { Compile } from "typebox/compile";

1717

import type { OpenClawConfig } from "../config/types.openclaw.js";

18+

import { toErrorObject } from "../infra/errors.js";

1819

import { logWarn } from "../logger.js";

1920

import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";

2021

import { resolveGlobalSingleton } from "../shared/global-singleton.js";

@@ -204,7 +205,7 @@ function connectWithTimeout(

204205

},

205206

(error: unknown) => {

206207

clearTimeout(timer);

207-

reject(toLintErrorObject(error, "Non-Error rejection"));

208+

reject(toErrorObject(error, "Non-Error rejection"));

208209

},

209210

);

210211

});

@@ -1144,17 +1145,3 @@ export const testing = {

11441145

resolveSessionMcpRuntimeIdleTtlMs,

11451146

};

11461147

export { testing as __testing };

1147-
1148-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

1149-

if (value instanceof Error) {

1150-

return value;

1151-

}

1152-

if (typeof value === "string") {

1153-

return new Error(value);

1154-

}

1155-

const error = new Error(fallbackMessage, { cause: value });

1156-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

1157-

Object.assign(error, value);

1158-

}

1159-

return error;

1160-

}

Original file line numberDiff line numberDiff line change

@@ -8,6 +8,7 @@ import path from "node:path";

88

import { URL } from "node:url";

99

import { detectMime } from "@openclaw/media-core/mime";

1010

import { isWindowsDrivePath } from "../infra/archive-path.js";

11+

import { toErrorObject } from "../infra/errors.js";

1112

import {

1213

canonicalPathFromExistingAncestor,

1314

root as fsRoot,

@@ -737,7 +738,7 @@ async function assertSandboxPathWithinAnyRoot(params: {

737738

firstRootEscapeError ??= error;

738739

}

739740

}

740-

throw toLintErrorObject(

741+

throw toErrorObject(

741742

firstRootEscapeError ?? new Error("Path guard has no configured roots."),

742743

"Non-Error thrown",

743744

);

@@ -1127,17 +1128,3 @@ function createFsAccessError(code: string, filePath: string): NodeJS.ErrnoExcept

11271128

error.code = code;

11281129

return error;

11291130

}

1130-
1131-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

1132-

if (value instanceof Error) {

1133-

return value;

1134-

}

1135-

if (typeof value === "string") {

1136-

return new Error(value);

1137-

}

1138-

const error = new Error(fallbackMessage, { cause: value });

1139-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

1140-

Object.assign(error, value);

1141-

}

1142-

return error;

1143-

}

Original file line numberDiff line numberDiff line change

@@ -5,6 +5,7 @@

55

*/

66

import { readResponseTextSnippet } from "@openclaw/media-core/read-response-with-limit";

77

import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";

8+

import { toErrorObject } from "../infra/errors.js";

89

import { getEnvApiKey } from "../llm/env-api-keys.js";

910

import { calculateCost, clampThinkingLevel } from "../llm/model-utils.js";

1011

import {

@@ -681,7 +682,7 @@ function readAnthropicSseChunk(

681682

}

682683

settled = true;

683684

signal.removeEventListener("abort", onAbort);

684-

reject(toLintErrorObject(error, "Non-Error rejection"));

685+

reject(toErrorObject(error, "Non-Error rejection"));

685686

},

686687

);

687688

});

@@ -1604,17 +1605,3 @@ export function createAnthropicMessagesTransportStreamFn(): StreamFn {

16041605

return eventStream as ReturnType<StreamFn>;

16051606

};

16061607

}

1607-
1608-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

1609-

if (value instanceof Error) {

1610-

return value;

1611-

}

1612-

if (typeof value === "string") {

1613-

return new Error(value);

1614-

}

1615-

const error = new Error(fallbackMessage, { cause: value });

1616-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

1617-

Object.assign(error, value);

1618-

}

1619-

return error;

1620-

}

Original file line numberDiff line numberDiff line change

@@ -15,7 +15,7 @@ import { createReplyPrefixContext } from "../../channels/reply-prefix.js";

1515

import { createOutboundSendDeps, type CliDeps } from "../../cli/outbound-send-deps.js";

1616

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

1717

import type { OpenClawConfig } from "../../config/types.openclaw.js";

18-

import { formatErrorMessage } from "../../infra/errors.js";

18+

import { formatErrorMessage, toErrorObject } from "../../infra/errors.js";

1919

import {

2020

resolveAgentDeliveryPlanWithSessionRoute,

2121

resolveAgentOutboundTarget,

@@ -702,7 +702,7 @@ export async function deliverAgentCommandResult(

702702

};

703703

if (strictPreDeliveryError) {

704704

emitJsonEnvelope(deliveryStatus);

705-

throw toLintErrorObject(strictPreDeliveryError, "Non-Error thrown");

705+

throw toErrorObject(strictPreDeliveryError, "Non-Error thrown");

706706

}

707707
708708

const deliveryPayloads = projectOutboundPayloadPlanForOutbound(outboundPayloadPlan);

@@ -802,17 +802,3 @@ export async function deliverAgentCommandResult(

802802

deliveryStatus,

803803

});

804804

}

805-
806-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

807-

if (value instanceof Error) {

808-

return value;

809-

}

810-

if (typeof value === "string") {

811-

return new Error(value);

812-

}

813-

const error = new Error(fallbackMessage, { cause: value });

814-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

815-

Object.assign(error, value);

816-

}

817-

return error;

818-

}

Original file line numberDiff line numberDiff line change

@@ -6,6 +6,7 @@ import path from "node:path";

66

import { fileURLToPath, pathToFileURL } from "node:url";

77

import { Worker } from "node:worker_threads";

88

import { resolveTimerTimeoutMs } from "@openclaw/normalization-core/number-coercion";

9+

import { toErrorObject } from "../infra/errors.js";

910

import {

1011

buildHistoryPrunePlan,

1112

buildOversizedFallbackPlan,

@@ -60,7 +61,7 @@ function runCompactionPlanningWorker(params: {

6061

}): Promise<CompactionPlanningWorkerValue> {

6162

if (params.signal?.aborted) {

6263

return Promise.reject(

63-

toLintErrorObject(

64+

toErrorObject(

6465

params.signal.reason ?? new Error("compaction planning aborted"),

6566

"Non-Error rejection",

6667

),

@@ -105,7 +106,7 @@ function runCompactionPlanningWorker(params: {

105106

settle(

106107

() =>

107108

reject(

108-

toLintErrorObject(

109+

toErrorObject(

109110

params.signal?.reason ?? new Error("compaction planning aborted"),

110111

"Non-Error rejection",

111112

),

@@ -367,17 +368,3 @@ export const compactionPlanningWorkerTesting = {

367368

runCompactionPlanningWorker,

368369

CompactionPlanningWorkerError,

369370

};

370-
371-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

372-

if (value instanceof Error) {

373-

return value;

374-

}

375-

if (typeof value === "string") {

376-

return new Error(value);

377-

}

378-

const error = new Error(fallbackMessage, { cause: value });

379-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

380-

Object.assign(error, value);

381-

}

382-

return error;

383-

}

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,7 @@ import {

2525

resolveExpiresAtMsFromDurationMs,

2626

} from "@openclaw/normalization-core/number-coercion";

2727

import type { OpenClawConfig } from "../../config/types.openclaw.js";

28+

import { toErrorObject } from "../../infra/errors.js";

2829

import { resolveOpenClawPackageRootSync } from "../../infra/openclaw-root.js";

2930

import { privateFileStoreSync } from "../../infra/private-file-store.js";

3031

import { createSubsystemLogger } from "../../logging/subsystem.js";

@@ -1235,7 +1236,7 @@ function postNativeHookRelayBridgeRecord(params: {

12351236

const rejectOnce = (error: unknown) => {

12361237

if (!settled) {

12371238

settled = true;

1238-

reject(toLintErrorObject(error, "Non-Error rejection"));

1239+

reject(toErrorObject(error, "Non-Error rejection"));

12391240

}

12401241

};

12411242

const req = httpRequest(

@@ -2060,10 +2061,10 @@ async function waitForNativeHookRelayApprovalDecision(params: {

20602061

let onAbort: (() => void) | undefined;

20612062

const abortPromise = new Promise<never>((_, reject) => {

20622063

if (params.signal!.aborted) {

2063-

reject(toLintErrorObject(params.signal!.reason, "Non-Error rejection"));

2064+

reject(toErrorObject(params.signal!.reason, "Non-Error rejection"));

20642065

return;

20652066

}

2066-

onAbort = () => reject(toLintErrorObject(params.signal!.reason, "Non-Error rejection"));

2067+

onAbort = () => reject(toErrorObject(params.signal!.reason, "Non-Error rejection"));

20672068

params.signal!.addEventListener("abort", onAbort, { once: true });

20682069

});

20692070

try {

@@ -2380,17 +2381,3 @@ export const testing = {

23802381

},

23812382

} as const;

23822383

export { testing as __testing };

2383-
2384-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

2385-

if (value instanceof Error) {

2386-

return value;

2387-

}

2388-

if (typeof value === "string") {

2389-

return new Error(value);

2390-

}

2391-

const error = new Error(fallbackMessage, { cause: value });

2392-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

2393-

Object.assign(error, value);

2394-

}

2395-

return error;

2396-

}

Original file line numberDiff line numberDiff line change

@@ -9,7 +9,7 @@ import {

99

} from "../config/model-input.js";

1010

import type { OpenClawConfig } from "../config/types.openclaw.js";

1111

import { emitFailoverEvent } from "../infra/diagnostic-events.js";

12-

import { formatErrorMessage } from "../infra/errors.js";

12+

import { formatErrorMessage, toErrorObject } from "../infra/errors.js";

1313

import { createSubsystemLogger } from "../logging/subsystem.js";

1414

import { normalizePluginsConfig } from "../plugins/config-state.js";

1515

import { getCurrentPluginMetadataSnapshot } from "../plugins/current-plugin-metadata-snapshot.js";

@@ -431,7 +431,7 @@ async function runFallbackAttempt<T>(params: {

431431

});

432432

if (classifiedError) {

433433

if (isTerminalAbort(params.abortSignal)) {

434-

throw toLintErrorObject(classifiedError, "Non-Error thrown");

434+

throw toErrorObject(classifiedError, "Non-Error thrown");

435435

}

436436

const preserveResultOnExhaustion =

437437

classification &&

@@ -670,7 +670,7 @@ function throwFallbackFailureSummary(params: {

670670

agentDir?: string;

671671

}): never {

672672

if (params.attempts.length <= 1 && params.lastError) {

673-

throw toLintErrorObject(params.lastError, "Non-Error thrown");

673+

throw toErrorObject(params.lastError, "Non-Error thrown");

674674

}

675675
676676

if (params.attribution?.sessionId) {

@@ -1946,17 +1946,3 @@ export async function runWithImageModelFallback<T>(params: {

19461946

});

19471947

}

19481948

export { testing as __testing };

1949-
1950-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

1951-

if (value instanceof Error) {

1952-

return value;

1953-

}

1954-

if (typeof value === "string") {

1955-

return new Error(value);

1956-

}

1957-

const error = new Error(fallbackMessage, { cause: value });

1958-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

1959-

Object.assign(error, value);

1960-

}

1961-

return error;

1962-

}

Original file line numberDiff line numberDiff line change

@@ -8,6 +8,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";

88

import { Worker } from "node:worker_threads";

99

import { hashRuntimeConfigValue } from "../config/runtime-snapshot.js";

1010

import type { OpenClawConfig } from "../config/types.openclaw.js";

11+

import { toErrorObject } from "../infra/errors.js";

1112

import {

1213

listAgentIds,

1314

resolveAgentDir,

@@ -582,7 +583,7 @@ function runProviderAuthWarmWorker(params: {

582583

resolve({ agents: [] });

583584

return;

584585

}

585-

reject(toLintErrorObject(error, "Non-Error rejection"));

586+

reject(toErrorObject(error, "Non-Error rejection"));

586587

});

587588

});

588589

worker.once("exit", (code) => {

@@ -638,17 +639,3 @@ export async function warmCurrentProviderAuthStateOffMainThread(

638639

}

639640

publishProviderAuthWarmSnapshot(snapshot);

640641

}

641-
642-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

643-

if (value instanceof Error) {

644-

return value;

645-

}

646-

if (typeof value === "string") {

647-

return new Error(value);

648-

}

649-

const error = new Error(fallbackMessage, { cause: value });

650-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

651-

Object.assign(error, value);

652-

}

653-

return error;

654-

}

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ import {

99

resolvePositiveTimerTimeoutMs,

1010

} from "@openclaw/normalization-core/number-coercion";

1111

import type { ModelProviderLocalServiceConfig } from "../config/types.models.js";

12+

import { toErrorObject } from "../infra/errors.js";

1213

import type { Model } from "../llm/types.js";

1314

import { createSubsystemLogger } from "../logging/subsystem.js";

1415

import {

@@ -430,7 +431,7 @@ function waitForAbort<T>(promise: Promise<T>, signal?: AbortSignal | null): Prom

430431

},

431432

(error: unknown) => {

432433

cleanup();

433-

reject(toLintErrorObject(error, "Non-Error rejection"));

434+

reject(toErrorObject(error, "Non-Error rejection"));

434435

},

435436

);

436437

});

@@ -523,17 +524,3 @@ export function hasLocalServiceProcessExited(

523524

): boolean {

524525

return child.exitCode !== null || child.signalCode !== null;

525526

}

526-
527-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

528-

if (value instanceof Error) {

529-

return value;

530-

}

531-

if (typeof value === "string") {

532-

return new Error(value);

533-

}

534-

const error = new Error(fallbackMessage, { cause: value });

535-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

536-

Object.assign(error, value);

537-

}

538-

return error;

539-

}

Original file line numberDiff line numberDiff line change

@@ -8,6 +8,7 @@ import fs from "node:fs/promises";

88

import os from "node:os";

99

import path from "node:path";

1010

import { resolveRootPath } from "../../infra/boundary-path.js";

11+

import { toErrorObject } from "../../infra/errors.js";

1112

import { parseSshTarget } from "../../infra/ssh-tunnel.js";

1213

import { resolvePreferredOpenClawTmpDir } from "../../infra/tmp-openclaw-dir.js";

1314

import { resolveUserPath } from "../../utils.js";

@@ -743,7 +744,7 @@ export async function uploadDirectoryToSshTarget(params: {

743744

const fail = (error: unknown) => {

744745

tar.kill("SIGKILL");

745746

ssh.kill("SIGKILL");

746-

reject(toLintErrorObject(error, "Non-Error rejection"));

747+

reject(toErrorObject(error, "Non-Error rejection"));

747748

};

748749
749750

tar.on("error", fail);

@@ -846,17 +847,3 @@ async function writeSecretMaterial(

846847

await fs.chmod(pathname, 0o600);

847848

return pathname;

848849

}

849-
850-

function toLintErrorObject(value: unknown, fallbackMessage: string): Error {

851-

if (value instanceof Error) {

852-

return value;

853-

}

854-

if (typeof value === "string") {

855-

return new Error(value);

856-

}

857-

const error = new Error(fallbackMessage, { cause: value });

858-

if ((typeof value === "object" && value !== null) || typeof value === "function") {

859-

Object.assign(error, value);

860-

}

861-

return error;

862-

}