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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
J
Java Code Geeks
C
Check Point Blog
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
IT之家
IT之家
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
U
Unit 42
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ

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: keep live OpenClaw session locks during cleanup (#88...
steipete · 2026-05-30 · via Recent Commits to openclaw:main

@@ -668,7 +668,7 @@ describe("acquireSessionWriteLock", () => {

668668

},

669669

{

670670

name: "old-live.jsonl.lock",

671-

removed: true,

671+

removed: false,

672672

stale: true,

673673

staleReasons: ["too-old"],

674674

},

@@ -680,17 +680,82 @@ describe("acquireSessionWriteLock", () => {

680680

stale: true,

681681

staleReasons: ["dead-pid", "too-old"],

682682

},

683+

]);

684+685+

await expectPathMissing(staleDeadLock);

686+

await expect(fs.access(staleAliveLock)).resolves.toBeUndefined();

687+

await expect(fs.access(freshAliveLock)).resolves.toBeUndefined();

688+

} finally {

689+

await fs.rm(root, { recursive: true, force: true });

690+

}

691+

});

692+693+

it("cleans old live .jsonl lock files owned by non-OpenClaw processes", async () => {

694+

const root = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-lock-"));

695+

const sessionsDir = path.join(root, "sessions");

696+

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

697+

const nowMs = Date.now();

698+

const lockPath = path.join(sessionsDir, "old-non-openclaw.jsonl.lock");

699+700+

try {

701+

await fs.writeFile(

702+

lockPath,

703+

JSON.stringify({

704+

pid: process.pid,

705+

createdAt: new Date(nowMs - 120_000).toISOString(),

706+

}),

707+

"utf8",

708+

);

709+710+

const result = await cleanStaleLockFiles({

711+

sessionsDir,

712+

staleMs: 30_000,

713+

nowMs,

714+

removeStale: true,

715+

readOwnerProcessArgs: () => ["python", "worker.py"],

716+

});

717+718+

expect(lockCleanupRecords(result.cleaned)).toEqual([

683719

{

684-

name: "old-live.jsonl.lock",

720+

name: "old-non-openclaw.jsonl.lock",

685721

removed: true,

686722

stale: true,

687-

staleReasons: ["too-old"],

723+

staleReasons: ["too-old", "non-openclaw-owner"],

688724

},

689725

]);

726+

await expectPathMissing(lockPath);

727+

} finally {

728+

await fs.rm(root, { recursive: true, force: true });

729+

}

730+

});

690731691-

await expectPathMissing(staleDeadLock);

692-

await expectPathMissing(staleAliveLock);

693-

await expect(fs.access(freshAliveLock)).resolves.toBeUndefined();

732+

it("does not clean fresh malformed .jsonl lock files during cleanup sweeps", async () => {

733+

const root = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-lock-"));

734+

const sessionsDir = path.join(root, "sessions");

735+

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

736+

const nowMs = Date.now();

737+

const lockPath = path.join(sessionsDir, "fresh-malformed.jsonl.lock");

738+739+

try {

740+

await fs.writeFile(lockPath, "{}", "utf8");

741+742+

const result = await cleanStaleLockFiles({

743+

sessionsDir,

744+

staleMs: 30_000,

745+

nowMs,

746+

removeStale: true,

747+

});

748+749+

expect(lockCleanupRecords(result.locks)).toEqual([

750+

{

751+

name: "fresh-malformed.jsonl.lock",

752+

removed: false,

753+

stale: true,

754+

staleReasons: ["missing-pid", "invalid-createdAt"],

755+

},

756+

]);

757+

expect(result.cleaned).toEqual([]);

758+

await expect(fs.access(lockPath)).resolves.toBeUndefined();

694759

} finally {

695760

await fs.rm(root, { recursive: true, force: true });

696761

}