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

推荐订阅源

H
Help Net Security
月光博客
月光博客
IT之家
IT之家
B
Blog RSS Feed
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园_首页
B
Blog
V
V2EX
腾讯CDC
Vercel News
Vercel News
量子位
Microsoft Security Blog
Microsoft Security 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
Revert "fix(ci): clean core unsafe assertions" · openclaw...
steipete · 2026-05-31 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -8,10 +8,8 @@ const packageRootCache = new Map<string, string | null>();

88

const argv1CandidateCache = new Map<string, string[]>();

99
1010

function parsePackageName(raw: string): string | null {

11-

const parsed: unknown = JSON.parse(raw);

12-

return parsed && typeof parsed === "object" && "name" in parsed && typeof parsed.name === "string"

13-

? parsed.name

14-

: null;

11+

const parsed = JSON.parse(raw) as { name?: unknown };

12+

return typeof parsed.name === "string" ? parsed.name : null;

1513

}

1614
1715

async function readPackageName(dir: string): Promise<string | null> {

Original file line numberDiff line numberDiff line change

@@ -7,13 +7,8 @@ export const OPENCLAW_DEV_SOURCE_ROOT_ENV = "OPENCLAW_DEV_SOURCE_ROOT";

77
88

function readPackageName(packageJsonPath: string): string | null {

99

try {

10-

const parsed: unknown = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));

11-

return parsed &&

12-

typeof parsed === "object" &&

13-

"name" in parsed &&

14-

typeof parsed.name === "string"

15-

? parsed.name

16-

: null;

10+

const parsed = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")) as { name?: unknown };

11+

return typeof parsed.name === "string" ? parsed.name : null;

1712

} catch {

1813

return null;

1914

}

Original file line numberDiff line numberDiff line change

@@ -41,7 +41,6 @@ export class PluginLruCache<T> {

4141

if (!this.#entries.has(cacheKey)) {

4242

return { hit: false };

4343

}

44-

// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Map.has proves the value exists while preserving caller-specific cache value type.

4544

const cached = this.#entries.get(cacheKey) as T;

4645

this.#entries.delete(cacheKey);

4746

this.#entries.set(cacheKey, cached);

@@ -89,7 +88,6 @@ export function resolveConfigScopedRuntimeCacheValue<T>(params: {

8988

params.cache.set(params.config, configCache);

9089

}

9190

if (configCache.has(params.key)) {

92-

// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Map.has proves the value exists while preserving caller-specific cache value type.

9391

return configCache.get(params.key) as T;

9492

}

9593

const loaded = params.load();

Original file line numberDiff line numberDiff line change

@@ -61,13 +61,6 @@ const pluginModuleLoaderStats = {

6161

sourceTransformTargets: new Map<string, number>(),

6262

};

6363
64-

function isJitiLoaderModule(value: unknown): value is { createJiti: PluginModuleLoaderFactory } {

65-

const canHaveProperties = (value && typeof value === "object") || typeof value === "function";

66-

return Boolean(

67-

canHaveProperties && "createJiti" in value && typeof value.createJiti === "function",

68-

);

69-

}

70-
7164

function recordSourceTransformTarget(target: string): void {

7265

const current = pluginModuleLoaderStats.sourceTransformTargets.get(target) ?? 0;

7366

pluginModuleLoaderStats.sourceTransformTargets.set(target, current + 1);

@@ -114,8 +107,8 @@ function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory {

114107

if (createJitiLoaderFactory) {

115108

return createJitiLoaderFactory;

116109

}

117-

const loaded: unknown = requireForJiti("jiti");

118-

if (!isJitiLoaderModule(loaded)) {

110+

const loaded = requireForJiti("jiti") as { createJiti?: PluginModuleLoaderFactory };

111+

if (typeof loaded.createJiti !== "function") {

119112

throw new Error("jiti module did not export createJiti");

120113

}

121114

createJitiLoaderFactory = loaded.createJiti;

Original file line numberDiff line numberDiff line change

@@ -32,17 +32,13 @@ export type ResolvedTranscriptsConfig = {

3232

autoStart: ResolvedTranscriptsAutoStartConfig[];

3333

};

3434
35-

function isRecord(value: unknown): value is Record<string, unknown> {

36-

return Boolean(value && typeof value === "object" && !Array.isArray(value));

37-

}

38-
3935

function resolveAutoStart(raw: unknown): ResolvedTranscriptsAutoStartConfig[] {

4036

if (!Array.isArray(raw)) {

4137

return [];

4238

}

4339

return raw

4440

.map((entry): ResolvedTranscriptsAutoStartConfig | undefined => {

45-

const config = isRecord(entry) ? entry : {};

41+

const config = entry && typeof entry === "object" ? (entry as Record<string, unknown>) : {};

4642

const providerId = readString(config.providerId);

4743

if (!providerId) {

4844

return undefined;

@@ -61,7 +57,7 @@ function resolveAutoStart(raw: unknown): ResolvedTranscriptsAutoStartConfig[] {

6157

}

6258
6359

export function resolveTranscriptsConfig(raw: unknown): ResolvedTranscriptsConfig {

64-

const config = isRecord(raw) ? raw : {};

60+

const config = raw && typeof raw === "object" ? (raw as Record<string, unknown>) : {};

6561

const maxUtterances =

6662

typeof config.maxUtterances === "number" && Number.isFinite(config.maxUtterances)

6763

? Math.max(1, Math.min(10_000, Math.floor(config.maxUtterances)))

Original file line numberDiff line numberDiff line change

@@ -32,7 +32,6 @@ export const clamp = clampNumber;

3232

// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- JSON parsing helper lets callers ascribe the expected payload type.

3333

export function safeParseJson<T>(raw: string): T | null {

3434

try {

35-

// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- JSON parsing helper lets callers ascribe the expected payload type.

3635

return JSON.parse(raw) as T;

3736

} catch {

3837

return null;

Original file line numberDiff line numberDiff line change

@@ -10,6 +10,8 @@ export type ResolvedReactionLevel = {

1010

agentReactionGuidance?: "minimal" | "extensive";

1111

};

1212
13+

const LEVELS = new Set<ReactionLevel>(["off", "ack", "minimal", "extensive"]);

14+
1315

function parseLevel(

1416

value: unknown,

1517

): { kind: "missing" } | { kind: "invalid" } | { kind: "ok"; value: ReactionLevel } {

@@ -23,12 +25,8 @@ function parseLevel(

2325

if (!trimmed) {

2426

return { kind: "missing" };

2527

}

26-

switch (trimmed) {

27-

case "off":

28-

case "ack":

29-

case "minimal":

30-

case "extensive":

31-

return { kind: "ok", value: trimmed };

28+

if (LEVELS.has(trimmed as ReactionLevel)) {

29+

return { kind: "ok", value: trimmed as ReactionLevel };

3230

}

3331

return { kind: "invalid" };

3432

}