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

推荐订阅源

博客园_首页
爱范儿
爱范儿
罗磊的独立博客
V
V2EX
量子位
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园 - 叶小钗
小众软件
小众软件
博客园 - 【当耐特】
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell

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
refactor(config): dedupe observe suspicion checks · openc...
vincentkoc · 2026-06-18 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1212

persistBoundedClobberedConfigSnapshot,

1313

persistBoundedClobberedConfigSnapshotSync,

1414

} from "./io.clobber-snapshot.js";

15+

import { resolveConfigObserveSuspiciousReasons } from "./io.observe-suspicious.js";

1516

import { formatConfigIssueSummary } from "./issue-format.js";

1617

import { resolveStateDir } from "./paths.js";

1718

import {

@@ -510,49 +511,6 @@ function createBackupRestoreAuditAppendParams(params: {

510511

});

511512

}

512513
513-

function isUpdateChannelOnlyRoot(value: unknown): boolean {

514-

if (!isRecord(value)) {

515-

return false;

516-

}

517-

const keys = Object.keys(value);

518-

if (keys.length !== 1 || keys[0] !== "update") {

519-

return false;

520-

}

521-

const update = value.update;

522-

if (!isRecord(update)) {

523-

return false;

524-

}

525-

const updateKeys = Object.keys(update);

526-

return updateKeys.length === 1 && typeof update.channel === "string";

527-

}

528-
529-

function resolveConfigObserveSuspiciousReasons(params: {

530-

bytes: number;

531-

hasMeta: boolean;

532-

gatewayMode: string | null;

533-

parsed: unknown;

534-

lastKnownGood?: ConfigHealthFingerprint;

535-

}): string[] {

536-

const reasons: string[] = [];

537-

const baseline = params.lastKnownGood;

538-

if (!baseline) {

539-

return reasons;

540-

}

541-

if (baseline.bytes >= 512 && params.bytes < Math.floor(baseline.bytes * 0.5)) {

542-

reasons.push(`size-drop-vs-last-good:${baseline.bytes}->${params.bytes}`);

543-

}

544-

if (baseline.hasMeta && !params.hasMeta) {

545-

reasons.push("missing-meta-vs-last-good");

546-

}

547-

if (baseline.gatewayMode && !params.gatewayMode) {

548-

reasons.push("gateway-mode-missing-vs-last-good");

549-

}

550-

if (baseline.gatewayMode && isUpdateChannelOnlyRoot(params.parsed)) {

551-

reasons.push("update-channel-only-root");

552-

}

553-

return reasons;

554-

}

555-
556514

function resolveSuspiciousSignature(

557515

current: ConfigHealthFingerprint,

558516

suspicious: string[],

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,50 @@

1+

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

2+
3+

export type ConfigObserveSuspiciousBaseline = {

4+

bytes: number;

5+

hasMeta: boolean;

6+

gatewayMode: string | null;

7+

};

8+
9+

function isUpdateChannelOnlyRoot(value: unknown): boolean {

10+

if (!isRecord(value)) {

11+

return false;

12+

}

13+

const keys = Object.keys(value);

14+

if (keys.length !== 1 || keys[0] !== "update") {

15+

return false;

16+

}

17+

const update = value.update;

18+

if (!isRecord(update)) {

19+

return false;

20+

}

21+

const updateKeys = Object.keys(update);

22+

return updateKeys.length === 1 && typeof update.channel === "string";

23+

}

24+
25+

export function resolveConfigObserveSuspiciousReasons(params: {

26+

bytes: number;

27+

hasMeta: boolean;

28+

gatewayMode: string | null;

29+

parsed: unknown;

30+

lastKnownGood?: ConfigObserveSuspiciousBaseline;

31+

}): string[] {

32+

const reasons: string[] = [];

33+

const baseline = params.lastKnownGood;

34+

if (!baseline) {

35+

return reasons;

36+

}

37+

if (baseline.bytes >= 512 && params.bytes < Math.floor(baseline.bytes * 0.5)) {

38+

reasons.push(`size-drop-vs-last-good:${baseline.bytes}->${params.bytes}`);

39+

}

40+

if (baseline.hasMeta && !params.hasMeta) {

41+

reasons.push("missing-meta-vs-last-good");

42+

}

43+

if (baseline.gatewayMode && !params.gatewayMode) {

44+

reasons.push("gateway-mode-missing-vs-last-good");

45+

}

46+

if (baseline.gatewayMode && isUpdateChannelOnlyRoot(params.parsed)) {

47+

reasons.push("update-channel-only-root");

48+

}

49+

return reasons;

50+

}

Original file line numberDiff line numberDiff line change

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

7070

promoteConfigSnapshotToLastKnownGood as promoteConfigSnapshotToLastKnownGoodWithDeps,

7171

recoverConfigFromLastKnownGood as recoverConfigFromLastKnownGoodWithDeps,

7272

} from "./io.observe-recovery.js";

73+

import { resolveConfigObserveSuspiciousReasons } from "./io.observe-suspicious.js";

7374

import { retainGeneratedOwnerDisplaySecret } from "./io.owner-display-secret.js";

7475

import {

7576

collectChangedPaths,

@@ -638,49 +639,6 @@ function setConfigHealthEntry(

638639

};

639640

}

640641
641-

function isUpdateChannelOnlyRoot(value: unknown): boolean {

642-

if (!isRecord(value)) {

643-

return false;

644-

}

645-

const keys = Object.keys(value);

646-

if (keys.length !== 1 || keys[0] !== "update") {

647-

return false;

648-

}

649-

const update = value.update;

650-

if (!isRecord(update)) {

651-

return false;

652-

}

653-

const updateKeys = Object.keys(update);

654-

return updateKeys.length === 1 && typeof update.channel === "string";

655-

}

656-
657-

function resolveConfigObserveSuspiciousReasons(params: {

658-

bytes: number;

659-

hasMeta: boolean;

660-

gatewayMode: string | null;

661-

parsed: unknown;

662-

lastKnownGood?: ConfigHealthFingerprint;

663-

}): string[] {

664-

const reasons: string[] = [];

665-

const baseline = params.lastKnownGood;

666-

if (!baseline) {

667-

return reasons;

668-

}

669-

if (baseline.bytes >= 512 && params.bytes < Math.floor(baseline.bytes * 0.5)) {

670-

reasons.push(`size-drop-vs-last-good:${baseline.bytes}->${params.bytes}`);

671-

}

672-

if (baseline.hasMeta && !params.hasMeta) {

673-

reasons.push("missing-meta-vs-last-good");

674-

}

675-

if (baseline.gatewayMode && !params.gatewayMode) {

676-

reasons.push("gateway-mode-missing-vs-last-good");

677-

}

678-

if (baseline.gatewayMode && isUpdateChannelOnlyRoot(params.parsed)) {

679-

reasons.push("update-channel-only-root");

680-

}

681-

return reasons;

682-

}

683-
684642

async function readConfigFingerprintForPath(

685643

deps: Required<ConfigIoDeps>,

686644

targetPath: string,