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

推荐订阅源

博客园_首页
Vercel News
Vercel News
月光博客
月光博客
S
SegmentFault 最新的问题
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
小众软件
小众软件
WordPress大学
WordPress大学
G
Google Developers Blog
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 【当耐特】
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
refactor(agents): hide tool mutation helpers · openclaw/o...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main

@@ -2,7 +2,6 @@

22

// used to decide whether repeated tool actions can recover prior failures.

33

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

44

import {

5-

buildToolActionFingerprint,

65

buildToolMutationState,

76

isLikelyMutatingToolName,

87

isMutatingToolCall,

@@ -22,21 +21,23 @@ describe("tool mutation helpers", () => {

2221

});

23222423

it("builds stable fingerprints for mutating calls and omits read-only calls", () => {

25-

const writeFingerprint = buildToolActionFingerprint(

24+

const writeFingerprint = buildToolMutationState(

2625

"write",

2726

{ path: "/tmp/demo.txt", id: 42 },

2827

"write /tmp/demo.txt",

29-

);

28+

).actionFingerprint;

3029

expect(writeFingerprint).toBe("tool=write|path=/tmp/demo.txt|id=42");

313032-

const metaOnlyFingerprint = buildToolActionFingerprint(

31+

const metaOnlyFingerprint = buildToolMutationState(

3332

"exec",

3433

{ command: "npm start" },

3534

"npm start",

36-

);

35+

).actionFingerprint;

3736

expect(metaOnlyFingerprint).toBe("tool=exec|meta=npm start");

383739-

const readFingerprint = buildToolActionFingerprint("read", { path: "/tmp/demo.txt" });

38+

const readFingerprint = buildToolMutationState("read", {

39+

path: "/tmp/demo.txt",

40+

}).actionFingerprint;

4041

expect(readFingerprint).toBeUndefined();

4142

});

4243

@@ -49,7 +50,7 @@ describe("tool mutation helpers", () => {

4950

])("treats read-only shell command as non-mutating: %s %s", (toolName, command) => {

5051

expect(isMutatingToolCall(toolName, { command })).toBe(false);

5152

expect(buildToolMutationState(toolName, { command }).mutatingAction).toBe(false);

52-

expect(buildToolActionFingerprint(toolName, { command }, command)).toBeUndefined();

53+

expect(buildToolMutationState(toolName, { command }, command).actionFingerprint).toBeUndefined();

5354

});

54555556

it.each([

@@ -101,22 +102,22 @@ describe("tool mutation helpers", () => {

101102

])("keeps ambiguous or mutating shell command mutating: %s %s", (toolName, command) => {

102103

expect(isMutatingToolCall(toolName, { command })).toBe(true);

103104

expect(buildToolMutationState(toolName, { command }, command).mutatingAction).toBe(true);

104-

expect(buildToolActionFingerprint(toolName, { command }, command)).toBe(

105+

expect(buildToolMutationState(toolName, { command }, command).actionFingerprint).toBe(

105106

`tool=${toolName}|meta=${command.toLowerCase().replace(/\s+/g, " ")}`,

106107

);

107108

});

108109109110

it("treats coding-tool path aliases as the same stable target", () => {

110-

const filePathFingerprint = buildToolActionFingerprint("edit", {

111+

const filePathFingerprint = buildToolMutationState("edit", {

111112

file_path: "/tmp/demo.txt",

112113

old_string: "before",

113114

new_string: "after",

114-

});

115-

const fileAliasFingerprint = buildToolActionFingerprint("edit", {

115+

}).actionFingerprint;

116+

const fileAliasFingerprint = buildToolMutationState("edit", {

116117

file: "/tmp/demo.txt",

117118

oldText: "before",

118119

newText: "after again",

119-

});

120+

}).actionFingerprint;

120121121122

expect(filePathFingerprint).toBe("tool=edit|path=/tmp/demo.txt");

122123

expect(fileAliasFingerprint).toBe("tool=edit|path=/tmp/demo.txt");