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

推荐订阅源

博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
罗磊的独立博客
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
B
Blog RSS Feed

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(workspace): store setup state outside workspace dot-d...
vincentkoc · 2026-06-16 · via Recent Commits to openclaw:main

@@ -108,6 +108,31 @@ async function createHeartbeatAgentsWorkspace() {

108108

return workspaceDir;

109109

}

110110111+

async function writeCompletedWorkspaceState(workspaceDir: string): Promise<void> {

112+

await fs.writeFile(

113+

path.join(workspaceDir, "openclaw-workspace-state.json"),

114+

`${JSON.stringify({

115+

version: 1,

116+

bootstrapSeededAt: "2026-05-16T00:00:00.000Z",

117+

setupCompletedAt: "2026-05-16T00:00:01.000Z",

118+

})}\n`,

119+

"utf8",

120+

);

121+

}

122+123+

async function writeLegacyCompletedWorkspaceState(workspaceDir: string): Promise<void> {

124+

await fs.mkdir(path.join(workspaceDir, ".openclaw"), { recursive: true });

125+

await fs.writeFile(

126+

path.join(workspaceDir, ".openclaw", "workspace-state.json"),

127+

`${JSON.stringify({

128+

version: 1,

129+

bootstrapSeededAt: "2026-05-16T00:00:00.000Z",

130+

setupCompletedAt: "2026-05-16T00:00:01.000Z",

131+

})}\n`,

132+

"utf8",

133+

);

134+

}

135+111136

function expectHeartbeatExcludedAndAgentsKept(files: WorkspaceBootstrapFile[]) {

112137

// Heartbeat policy can remove HEARTBEAT.md for normal turns, but project rules

113138

// must remain in the bootstrap set.

@@ -174,16 +199,19 @@ describe("resolveBootstrapFilesForRun", () => {

174199175200

it("ignores stale workspace BOOTSTRAP.md once setup is completed", async () => {

176201

const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-");

177-

await fs.mkdir(path.join(workspaceDir, ".openclaw"), { recursive: true });

178-

await fs.writeFile(

179-

path.join(workspaceDir, ".openclaw", "workspace-state.json"),

180-

`${JSON.stringify({

181-

version: 1,

182-

bootstrapSeededAt: "2026-05-16T00:00:00.000Z",

183-

setupCompletedAt: "2026-05-16T00:00:01.000Z",

184-

})}\n`,

185-

"utf8",

186-

);

202+

await writeCompletedWorkspaceState(workspaceDir);

203+

await fs.writeFile(path.join(workspaceDir, "AGENTS.md"), "rules", "utf8");

204+

await fs.writeFile(path.join(workspaceDir, "BOOTSTRAP.md"), "stale ritual", "utf8");

205+206+

const files = await resolveBootstrapFilesForRun({ workspaceDir });

207+208+

expect(files.map((file) => file.name)).toContain("AGENTS.md");

209+

expect(files.map((file) => file.name)).not.toContain("BOOTSTRAP.md");

210+

});

211+212+

it("ignores stale workspace BOOTSTRAP.md when legacy setup state is completed", async () => {

213+

const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-");

214+

await writeLegacyCompletedWorkspaceState(workspaceDir);

187215

await fs.writeFile(path.join(workspaceDir, "AGENTS.md"), "rules", "utf8");

188216

await fs.writeFile(path.join(workspaceDir, "BOOTSTRAP.md"), "stale ritual", "utf8");

189217

@@ -193,9 +221,9 @@ describe("resolveBootstrapFilesForRun", () => {

193221

expect(files.map((file) => file.name)).not.toContain("BOOTSTRAP.md");

194222

});

195223196-

it("keeps BOOTSTRAP.md when setup state cannot be read", async () => {

224+

it("keeps BOOTSTRAP.md when current setup state cannot be read", async () => {

197225

const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-");

198-

await fs.mkdir(path.join(workspaceDir, ".openclaw", "workspace-state.json"), {

226+

await fs.mkdir(path.join(workspaceDir, "openclaw-workspace-state.json"), {

199227

recursive: true,

200228

});

201229

await fs.writeFile(path.join(workspaceDir, "AGENTS.md"), "rules", "utf8");

@@ -209,16 +237,7 @@ describe("resolveBootstrapFilesForRun", () => {

209237

it("does not let hooks re-add stale root BOOTSTRAP.md after setup is completed", async () => {

210238

registerBootstrapFileHook();

211239

const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-");

212-

await fs.mkdir(path.join(workspaceDir, ".openclaw"), { recursive: true });

213-

await fs.writeFile(

214-

path.join(workspaceDir, ".openclaw", "workspace-state.json"),

215-

`${JSON.stringify({

216-

version: 1,

217-

bootstrapSeededAt: "2026-05-16T00:00:00.000Z",

218-

setupCompletedAt: "2026-05-16T00:00:01.000Z",

219-

})}\n`,

220-

"utf8",

221-

);

240+

await writeCompletedWorkspaceState(workspaceDir);

222241

await fs.writeFile(path.join(workspaceDir, "AGENTS.md"), "rules", "utf8");

223242

await fs.writeFile(path.join(workspaceDir, "BOOTSTRAP.md"), "stale ritual", "utf8");

224243

@@ -231,16 +250,8 @@ describe("resolveBootstrapFilesForRun", () => {

231250

registerBootstrapFileHook();

232251

const parentDir = await makeTempWorkspace("openclaw-bootstrap-home-");

233252

const workspaceDir = path.join(parentDir, "workspace");

234-

await fs.mkdir(path.join(workspaceDir, ".openclaw"), { recursive: true });

235-

await fs.writeFile(

236-

path.join(workspaceDir, ".openclaw", "workspace-state.json"),

237-

`${JSON.stringify({

238-

version: 1,

239-

bootstrapSeededAt: "2026-05-16T00:00:00.000Z",

240-

setupCompletedAt: "2026-05-16T00:00:01.000Z",

241-

})}\n`,

242-

"utf8",

243-

);

253+

await fs.mkdir(workspaceDir, { recursive: true });

254+

await writeCompletedWorkspaceState(workspaceDir);

244255

await fs.writeFile(path.join(workspaceDir, "AGENTS.md"), "rules", "utf8");

245256

await fs.writeFile(path.join(workspaceDir, "BOOTSTRAP.md"), "stale ritual", "utf8");

246257

@@ -263,17 +274,8 @@ describe("resolveBootstrapFilesForRun", () => {

263274

it("keeps hook-added nested BOOTSTRAP.md after setup is completed", async () => {

264275

registerBootstrapFileHook(path.join("packages", "core", "BOOTSTRAP.md"));

265276

const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-");

266-

await fs.mkdir(path.join(workspaceDir, ".openclaw"), { recursive: true });

267277

await fs.mkdir(path.join(workspaceDir, "packages", "core"), { recursive: true });

268-

await fs.writeFile(

269-

path.join(workspaceDir, ".openclaw", "workspace-state.json"),

270-

`${JSON.stringify({

271-

version: 1,

272-

bootstrapSeededAt: "2026-05-16T00:00:00.000Z",

273-

setupCompletedAt: "2026-05-16T00:00:01.000Z",

274-

})}\n`,

275-

"utf8",

276-

);

278+

await writeCompletedWorkspaceState(workspaceDir);

277279

await fs.writeFile(path.join(workspaceDir, "AGENTS.md"), "rules", "utf8");

278280

await fs.writeFile(path.join(workspaceDir, "BOOTSTRAP.md"), "stale ritual", "utf8");

279281

await fs.writeFile(