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

推荐订阅源

P
Proofpoint News Feed
U
Unit 42
V
Visual Studio Blog
D
DataBreaches.Net
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
D
Docker
G
Google Developers Blog
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
S
SegmentFault 最新的问题

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
chore(lint): enable stricter error rules · openclaw/openc...
steipete · 2026-06-01 · via Recent Commits to openclaw:main

File tree

    • mattermost/src/mattermost

        • bundled-plugin-install-uninstall

        • openai-web-search-minimal

Original file line numberDiff line numberDiff line change

@@ -82,7 +82,10 @@

8282

"typescript/no-meaningless-void-operator": "error",

8383

"typescript/no-misused-promises": "error",

8484

"typescript/no-inferrable-types": "error",

85+

"typescript/only-throw-error": "error",

8586

"typescript/no-non-null-asserted-nullish-coalescing": "error",

87+

"typescript/prefer-promise-reject-errors": "error",

88+

"typescript/restrict-plus-operands": "error",

8689

"typescript/no-unnecessary-qualifier": "error",

8790

"typescript/no-unnecessary-type-assertion": "error",

8891

"typescript/no-unnecessary-type-arguments": "error",

@@ -109,6 +112,8 @@

109112

"typescript/require-array-sort-compare": "error",

110113

"typescript/restrict-template-expressions": "error",

111114

"typescript/triple-slash-reference": "error",

115+

"typescript/unbound-method": "error",

116+

"typescript/use-unknown-in-catch-callback-variable": "error",

112117

"unicorn/consistent-date-clone": "error",

113118

"unicorn/consistent-empty-array-spread": "error",

114119

"unicorn/consistent-function-scoping": "off",

@@ -128,6 +133,7 @@

128133

"unicorn/no-unnecessary-slice-end": "error",

129134

"unicorn/no-useless-error-capture-stack-trace": "error",

130135

"unicorn/no-useless-promise-resolve-reject": "error",

136+

"unicorn/no-useless-switch-case": "error",

131137

"unicorn/no-zero-fractions": "error",

132138

"unicorn/prefer-date-now": "error",

133139

"unicorn/prefer-dom-node-text-content": "error",

Original file line numberDiff line numberDiff line change

@@ -68,7 +68,7 @@ class LegacyRunTurnEventQueue {

6868

return item;

6969

}

7070

if (this.error) {

71-

throw this.error;

71+

throw toLintErrorObject(this.error, "Non-Error thrown");

7272

}

7373

if (this.closed) {

7474

return null;

@@ -178,3 +178,17 @@ export function lazyStartRuntimeTurn(

178178

},

179179

};

180180

}

181+
182+

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

183+

if (value instanceof Error) {

184+

return value;

185+

}

186+

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

187+

return new Error(value);

188+

}

189+

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

190+

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

191+

Object.assign(error, value);

192+

}

193+

return error;

194+

}

Original file line numberDiff line numberDiff line change

@@ -286,7 +286,7 @@ describe("AcpxRuntime fresh reset wrapper", () => {

286286

})

287287

.then(

288288

() => ({ status: "resolved" as const }),

289-

(error) => ({ status: "rejected" as const, error }),

289+

(error: unknown) => ({ status: "rejected" as const, error }),

290290

);

291291
292292

expect(outcome.status).toBe("rejected");

@@ -298,7 +298,12 @@ describe("AcpxRuntime fresh reset wrapper", () => {

298298

code: "ACP_SESSION_INIT_FAILED",

299299

message: expect.stringContaining("deployment missing"),

300300

});

301-

expect(outcome.error.message).not.toContain("sk-testsecret1234567890");

301+

const error = outcome.error;

302+

expect(error).toBeInstanceOf(AcpRuntimeError);

303+

if (!(error instanceof AcpRuntimeError)) {

304+

throw new Error("expected AcpRuntimeError");

305+

}

306+

expect(error.message).not.toContain("sk-testsecret1234567890");

302307

});

303308
304309

