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

推荐订阅源

U
Unit 42
V
V2EX
Martin Fowler
Martin Fowler
博客园 - Franky
P
Proofpoint News Feed
P
Palo Alto Networks Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
The Register - Security
The Register - Security
Latest news
Latest news
S
Security @ Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
M
Microsoft Research Blog - Microsoft Research
Scott Helme
Scott Helme
T
Tailwind CSS Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
True Tiger Recordings
有赞技术团队
有赞技术团队
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Tenable Blog
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
Hacker News: Ask HN
Hacker News: Ask HN
S
Security Archives - TechRepublic
F
Future of Privacy Forum
爱范儿
爱范儿
PCI Perspectives
PCI Perspectives
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
Security Latest
Security Latest
美团技术团队
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
量子位
C
CERT Recently Published Vulnerability Notes
SecWiki News
SecWiki News

Recent Commits to openclaw:main

perf(whatsapp): narrow runtime setter entry (#85589) · openclaw/openclaw@463929d fix: smooth chat focus mode layout · openclaw/openclaw@bb5abef Fix Telegram missing harness spool poison (#85605) · openclaw/openclaw@b745082 Policy: add agent workspace conformance checks (#85096) · openclaw/openclaw@a94f344 fix(installer): fail failed Windows git builds · openclaw/openclaw@2edd6e2 fix(codex): honor node exec policy for native surfaces (#85534) · openclaw/openclaw@e0405ec fix(qa-lab): stabilize codex runtime parity fixtures fix(github): preserve sufficient proof against negative relabel (#85567) · openclaw/openclaw@6b52dff docs: add changelog for context pressure preflight · openclaw/openclaw@5ca734f Fix context pressure preflight for tool-heavy sessions (#85541) · openclaw/openclaw@c08400e fix(doctor): classify codex asset notice as info (#85119) · openclaw/openclaw@959b935 fix(ui): keep chat picker search current (#85547) fix: preserve message-tool delivery evidence · openclaw/openclaw@f022b05 fix(codex): add API key paste auth (#85533) fix: satisfy openai video test typecheck · openclaw/openclaw@743caed fix: route openai video edits to edits endpoint · openclaw/openclaw@6c3fcb8 fix(qmd): normalize direct file collection paths (#65212) · openclaw/openclaw@227b4bf fix(testbox): preserve clean sparse checkouts · openclaw/openclaw@58e9628 fix(ui): run ui script through junction paths (#85525) · openclaw/openclaw@ad19dd8 docs: fix troubleshooting logs link (#85545) · openclaw/openclaw@60582b6 Revert chat session picker inline search (#85527) · openclaw/openclaw@d69bcfd fix: preserve guarded video operation cleanup · openclaw/openclaw@ed7d99a fix: honor openai video provider request network policy fix: retry guarded video downloads · openclaw/openclaw@efbf9f3 fix: thread openai video request policy · openclaw/openclaw@31b5145 docs(changelog): note heartbeat message-tool fix · openclaw/openclaw@c127334 fix: use fs-safe trash for agent delete (#84394) · openclaw/openclaw@951bbe6 Fix heartbeat message-tool delivery policy (#85357) · openclaw/openclaw@bd9c78f Scope config preflight note suppression (#84439) · openclaw/openclaw@91d85e7 fix(cron): document best-effort edit delivery mode (#84526) fix(dreaming): open report cards from memory palace (#85144) · openclaw/openclaw@2e15830 fix(openai-codex): preserve image input capability (#85393) · openclaw/openclaw@49ce171 fix(codex): stabilize heartbeat dynamic tool schema (#84681) · openclaw/openclaw@c52daa4 docs: absorb small documentation PRs · openclaw/openclaw@658be7f fix(scripts): preserve bws resolver parse errors (#85528) · openclaw/openclaw@13a4c57 fix(telegram): honor outbound media max bytes (#83478) · openclaw/openclaw@f2d4f93 fix(skills): restore executable bit on bundled whisper script + relea… · openclaw/openclaw@1dd3b52 fix(google): print Gemini OAuth URL before browser launch (#71469) · openclaw/openclaw@2d5bda9 docs: absorb contributor documentation fixes docs: tighten landable bug sweep gates · openclaw/openclaw@8f86383 fix: reuse provider auth lookup facts (#85499) · openclaw/openclaw@299ed80 fix: keep session picker focus separate · openclaw/openclaw@7e12370 feat: start onboarding for fresh CLI installs (#85519) · openclaw/openclaw@464ffc1 docs: refresh contributor docs · openclaw/openclaw@64d13c0 fix(update): prepack npm git update specs · openclaw/openclaw@84f6b5c fix: simplify chat session search · openclaw/openclaw@7e16a50 fix: use native mac settings sidebar · openclaw/openclaw@0556958 chore: ignore antigravity cli state · openclaw/openclaw@dd07fb4 fix(media): replace Gemini CLI fallback with sandboxed Antigravity (#… · openclaw/openclaw@0622fb6 docs: add bugbash landing changelog entries · openclaw/openclaw@faad2b0 fix(diffs): continue after card hydration errors (#84775) · openclaw/openclaw@9b5c281 fix(proxy): add missing clientSocket error handler in CONNECT tunnel … · openclaw/openclaw@e008bc9 fix(memory): report qmd workspace cwd probe failures (#63167) · openclaw/openclaw@7134a95 fix(agents): handle parallel tool call deltas in openai-completions s… test: align release validation package acceptance check (#85515) · openclaw/openclaw@423f525 fix: recover stuck Codex compaction · openclaw/openclaw@44d5330 docs: require visual proof for control ui e2e (#85513) · openclaw/openclaw@8174bfc Policy: add gateway exposure checks (#81981) · openclaw/openclaw@dcc5e45 ci: unblock advisory Tideclaw alpha release checks · openclaw/openclaw@dcfc7e5 fix(installer): tolerate WSL UNC launch cwd · openclaw/openclaw@684a9b2 docs: absorb docs sweep · openclaw/openclaw@bb5010b fix: cancel stale provider auth prewarms (#85503) · openclaw/openclaw@60e3749 Add TUI PTY integration coverage (#85485) · openclaw/openclaw@0a50cbd fix(security): escape entry.id in HTML export to prevent attribute XS… · openclaw/openclaw@7bc4a33 fix: guard openai-completions tool payload with supportsTools compat … · openclaw/openclaw@76a025c fix(slack): surface auth.test failure + normalize explicit-bot mentio… · openclaw/openclaw@995a020 chore(release): bump version to 2026.5.22 fix(ui): keep chat session search inline (#85490) · openclaw/openclaw@2601453 Policy: add secret and auth conformance checks (#81974) · openclaw/openclaw@c85feac fix(delivery): log failDelivery errors instead of silently swallowing… · openclaw/openclaw@f75789f fix(cli): validate debug proxy numeric options (#84260) · openclaw/openclaw@5c866a1 fix(daemon): use exit code instead of localized text for schtasks fal… · openclaw/openclaw@501e74d fix(auto-reply): enforce word boundary in slash command prefix match … · openclaw/openclaw@5c614de fix(message-tool): normalize send body aliases (#84102) docs: absorb maintainer docs sweep · openclaw/openclaw@e0fda55 fix(gateway): coalesce provider auth rewarms docs(voyage): clarify API key setup (#81803) · openclaw/openclaw@57178b1 docs(config): quote bracket config paths (#83058) · openclaw/openclaw@88f50e8 docs: link Copilot model availability (#76252) · openclaw/openclaw@14b2b8a test(telegram): await watchdog registration event · openclaw/openclaw@9fae5f7 ci: run binding command escape in release checks · openclaw/openclaw@4b63502 fix(tui): dismiss watchdog notice when response actually arrives (#77… · openclaw/openclaw@b741ddb test: add docker proof for plugin binding command escape · openclaw/openclaw@d756e1c test(telegram): wait for polling watchdog deterministically · openclaw/openclaw@7c9127c ci: skip pnpm auto repair in Crabbox shell · openclaw/openclaw@0241a6e fix(gateway): add .catch() to SIGTERM/SIGUSR1 signal handlers (#83131) fix: release cron runtime state after isolated runs (#85053) · openclaw/openclaw@247e536 fix(cron): suppress fatal error completion announce (#83724) · openclaw/openclaw@0c7220f fix(exec): parse nested approval metadata in async followups (#72268) · openclaw/openclaw@34c441c ci: share Crabbox hydrate pnpm store · openclaw/openclaw@7552634 chore(release): refresh plugin SDK baseline · openclaw/openclaw@736e7de ci(release): harden node setup before pnpm cache · openclaw/openclaw@a26aba6 ci(release): pass node pin to pnpm setup ci: use stable pnpm wrapper for Crabbox hydrate · openclaw/openclaw@b00d306 docs: refine maintainer docs sweep docs(memory): add guidance for action-sensitive memories (#82788) · openclaw/openclaw@bd04b1e docs(feishu): add dynamicAgentCreation and per-user isolation docs (#… docs(secrets): clarify agent-readable plaintext boundary (#84574) · openclaw/openclaw@ce5dcb0 docs(channels): document ackReactionScope for Slack & Telegram (DM go… · openclaw/openclaw@bbbed26 build(pnpm): use packageManager as pnpm source · openclaw/openclaw@a0702e1
fix(session): surface previous-transcript archive failures on /new ro… · openclaw/openclaw@679a46d
clawsweeper · 2026-05-23 · via Recent Commits to openclaw:main

@@ -1,16 +1,20 @@

11

import fs from "node:fs";

22

import os from "node:os";

33

import path from "node:path";

4-

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

4+

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

55

import {

66

onSessionTranscriptUpdate,

77

type SessionTranscriptUpdate,

88

} from "../sessions/transcript-events.js";

9-

import { archiveFileOnDisk } from "./session-transcript-files.fs.js";

9+

import {

10+

archiveFileOnDisk,

11+

archiveSessionTranscriptsDetailed,

12+

} from "./session-transcript-files.fs.js";

10131114

const subscriptions: Array<() => void> = [];

12151316

afterEach(() => {

17+

vi.restoreAllMocks();

1418

while (subscriptions.length > 0) {

1519

subscriptions.pop()?.();

1620

}

@@ -65,3 +69,113 @@ describe("archiveFileOnDisk transcript updates", () => {

6569

}

6670

});

6771

});

