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

推荐订阅源

博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
B
Blog
GbyAI
GbyAI
爱范儿
爱范儿
月光博客
月光博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
腾讯CDC
MyScale Blog
MyScale Blog
V
Visual Studio Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
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(auth): wait through SQLite read contention · openclaw...
vincentkoc · 2026-06-16 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -3,9 +3,11 @@

33

* Verifies secrets/state persistence, runtime overlays, and legacy JSON

44

* migration boundaries in temporary agent directories.

55

*/

6+

import { spawn } from "node:child_process";

67

import fs from "node:fs";

78

import os from "node:os";

89

import path from "node:path";

10+

import { DatabaseSync } from "node:sqlite";

911

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

1012

import {

1113

closeOpenClawAgentDatabasesForTest,

@@ -147,6 +149,68 @@ describe("auth profile sqlite store", () => {

147149

});

148150

});

149151
152+

it("waits for brief rollback-journal contention before reading persisted auth", async () => {

153+

await withAgentDirEnv("openclaw-auth-sqlite-contention-", async (agentDir) => {

154+

saveAuthProfileStore(apiKeyStore("sk-test"), agentDir);

155+

closeOpenClawAgentDatabasesForTest();

156+
157+

const databasePath = resolveAuthProfileDatabasePath(agentDir);

158+

const setup = new DatabaseSync(databasePath);

159+

setup.exec("PRAGMA journal_mode = DELETE;");

160+

setup.close();

161+
162+

const child = spawn(

163+

process.execPath,

164+

[

165+

"-e",

166+

`

167+

const { DatabaseSync } = require("node:sqlite");

168+

const db = new DatabaseSync(process.argv[1]);

169+

db.exec("PRAGMA journal_mode = DELETE; BEGIN EXCLUSIVE;");

170+

db.prepare(

171+

"UPDATE auth_profile_store SET updated_at = updated_at + 1 WHERE store_key = ?",

172+

).run("primary");

173+

process.stdout.write("locked\\n");

174+

setTimeout(() => {

175+

db.exec("ROLLBACK;");

176+

db.close();

177+

}, 250);

178+

`,

179+

databasePath,

180+

],

181+

{ stdio: ["ignore", "pipe", "pipe"] },

182+

);

183+

const childExit = new Promise<void>((resolve, reject) => {

184+

child.once("error", reject);

185+

child.once("exit", (code) => {

186+

if (code === 0) {

187+

resolve();

188+

} else {

189+

reject(new Error(`contention child exited with code ${code}`));

190+

}

191+

});

192+

});

193+

await new Promise<void>((resolve, reject) => {

194+

let locked = false;

195+

child.stdout.once("data", () => {

196+

locked = true;

197+

resolve();

198+

});

199+

child.once("error", reject);

200+

child.once("exit", (code) => {

201+

if (!locked) {

202+

reject(new Error(`contention child exited before locking with code ${code}`));

203+

}

204+

});

205+

});

206+
207+

const loaded = loadPersistedAuthProfileStore(agentDir);

208+
209+

await childExit;

210+

expect(loaded?.profiles["openai:default"]).toMatchObject({ key: "sk-test" });

211+

});

212+

});

213+
150214

it("uses the configured agent id for custom agentDir databases", async () => {

151215

await withAgentDirEnv("openclaw-auth-sqlite-custom-agent-", (envAgentDir) => {

152216

const customAgentDir = path.join(path.dirname(path.dirname(envAgentDir)), "custom-coder");