it("adds Codex wrapper stderr tail to generic first-turn failures", async () => {

Original file line numberDiff line numberDiff line change

@@ -218,13 +218,21 @@ describe("active-memory plugin", () => {

218218

};

219219

const waitForAbort = async (abortSignal?: AbortSignal): Promise<never> => {

220220

if (abortSignal?.aborted) {

221-

throw (abortSignal.reason as unknown) ?? new Error("Operation aborted");

221+

throw toLintErrorObject(

222+

(abortSignal.reason as unknown) ?? new Error("Operation aborted"),

223+

"Non-Error thrown",

224+

);

222225

}

223226

return await new Promise<never>((_resolve, reject) => {

224227

abortSignal?.addEventListener(

225228

"abort",

226229

() => {

227-

reject((abortSignal.reason as unknown) ?? new Error("Operation aborted"));

230+

reject(

231+

toLintErrorObject(

232+

(abortSignal.reason as unknown) ?? new Error("Operation aborted"),

233+

"Non-Error rejection",

234+

),

235+

);

228236

},

229237

{ once: true },

230238

);

@@ -4350,3 +4358,17 @@ describe("active-memory plugin", () => {

43504358

expect(config.circuitBreakerCooldownMs).toBe(5000);

43514359

});

43524360

});

4361+
4362+

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

4363+

if (value instanceof Error) {

4364+

return value;

4365+

}

4366+

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

4367+

return new Error(value);

4368+

}

4369+

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

4370+

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

4371+

Object.assign(error, value);

4372+

}

4373+

return error;

4374+

}

Original file line numberDiff line numberDiff line change

@@ -1011,7 +1011,6 @@ function buildPromptStyleLines(style: ActiveMemoryPromptStyle): string[] {

10111011

"If relevant memory is mostly a stable user preference or recurring habit, lean toward returning it.",

10121012

"If the strongest match is only a one-off historical fact and not a recurring preference or habit, prefer NONE unless the latest user message clearly asks for that fact.",

10131013

];

1014-

case "balanced":

10151014

default:

10161015

return [

10171016

"Treat the latest user message as the primary query.",

@@ -1982,7 +1981,7 @@ async function waitForSubagentPartialTimeoutData(

19821981

(await Promise.race([

19831982

subagentPromise.then(

19841983

() => undefined,

1985-

(error) => readPartialTimeoutData(error),

1984+

(error: unknown) => readPartialTimeoutData(error),

19861985

),

19871986

timeoutPromise,

19881987

])) ?? {}

Original file line numberDiff line numberDiff line change

@@ -571,7 +571,7 @@ export async function startGatewayBonjourAdvertiser(

571571

.then(() => {

572572

logger.info(`bonjour: advertised ${serviceSummary(label, svc)}`);

573573

})

574-

.catch((err) => {

574+

.catch((err: unknown) => {

575575

handleAdvertiseFailure(label, svc, err, "failed");

576576

});

577577

} catch (err) {

@@ -747,7 +747,7 @@ export async function startGatewayBonjourAdvertiser(

747747

)})`,

748748

);

749749

try {

750-

void svc.advertise().catch((err) => {

750+

void svc.advertise().catch((err: unknown) => {

751751

logger.warn(

752752

`bonjour: watchdog re-advertise failed (${serviceSummary(label, svc)}): ${formatBonjourError(err)}`,

753753

);

Original file line numberDiff line numberDiff line change

@@ -416,7 +416,8 @@ describe("cdp.helpers internal", () => {

416416

await expect(

417417

withCdpSocket(server.url, async (send) => {

418418

await send("Test.ok");

419-

const rejectRawString = () => Promise.reject("raw-string-from-callback");

419+

const rejectRawString = () =>

420+

Promise.reject(toLintErrorObject("raw-string-from-callback", "Non-Error rejection"));

420421

return rejectRawString();

421422

}),

422423

).rejects.toThrow(/raw-string-from-callback/);

@@ -572,3 +573,17 @@ describe("openCdpWebSocket option handling", () => {

572573

ws.close();

573574

});

574575

});

576+
577+

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

578+

if (value instanceof Error) {

579+

return value;

580+

}

581+

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

582+

return new Error(value);

583+

}

584+

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

585+

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

586+

Object.assign(error, value);

587+

}

588+

return error;

589+

}

Original file line numberDiff line numberDiff line change

@@ -258,7 +258,7 @@ function extractJsonMessage(result: ChromeMcpToolResult): unknown {

258258

}

259259

}

260260

if (lastError) {

261-

throw lastError;

261+

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

262262

}

263263

return null;

264264

}

@@ -629,7 +629,7 @@ async function closeChromeMcpClientAndProcess(params: {

629629

return;

630630

}

631631

await params.client.close().catch(() => {});

632-

await terminateChromeMcpProcessTree(rootPid, descendantPids).catch((err) => {

632+

await terminateChromeMcpProcessTree(rootPid, descendantPids).catch((err: unknown) => {

633633

log.trace(

634634

`Unable to fully terminate Chrome MCP subprocess tree for pid ${rootPid}: ${err instanceof Error ? err.message : String(err)}`,

635635

);

@@ -761,7 +761,8 @@ async function waitForChromeMcpReady(

761761

if (signal) {

762762

racers.push(

763763

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

764-

abortListener = () => reject(signal.reason ?? new Error("aborted"));

764+

abortListener = () =>

765+

reject(toLintErrorObject(signal.reason ?? new Error("aborted"), "Non-Error rejection"));

765766

signal.addEventListener("abort", abortListener, { once: true });

766767

}),

767768

);

@@ -793,7 +794,8 @@ async function waitForChromeMcpPendingSession(

793794

return await Promise.race([

794795

pending,

795796

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

796-

abortListener = () => reject(signal.reason ?? new Error("aborted"));

797+

abortListener = () =>

798+

reject(toLintErrorObject(signal.reason ?? new Error("aborted"), "Non-Error rejection"));

797799

signal.addEventListener("abort", abortListener, { once: true });

798800

}),

799801

]);

@@ -1022,7 +1024,8 @@ async function callTool(

10221024

if (signal) {

10231025

racers.push(

10241026

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

1025-

abortListener = () => reject(signal.reason ?? new Error("aborted"));

1027+

abortListener = () =>

1028+

reject(toLintErrorObject(signal.reason ?? new Error("aborted"), "Non-Error rejection"));

10261029

signal.addEventListener("abort", abortListener, { once: true });

10271030

}),

10281031

);

@@ -1540,3 +1543,17 @@ export async function resetChromeMcpSessionsForTest(): Promise<void> {

15401543

await stopAllChromeMcpSessions();

15411544

chromeMcpProcessCleanupDepsForTest = null;

15421545

}

1546+
1547+

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

1548+

if (value instanceof Error) {

1549+

return value;

1550+

}

1551+

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

1552+

return new Error(value);

1553+

}

1554+

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

1555+

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

1556+

Object.assign(error, value);

1557+

}

1558+

return error;

1559+

}

Original file line numberDiff line numberDiff line change

@@ -315,9 +315,17 @@ export async function fetchBrowserJson<T>(

315315
316316

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

317317

const abortPromise: Promise<never> = abortCtrl.signal.aborted

318-

? Promise.reject(abortCtrl.signal.reason ?? new Error("aborted"))

318+

? Promise.reject(

319+

toLintErrorObject(abortCtrl.signal.reason ?? new Error("aborted"), "Non-Error rejection"),

320+

)

319321

: new Promise((_, reject) => {

320-

abortListener = () => reject(abortCtrl.signal.reason ?? new Error("aborted"));

322+

abortListener = () =>

323+

reject(

324+

toLintErrorObject(

325+

abortCtrl.signal.reason ?? new Error("aborted"),

326+

"Non-Error rejection",

327+

),

328+

);

321329

abortCtrl.signal.addEventListener("abort", abortListener, { once: true });

322330

});

323331

@@ -382,3 +390,17 @@ export const testApi = {

382390

withLoopbackBrowserAuth: withLoopbackBrowserAuthImpl,

383391

};

384392

export { testApi as __test };

393+
394+

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

395+

if (value instanceof Error) {

396+

return value;

397+

}

398+

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

399+

return new Error(value);

400+

}

401+

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

402+

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

403+

Object.assign(error, value);

404+

}

405+

return error;

406+

}

Original file line numberDiff line numberDiff line change

@@ -1359,12 +1359,12 @@ export async function gotoPageWithNavigationGuard(

13591359

try {

13601360

const response = await opts.page.goto(opts.url, { timeout: opts.timeoutMs });

13611361

if (blockedError) {

1362-

throw blockedError;

1362+

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

13631363

}

13641364

return response;

13651365

} catch (err) {

13661366

if (blockedError) {

1367-

throw blockedError;

1367+

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

13681368

}

13691369

throw err;

13701370

} finally {

@@ -1813,3 +1813,17 @@ export async function focusPageByTargetIdViaPlaywright(opts: {

18131813

}

18141814

}

18151815

}

1816+
1817+

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

1818+

if (value instanceof Error) {

1819+

return value;

1820+

}

1821+

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

1822+

return new Error(value);

1823+

}

1824+

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

1825+

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

1826+

Object.assign(error, value);

1827+

}

1828+

return error;

1829+

}