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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
B
Blog

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: speed up infra test hotspots · openclaw/openclaw@85...
steipete · 2026-05-27 · via Recent Commits to openclaw:main

@@ -55,10 +55,17 @@ describe("git commit resolution", () => {

5555

const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");

5656

let resolveCommitHash: (typeof import("./git-commit.js"))["resolveCommitHash"];

5757

let testing: (typeof import("./git-commit.js"))["testing"];

58+

let repoHead: string;

58595960

beforeAll(async () => {

6061

vi.doUnmock("node:fs");

6162

vi.doUnmock("node:module");

63+

repoHead = execFileSync("git", ["rev-parse", "--short=7", "HEAD"], {

64+

cwd: repoRoot,

65+

encoding: "utf-8",

66+

})

67+

.trim()

68+

.slice(0, 7);

6269

({ resolveCommitHash, testing } = await import("./git-commit.js"));

6370

});

6471

@@ -78,46 +85,19 @@ describe("git commit resolution", () => {

7885

});

79868087

it("resolves commit metadata from the caller module root instead of the caller cwd", async () => {

81-

const repoHead = execFileSync("git", ["rev-parse", "--short=7", "HEAD"], {

82-

cwd: repoRoot,

83-

encoding: "utf-8",

84-

})

85-

.trim()

86-

.slice(0, 7);

87-8888

const temp = await makeTempDir("git-commit-cwd");

8989

const otherRepo = path.join(temp, "other");

90-

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

91-

execFileSync("git", ["init", "-q"], { cwd: otherRepo });

92-

await fs.writeFile(path.join(otherRepo, "note.txt"), "x\n", "utf-8");

93-

execFileSync("git", ["add", "note.txt"], { cwd: otherRepo });

94-

execFileSync(

95-

"git",

96-

["-c", "user.name=test", "-c", "user.email=test@example.com", "commit", "-q", "-m", "init"],

97-

{ cwd: otherRepo },

98-

);

99-

const otherHead = execFileSync("git", ["rev-parse", "--short=7", "HEAD"], {

100-

cwd: otherRepo,

101-

encoding: "utf-8",

102-

})

103-

.trim()

104-

.slice(0, 7);

90+

const otherCommit = "1234567890abcdef1234567890abcdef12345678";

91+

await makeFakeGitRepo(otherRepo, { head: otherCommit });

1059210693

const entryModuleUrl = pathToFileURL(path.join(repoRoot, "src", "entry.ts")).href;

10794

vi.spyOn(process, "cwd").mockReturnValue(otherRepo);

1089510996

expect(resolveCommitHash({ moduleUrl: entryModuleUrl })).toBe(repoHead);

110-

expect(resolveCommitHash({ moduleUrl: entryModuleUrl })).not.toBe(otherHead);

97+

expect(resolveCommitHash({ moduleUrl: entryModuleUrl })).not.toBe(otherCommit.slice(0, 7));

11198

});

11299113100

it("prefers live git metadata over stale build info in a real checkout", () => {

114-

const repoHead = execFileSync("git", ["rev-parse", "--short=7", "HEAD"], {

115-

cwd: repoRoot,

116-

encoding: "utf-8",

117-

})

118-

.trim()

119-

.slice(0, 7);

120-121101

const entryModuleUrl = pathToFileURL(path.join(repoRoot, "src", "entry.ts")).href;

122102123103

expect(

@@ -176,13 +156,6 @@ describe("git commit resolution", () => {

176156

});

177157178158

it("treats invalid moduleUrl inputs as a fallback hint instead of throwing", () => {

179-

const repoHead = execFileSync("git", ["rev-parse", "--short=7", "HEAD"], {

180-

cwd: repoRoot,

181-

encoding: "utf-8",

182-

})

183-

.trim()

184-

.slice(0, 7);

185-186159

expect(resolveCommitHash({ moduleUrl: "not-a-file-url", cwd: repoRoot, env: {} })).toBe(

187160

repoHead,

188161

);

@@ -191,15 +164,7 @@ describe("git commit resolution", () => {

191164

it("does not walk out of the openclaw package into a host repo", async () => {

192165

const temp = await makeTempDir("git-commit-package-boundary");

193166

const hostRepo = path.join(temp, "host");

194-

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

195-

execFileSync("git", ["init", "-q"], { cwd: hostRepo });

196-

await fs.writeFile(path.join(hostRepo, "host.txt"), "x\n", "utf-8");

197-

execFileSync("git", ["add", "host.txt"], { cwd: hostRepo });

198-

execFileSync(

199-

"git",

200-

["-c", "user.name=test", "-c", "user.email=test@example.com", "commit", "-q", "-m", "init"],

201-

{ cwd: hostRepo },

202-

);

167+

await makeFakeGitRepo(hostRepo, { head: "abcdef1234567890abcdef1234567890abcdef12" });

203168204169

const packageRoot = path.join(hostRepo, "node_modules", "openclaw");

205170

await fs.mkdir(path.join(packageRoot, "dist"), { recursive: true });