72+73+

describe("archiveSessionTranscriptsDetailed failure surface", () => {

74+

it("invokes onArchiveError when fs.renameSync fails and returns only successful entries", () => {

75+

const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "oc-archive-failure-"));

76+

try {

77+

const sessionId = "11111111-1111-4111-8111-111111111111";

78+

const sessionFile = path.join(tmpDir, `${sessionId}.jsonl`);

79+

fs.writeFileSync(sessionFile, '{"type":"session-meta","agentId":"main"}\n');

80+81+

const renameError = Object.assign(new Error("EACCES: permission denied"), {

82+

code: "EACCES",

83+

});

84+

const renameSpy = vi.spyOn(fs, "renameSync").mockImplementation(() => {

85+

throw renameError;

86+

});

87+88+

const errors: Array<{ err: unknown; sourcePath: string }> = [];

89+

const archived = archiveSessionTranscriptsDetailed({

90+

sessionId,

91+

storePath: path.join(tmpDir, "store.json"),

92+

sessionFile,

93+

agentId: "main",

94+

reason: "reset",

95+

onArchiveError: (err, sourcePath) => {

96+

errors.push({ err, sourcePath });

97+

},

98+

});

99+100+

renameSpy.mockRestore();

101+102+

expect(archived).toEqual([]);

103+

expect(errors.length).toBeGreaterThan(0);

104+

expect(errors[0].err).toBe(renameError);

105+

expect(fs.existsSync(sessionFile)).toBe(true);

106+

} finally {

107+

fs.rmSync(tmpDir, { recursive: true, force: true });

108+

}

109+

});

