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

推荐订阅源

Project Zero
Project Zero
GbyAI
GbyAI
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
小众软件
小众软件
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
F
Fortinet All Blogs
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
O
OpenAI News
V
V2EX
博客园 - 三生石上(FineUI控件)
AI
AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
H
Help Net Security
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tenable Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cisco Talos Blog
Cisco Talos Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
S
Security @ Cisco Blogs
S
Securelist
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
雷峰网
雷峰网
V2EX - 技术
V2EX - 技术

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
refactor(agents): remove stale file transcript rewrite · openclaw/openclaw@c33cec0
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -20,7 +20,6 @@ vi.mock("../session-write-lock.js", () =>

2020

),

2121

);

222223-

let rewriteTranscriptEntriesInSessionFile: typeof import("./transcript-rewrite.js").rewriteTranscriptEntriesInSessionFile;

2423

let rewriteTranscriptEntriesInSessionManager: typeof import("./transcript-rewrite.js").rewriteTranscriptEntriesInSessionManager;

2524

let rewriteTranscriptEntriesInRuntimeTranscript: typeof import("./transcript-rewrite.js").rewriteTranscriptEntriesInRuntimeTranscript;

2625

let onSessionTranscriptUpdate: typeof import("../../sessions/transcript-events.js").onSessionTranscriptUpdate;

@@ -50,10 +49,6 @@ function createTextContent(text: string) {

5049

return [{ type: "text", text }];

5150

}

525153-

function getMessageContent(message: AgentMessage): unknown {

54-

return "content" in message ? message.content : undefined;

55-

}

56-5752

function createReadRewriteSession(options?: { tailAssistantText?: string }) {

5853

// Read rewrite fixtures include a suffix assistant turn so branch rewrites

5954

// must re-append downstream entries after replacing the tool result.

@@ -162,7 +157,6 @@ beforeAll(async () => {

162157

({ installSessionToolResultGuard } = await import("../session-tool-result-guard.js"));

163158

({

164159

rewriteTranscriptEntriesInRuntimeTranscript,

165-

rewriteTranscriptEntriesInSessionFile,

166160

rewriteTranscriptEntriesInSessionManager,

167161

} = await import("./transcript-rewrite.js"));

168162

});

@@ -309,7 +303,7 @@ describe("rewriteTranscriptEntriesInSessionManager", () => {

309303

});

310304

});

311305312-

