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

推荐订阅源

B
Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
罗磊的独立博客
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Jina AI
Jina AI
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
C
Check Point Blog
GbyAI
GbyAI

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(telegram): require admin for target writeback [AI] (#...
pgondhi987 · 2026-06-03 · via Recent Commits to openclaw:main

@@ -95,6 +95,7 @@ export function installMaybePersistResolvedTelegramTargetTests(params?: {

9595

cfg: {} as OpenClawConfig,

9696

rawTarget: "-100123",

9797

resolvedChatId: "-100123",

98+

gatewayClientScopes: ["operator.admin"],

9899

});

99100100101

expect(readConfigFileSnapshotForWrite).not.toHaveBeenCalled();

@@ -118,6 +119,23 @@ export function installMaybePersistResolvedTelegramTargetTests(params?: {

118119

expect(saveCronStore).not.toHaveBeenCalled();

119120

});

120121122+

it("does not let internal writeback override non-admin gateway scopes", async () => {

123+

await maybePersistResolvedTelegramTarget({

124+

cfg: {

125+

cron: { store: "/tmp/cron/jobs.json" },

126+

} as OpenClawConfig,

127+

rawTarget: "t.me/mychannel",

128+

resolvedChatId: "-100123",

129+

gatewayClientScopes: ["operator.write"],

130+

trustedInternalWriteback: true,

131+

});

132+133+

expect(readConfigFileSnapshotForWrite).not.toHaveBeenCalled();

134+

expect(writeConfigFile).not.toHaveBeenCalled();

135+

expect(loadCronStore).not.toHaveBeenCalled();

136+

expect(saveCronStore).not.toHaveBeenCalled();

137+

});

138+121139

it("skips config and cron writeback for gateway callers with an empty scope set", async () => {

122140

await maybePersistResolvedTelegramTarget({

123141

cfg: {

@@ -133,6 +151,53 @@ export function installMaybePersistResolvedTelegramTargetTests(params?: {

133151

expect(loadCronStore).not.toHaveBeenCalled();

134152

expect(saveCronStore).not.toHaveBeenCalled();

135153

});

154+155+

it("skips config and cron writeback when gateway scopes are missing", async () => {

156+

await maybePersistResolvedTelegramTarget({

157+

cfg: {

158+

cron: { store: "/tmp/cron/jobs.json" },

159+

} as OpenClawConfig,

160+

rawTarget: "t.me/mychannel",

161+

resolvedChatId: "-100123",

162+

gatewayClientScopes: undefined,

163+

});

164+165+

expect(readConfigFileSnapshotForWrite).not.toHaveBeenCalled();

166+

expect(writeConfigFile).not.toHaveBeenCalled();

167+

expect(loadCronStore).not.toHaveBeenCalled();

168+

expect(saveCronStore).not.toHaveBeenCalled();

169+

});

170+171+

it("writes back for gateway callers with operator.admin", async () => {

172+

readConfigFileSnapshotForWrite.mockResolvedValue({

173+

snapshot: {

174+

config: {

175+

channels: {

176+

telegram: {

177+

defaultTo: "t.me/mychannel",

178+

},

179+

},

180+

},

181+

},

182+

writeOptions: {},

183+

});

184+

loadCronStore.mockResolvedValue({

185+

version: 1,

186+

jobs: [{ id: "a", delivery: { channel: "telegram", to: "t.me/mychannel" } }],

187+

});

188+189+

await maybePersistResolvedTelegramTarget({

190+

cfg: {

191+

cron: { store: "/tmp/cron/jobs.json" },

192+

} as OpenClawConfig,

193+

rawTarget: "t.me/mychannel",

194+

resolvedChatId: "-100123",

195+

gatewayClientScopes: ["operator.admin"],

196+

});

197+198+

expect(writeConfigFile).toHaveBeenCalledTimes(1);

199+

expect(saveCronStore).toHaveBeenCalledTimes(1);

200+

});

136201

}

137202138203

it("writes back matching config and cron targets", async () => {

@@ -167,6 +232,8 @@ export function installMaybePersistResolvedTelegramTargetTests(params?: {

167232

} as OpenClawConfig,

168233

rawTarget: "t.me/mychannel",

169234

resolvedChatId: "-100123",

235+

gatewayClientScopes: undefined,

236+

trustedInternalWriteback: true,

170237

});

171238172239

expect(writeConfigFile).toHaveBeenCalledTimes(1);

@@ -202,6 +269,8 @@ export function installMaybePersistResolvedTelegramTargetTests(params?: {

202269

cfg: {} as OpenClawConfig,

203270

rawTarget: "t.me/mychannel:topic:9",

204271

resolvedChatId: "-100123",

272+

gatewayClientScopes: undefined,

273+

trustedInternalWriteback: true,

205274

});

206275207276

expect(writeConfigFile).toHaveBeenCalledTimes(1);

@@ -232,6 +301,8 @@ export function installMaybePersistResolvedTelegramTargetTests(params?: {

232301

cfg: {} as OpenClawConfig,

233302

rawTarget: "@MyChannel",

234303

resolvedChatId: "-100123",

304+

gatewayClientScopes: undefined,

305+

trustedInternalWriteback: true,

235306

});

236307237308

expect(writeConfigFile).toHaveBeenCalledTimes(1);