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

推荐订阅源

量子位
F
Fortinet All Blogs
J
Java Code Geeks
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
M
MIT News - Artificial intelligence
腾讯CDC
Last Week in AI
Last Week in AI
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
博客园 - 叶小钗
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
L
LangChain Blog
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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(config): preserve authored config writes · openclaw/o...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -38,6 +38,111 @@ describe("config io write prepare", () => {

3838

expect(persisted).not.toHaveProperty("sessions.persistence");

3939

});

404041+

it("preserves authored source-only nested fields during partial writes", () => {

42+

const persisted = resolvePersistCandidateForWrite({

43+

runtimeConfig: {

44+

plugins: {

45+

entries: {},

46+

},

47+

},

48+

sourceConfig: {

49+

plugins: {

50+

entries: {},

51+

installs: {

52+

"openclaw-web-search": {

53+

source: "npm",

54+

spec: "@ollama/openclaw-web-search",

55+

installPath: "/tmp/openclaw-web-search",

56+

resolvedName: "@ollama/openclaw-web-search",

57+

resolvedVersion: "0.2.2",

58+

},

59+

},

60+

},

61+

},

62+

nextConfig: {

63+

plugins: {

64+

entries: {},

65+

installs: {

66+

"openclaw-web-search": {

67+

source: "npm",

68+

spec: "@ollama/openclaw-web-search@0.2.2",

69+

installPath: "/tmp/openclaw-web-search",

70+

resolvedName: "@ollama/openclaw-web-search",

71+

resolvedVersion: "0.2.2",

72+

},

73+

},

74+

},

75+

},

76+

}) as {

77+

plugins?: {

78+

installs?: Record<string, Record<string, unknown>>;

79+

};

80+

};

81+82+

expect(persisted.plugins?.installs?.["openclaw-web-search"]).toEqual({

83+

source: "npm",

84+

spec: "@ollama/openclaw-web-search@0.2.2",

85+

installPath: "/tmp/openclaw-web-search",

86+

resolvedName: "@ollama/openclaw-web-search",

87+

resolvedVersion: "0.2.2",

88+

});

89+

});

90+91+

it("preserves untouched include-owned subtrees during unrelated writes", () => {

92+

const persisted = resolvePersistCandidateForWrite({

93+

runtimeConfig: {

94+

agents: {

95+

defaults: { model: "openai/gpt-5.4" },

96+

},

97+

gateway: { mode: "local" },

98+

},

99+

sourceConfig: {

100+

agents: {

101+

defaults: { model: "openai/gpt-5.4" },

102+

},

103+

gateway: { mode: "local" },

104+

},

105+

rootAuthoredConfig: {

106+

agents: { $include: "./config/agents.json" },

107+

gateway: { mode: "local" },

108+

},

109+

nextConfig: {

110+

agents: {

111+

defaults: { model: "openai/gpt-5.4" },

112+

},

113+

gateway: { mode: "local", port: 18789 },

114+

},

115+

}) as Record<string, unknown>;

116+117+

expect(persisted.agents).toEqual({ $include: "./config/agents.json" });

118+

expect(persisted.gateway).toEqual({ mode: "local", port: 18789 });

119+

});

120+121+

it("rejects writes that would flatten include-owned subtrees", () => {

122+

expect(() =>

123+

resolvePersistCandidateForWrite({

124+

runtimeConfig: {

125+

agents: {

126+

defaults: { model: "openai/gpt-5.4" },

127+

},

128+

},

129+

sourceConfig: {

130+

agents: {

131+

defaults: { model: "openai/gpt-5.4" },

132+

},

133+

},

134+

rootAuthoredConfig: {

135+

agents: { $include: "./config/agents.json" },

136+

},

137+

nextConfig: {

138+

agents: {

139+

defaults: { model: "anthropic/sonnet-4.5" },

140+

},

141+

},

142+

}),

143+

).toThrow("Config write would flatten $include-owned config at agents");

144+

});

145+41146

it('formats actionable guidance for dmPolicy="open" without wildcard allowFrom', () => {

42147

const message = formatConfigValidationFailure(

43148

"channels.telegram.allowFrom",

@@ -434,26 +539,25 @@ describe("config io write prepare", () => {

434539

expect(persisted.gateway).toEqual({ mode: "local", port: 18789 });

435540

});

436541437-

it("does not preserve include-only $schema into the root persisted candidate", () => {

542+

it("rejects writes that would flatten a root include", () => {

438543

const sourceConfig = {

439544

$schema: "https://openclaw.ai/config-from-include.json",

440545

gateway: { mode: "local" },

441546

};

442547443-

const persisted = resolvePersistCandidateForWrite({

444-

runtimeConfig: sourceConfig,

445-

sourceConfig,

446-

rootAuthoredConfig: {

447-

$include: "./extra.json5",

448-

gateway: { mode: "local" },

449-

},

450-

nextConfig: {

451-

gateway: { mode: "local", port: 18789 },

452-

},

453-

}) as Record<string, unknown>;

454-455-

expect(persisted).not.toHaveProperty("$schema");

456-

expect(persisted.gateway).toEqual({ mode: "local", port: 18789 });

548+

expect(() =>

549+

resolvePersistCandidateForWrite({

550+

runtimeConfig: sourceConfig,

551+

sourceConfig,

552+

rootAuthoredConfig: {

553+

$include: "./extra.json5",

554+

gateway: { mode: "local" },

555+

},

556+

nextConfig: {

557+

gateway: { mode: "local", port: 18789 },

558+

},

559+

}),

560+

).toThrow("Config write would flatten $include-owned config at <root>");

457561

});

458562459563

it("does not restore root $schema when the next config explicitly clears it", () => {