describe("rewriteTranscriptEntriesInSessionFile", () => {

306+

describe("rewriteTranscriptEntriesInRuntimeTranscript", () => {

313307

it("does not create session metadata for missing runtime transcripts", async () => {

314308

const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-transcript-rewrite-runtime-"));

315309

const storePath = path.join(dir, "sessions.json");

@@ -418,319 +412,4 @@ describe("rewriteTranscriptEntriesInSessionFile", () => {

418412

}

419413

});

420414421-

it("aborts under the write lock when the active suffix contains an unexpected entry", async () => {

422-

const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-transcript-rewrite-guard-"));

423-

const sessionManager = SessionManager.create(dir, dir);

424-

const entryIds = appendSessionMessages(sessionManager, [

425-

asAppendMessage({

426-

role: "user",

427-

content: "start",

428-

timestamp: 1,

429-

}),

430-

asAppendMessage({

431-

role: "assistant",

432-

content: createTextContent("source reply media"),

433-

timestamp: 2,

434-

}),

435-

asAppendMessage({

436-

role: "assistant",

437-

content: createTextContent("source reply text"),

438-

timestamp: 3,

439-

}),

440-

asAppendMessage({

441-

role: "user",

442-

content: "concurrent append",

443-

timestamp: 4,

444-

}),

445-

]);

446-

const sessionFile = requireString(sessionManager.getSessionFile(), "persisted session file");

447-

const mediaEntryId = entryIds[1];

448-

const textEntryId = entryIds[2];

449-

const listener = vi.fn();

450-

const cleanup = onSessionTranscriptUpdate(listener);

451-452-

try {

453-

const result = await rewriteTranscriptEntriesInSessionFile({

454-

sessionFile,

455-

sessionKey: "agent:main:test",

456-

request: {

457-

allowedRewriteSuffixEntryIds: [mediaEntryId, textEntryId],

458-

replacements: [

459-

{

460-

entryId: mediaEntryId,

461-

message: asAppendMessage({

462-

role: "assistant",

463-

content: createTextContent("rewritten source reply media"),

464-

timestamp: 2,

465-

}) as AgentMessage,

466-

},

467-

],

468-

},

469-

});

470-471-

expect(result).toMatchObject({

472-

changed: false,

473-

reason: "rewrite suffix guard failed",

474-

});

475-

expect(listener).not.toHaveBeenCalled();

476-477-

const unchangedSession = SessionManager.open(sessionFile);

478-

expect(getBranchMessages(unchangedSession).map(getMessageContent)).toEqual([

479-

"start",

480-

createTextContent("source reply media"),

481-

createTextContent("source reply text"),

482-

"concurrent append",

483-

]);

484-

} finally {

485-

cleanup();

486-

}

487-

});

488-489-

it("rewrites a guarded side branch and restores the active navigation state", async () => {

490-

const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-transcript-rewrite-side-"));

491-

const sessionFile = path.join(dir, "session.jsonl");

492-

await fs.writeFile(

493-

sessionFile,

494-

[

495-

{

496-

type: "session",

497-

version: 3,

498-

id: "session-side-rewrite",

499-

timestamp: "2026-06-15T00:00:00.000Z",

500-

cwd: dir,

501-

},

502-

{

503-

type: "message",

504-

id: "active-root",

505-

parentId: null,

506-

timestamp: "2026-06-15T00:00:01.000Z",

507-

message: { role: "user", content: "active root", timestamp: 1 },

508-

},

509-

{

510-

type: "message",

511-

id: "side-mirror",

512-

parentId: "active-root",

513-

timestamp: "2026-06-15T00:00:02.000Z",

514-

message: {

515-

role: "assistant",

516-

content: createTextContent("source reply before rewrite"),

517-

timestamp: 2,

518-

},

519-

},

520-

{

521-

type: "leaf",

522-

id: "active-leaf",

523-

parentId: "side-mirror",

524-

timestamp: "2026-06-15T00:00:03.000Z",

525-

targetId: "active-root",

526-

appendParentId: "side-mirror",

527-

appendMode: "side",

528-

},

529-

]

530-

.map((entry) => JSON.stringify(entry))

531-

.join("\n") + "\n",

532-

"utf-8",

533-

);

534-535-

const result = await rewriteTranscriptEntriesInSessionFile({

536-

sessionFile,

537-

sessionKey: "agent:main:test",

538-

request: {

539-

allowedRewriteSuffixEntryIds: ["side-mirror"],

540-

replacements: [

541-

{

542-

entryId: "side-mirror",

543-

message: asAppendMessage({

544-

role: "assistant",

545-

content: createTextContent("source reply after rewrite"),

546-

timestamp: 2,

547-

}) as AgentMessage,

548-

},

549-

],

550-

},

551-

});

552-553-

expect(result).toMatchObject({ changed: true, rewrittenEntries: 1 });

554-

const records = (await fs.readFile(sessionFile, "utf-8"))

555-

.trim()

556-

.split("\n")

557-

.map(

558-

(line) =>

559-

JSON.parse(line) as {

560-

type?: string;

561-

id?: string;

562-

parentId?: string | null;

563-

targetId?: string | null;

564-

appendParentId?: string | null;

565-

appendMode?: "side";

566-

message?: AgentMessage;

567-

},

568-

);

569-

const rewrittenSideEntry = records.findLast(

570-

(entry) =>

571-

entry.type === "message" &&

572-

JSON.stringify(entry.message).includes("source reply after rewrite"),

573-

);

574-

expect(rewrittenSideEntry).toMatchObject({ parentId: "active-root" });

575-

expect(records.at(-1)).toMatchObject({

576-

type: "leaf",

577-

parentId: rewrittenSideEntry?.id,

578-

targetId: "active-root",

579-

appendParentId: "side-mirror",

580-

appendMode: "side",

581-

});

582-583-

const reopened = SessionManager.open(sessionFile, dir, dir);

584-

expect(getBranchMessages(reopened).map(getMessageContent)).toEqual(["active root"]);

585-

const nextId = reopened.appendMessage(

586-

asAppendMessage({ role: "user", content: "active continuation", timestamp: 3 }),

587-

);

588-

expect(reopened.getEntry(nextId)).toMatchObject({ parentId: "active-root" });

589-

expect(reopened.getEntry(nextId)).not.toHaveProperty("appendMode");

590-

});

591-592-

it("rejects a rewrite batch split across active and side branches", async () => {

593-

const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-transcript-rewrite-mixed-"));

594-

const sessionFile = path.join(dir, "session.jsonl");

595-

const records = [

596-

{

597-

type: "session",

598-

version: 3,

599-

id: "session-mixed-rewrite",

600-

timestamp: "2026-06-15T00:00:00.000Z",

601-

cwd: dir,

602-

},

603-

{

604-

type: "message",

605-

id: "root",

606-

parentId: null,

607-

timestamp: "2026-06-15T00:00:01.000Z",

608-

message: { role: "user", content: "root", timestamp: 1 },

609-

},

610-

{

611-

type: "message",

612-

id: "active-mirror",

613-

parentId: "root",

614-

timestamp: "2026-06-15T00:00:02.000Z",

615-

message: { role: "assistant", content: createTextContent("active"), timestamp: 2 },

616-

},

617-

{

618-

type: "message",

619-

id: "side-mirror",

620-

parentId: "root",

621-

timestamp: "2026-06-15T00:00:03.000Z",

622-

message: { role: "assistant", content: createTextContent("side"), timestamp: 3 },

623-

},

624-

{

625-

type: "leaf",

626-

id: "active-leaf",

627-

parentId: "side-mirror",

628-

timestamp: "2026-06-15T00:00:04.000Z",

629-

targetId: "active-mirror",

630-

},

631-

];

632-

const original = records.map((entry) => JSON.stringify(entry)).join("\n") + "\n";

633-

await fs.writeFile(sessionFile, original, "utf-8");

634-635-

const result = await rewriteTranscriptEntriesInSessionFile({

636-

sessionFile,

637-

sessionKey: "agent:main:test",

638-

request: {

639-

allowedRewriteSuffixEntryIds: ["active-mirror", "side-mirror"],

640-

replacements: [

641-

{

642-

entryId: "active-mirror",

643-

message: asAppendMessage({

644-

role: "assistant",

645-

content: createTextContent("active rewritten"),

646-

timestamp: 2,

647-

}) as AgentMessage,

648-

},

649-

{

650-

entryId: "side-mirror",

651-

message: asAppendMessage({

652-

role: "assistant",

653-

content: createTextContent("side rewritten"),

654-

timestamp: 3,

655-

}) as AgentMessage,

656-

},

657-

],

658-

},

659-

});

660-661-

expect(result).toMatchObject({

662-

changed: false,

663-

reason: "rewrite targets span multiple branches",

664-

});

665-

expect(await fs.readFile(sessionFile, "utf-8")).toBe(original);

666-

});

667-668-

it("emits transcript updates when the active branch changes without opening a manager", async () => {

669-

const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-transcript-rewrite-"));

670-

const sessionManager = SessionManager.create(dir, dir);

671-

const entryIds = appendSessionMessages(sessionManager, [

672-

asAppendMessage({

673-

role: "user",

674-

content: "run tool",

675-

timestamp: 1,

676-

}),

677-

asAppendMessage({

678-

role: "toolResult",

679-

toolCallId: "call_1",

680-

toolName: "exec",

681-

content: createTextContent("before rewrite"),

682-

isError: false,

683-

timestamp: 2,

684-

}),

685-

asAppendMessage({

686-

role: "assistant",

687-

content: createTextContent("summarized"),

688-

timestamp: 3,

689-

}),

690-

]);

691-

const sessionFile = requireString(sessionManager.getSessionFile(), "persisted session file");

692-

const toolResultEntryId = entryIds[1];

693-694-

const openSpy = vi.spyOn(SessionManager, "open").mockImplementation(() => {

695-

throw new Error("SessionManager.open should not be used for file rewrites");

696-

});

697-

const listener = vi.fn();

698-

const cleanup = onSessionTranscriptUpdate(listener);

699-700-

try {

701-

const result = await rewriteTranscriptEntriesInSessionFile({

702-

sessionFile,

703-

sessionKey: "agent:main:test",

704-

request: {

705-

replacements: [

706-

{

707-

entryId: toolResultEntryId,

708-

message: createToolResultReplacement("exec", "[file_ref:file_abc]", 2),

709-

},

710-

],

711-

},

712-

});

713-714-

expect(result.changed).toBe(true);

715-

expect(acquireSessionWriteLockMock).toHaveBeenCalledWith({

716-

sessionFile,

717-

staleMs: 1_800_000,

718-

timeoutMs: 60_000,

719-

maxHoldMs: 300_000,

720-

});

721-

expect(acquireSessionWriteLockReleaseMock).toHaveBeenCalledTimes(1);

722-

expect(listener).toHaveBeenCalledWith({ sessionFile, sessionKey: "agent:main:test" });

723-724-

openSpy.mockRestore();

725-

const rewrittenSession = SessionManager.open(sessionFile);

726-

const rewrittenToolResult = getBranchMessages(rewrittenSession)[1] as Extract<

727-

AgentMessage,

728-

{ role: "toolResult" }

729-

>;

730-

expect(rewrittenToolResult.content).toEqual([{ type: "text", text: "[file_ref:file_abc]" }]);

731-

} finally {

732-

cleanup();

733-

openSpy.mockRestore();

734-

}

735-

});

736415

});