110+111+

it("archives normally when no onArchiveError is provided", () => {

112+

const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "oc-archive-success-"));

113+

try {

114+

const sessionId = "22222222-2222-4222-8222-222222222222";

115+

const sessionFile = path.join(tmpDir, `${sessionId}.jsonl`);

116+

fs.writeFileSync(sessionFile, '{"type":"session-meta","agentId":"main"}\n');

117+118+

const archived = archiveSessionTranscriptsDetailed({

119+

sessionId,

120+

storePath: path.join(tmpDir, "store.json"),

121+

sessionFile,

122+

agentId: "main",

123+

reason: "reset",

124+

});

125+126+

expect(archived.length).toBe(1);

127+

expect(archived[0].archivedPath).toContain(".jsonl.reset.");

128+

expect(fs.existsSync(archived[0].archivedPath)).toBe(true);

129+

expect(fs.existsSync(sessionFile)).toBe(false);

130+

} finally {

131+

fs.rmSync(tmpDir, { recursive: true, force: true });

132+

}

133+

});

134+135+

it("surfaces real chmod archive failures through onArchiveError", () => {

136+

if (process.platform === "win32" || process.getuid?.() === 0) {

137+

return;

138+

}

139+140+

const tmpDir = fs.realpathSync(

141+

fs.mkdtempSync(path.join(os.tmpdir(), "oc-archive-real-eacces-")),

142+

);

143+

try {

144+

const sessionId = "33333333-3333-4333-8333-333333333333";

145+

const sessionFile = path.join(tmpDir, `${sessionId}.jsonl`);

146+

fs.writeFileSync(sessionFile, '{"type":"session-meta","agentId":"main"}\n');

147+

fs.chmodSync(tmpDir, 0o555);

148+149+

const errors: Array<{ code?: string; sourcePath: string }> = [];

150+

let archived: ReturnType<typeof archiveSessionTranscriptsDetailed> = [];

151+

try {

152+

archived = archiveSessionTranscriptsDetailed({

153+

sessionId,

154+

storePath: path.join(tmpDir, "store.json"),

155+

sessionFile,

156+

agentId: "main",

157+

reason: "reset",

158+

onArchiveError: (err, sourcePath) => {

159+

const code = (err as NodeJS.ErrnoException | undefined)?.code;

160+

errors.push({ code, sourcePath });

161+

},

162+

});

163+

} finally {

164+

fs.chmodSync(tmpDir, 0o755);

165+

}

166+167+

expect(archived).toEqual([]);

168+

expect(errors.length).toBeGreaterThan(0);

169+

expect(errors[0].sourcePath).toBe(sessionFile);

170+

expect(errors[0].code).toMatch(/^(EACCES|EPERM)$/);

171+

expect(fs.existsSync(sessionFile)).toBe(true);

172+

} finally {

173+

try {

174+

fs.chmodSync(tmpDir, 0o755);

175+

} catch {

176+

// Already restored.

177+

}

178+

fs.rmSync(tmpDir, { recursive: true, force: true });

179+

}

180+

});

181+

});