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

推荐订阅源

爱范儿
爱范儿
H
Help Net Security
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
博客园 - 叶小钗
Y
Y Combinator Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
C
Check Point Blog
Recent Announcements
Recent Announcements
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
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 prompt snapshot checks · openclaw/openclaw...
steipete · 2026-05-18 · via Recent Commits to openclaw:main

@@ -2,11 +2,8 @@ import { spawnSync } from "node:child_process";

22

import fs from "node:fs";

33

import os from "node:os";

44

import path from "node:path";

5-

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

6-

import {

7-

createFormattedPromptSnapshotFiles,

8-

deleteStalePromptSnapshotFiles,

9-

} from "../../scripts/generate-prompt-snapshots.js";

5+

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

6+

import { deleteStalePromptSnapshotFiles } from "../../scripts/prompt-snapshot-files.js";

107

import {

118

defaultCatalogPathCandidates,

129

findDefaultCatalogPath,

@@ -18,17 +15,10 @@ import { toRepoRelativePath } from "../../src/test-utils/repo-files.js";

1815

import {

1916

CODEX_MODEL_PROMPT_FIXTURE_DIR,

2017

CODEX_RUNTIME_HAPPY_PATH_PROMPT_SNAPSHOT_DIR,

21-

} from "../helpers/agents/happy-path-prompt-snapshots.js";

18+

} from "../helpers/agents/prompt-snapshot-paths.js";

221923-

function requireGeneratedSnapshot(

24-

generated: Array<{ path: string; content: string }>,

25-

fileName: string,

26-

): string {

27-

const match = generated.find((file) => file.path.endsWith(fileName));

28-

if (!match) {

29-

throw new Error(`Missing generated prompt snapshot ${fileName}`);

30-

}

31-

return match.content;

20+

function readCommittedSnapshot(fileName: string): string {

21+

return fs.readFileSync(path.join(CODEX_RUNTIME_HAPPY_PATH_PROMPT_SNAPSHOT_DIR, fileName), "utf8");

3222

}

33233424

function renderedPromptSection(content: string, heading: string, nextHeading: string): string {

@@ -113,12 +103,6 @@ function listFindCommittedPromptSnapshotFiles(): string[] | null {

113103

}

114104115105

describe("happy path prompt snapshots", () => {

116-

let generatedSnapshots: Awaited<ReturnType<typeof createFormattedPromptSnapshotFiles>>;

117-118-

beforeAll(async () => {

119-

generatedSnapshots = await createFormattedPromptSnapshotFiles();

120-

}, 300_000);

121-122106

it("lists committed Codex prompt snapshot artifacts without scanning directories in-process", () => {

123107

expectNoReaddirSyncDuring(() => {

124108

const committed = listCommittedPromptSnapshotFiles();

@@ -128,13 +112,16 @@ describe("happy path prompt snapshots", () => {

128112

});

129113

});

130114131-

it("matches the committed Codex prompt snapshot artifacts", async () => {

132-

const expectedPaths = new Set(generatedSnapshots.map((file) => file.path));

133-

for (const file of generatedSnapshots) {

134-

expect(fs.readFileSync(file.path, "utf8"), file.path).toBe(file.content);

135-

}

136-

const committed = listCommittedPromptSnapshotFiles();

137-

expect(committed.toSorted()).toEqual([...expectedPaths].toSorted());

115+

it("keeps the committed Codex prompt snapshot artifact set explicit", () => {

116+

expect(listCommittedPromptSnapshotFiles().map((file) => path.basename(file))).toEqual([

117+

"README.md",

118+

"codex-dynamic-tools.discord-group.json",

119+

"codex-dynamic-tools.heartbeat-turn.json",

120+

"codex-dynamic-tools.telegram-direct.json",

121+

"discord-group-codex-message-tool.md",

122+

"telegram-direct-codex-message-tool.md",

123+

"telegram-heartbeat-codex-tool.md",

124+

]);

138125

});

139126140127

it("deletes stale generated snapshot artifacts", async () => {

@@ -160,10 +147,7 @@ describe("happy path prompt snapshots", () => {

160147

});

161148162149

it("renders the Codex model-bound prompt layers", async () => {

163-

const telegram = requireGeneratedSnapshot(

164-

generatedSnapshots,

165-

"telegram-direct-codex-message-tool.md",

166-

);

150+

const telegram = readCommittedSnapshot("telegram-direct-codex-message-tool.md");

167151168152

expect(telegram).toContain("## Reconstructed Model-Bound Prompt Layers");

169153

expect(telegram).toContain("### System: Codex Model Instructions (gpt-5.5, pragmatic)");

@@ -183,18 +167,9 @@ describe("happy path prompt snapshots", () => {

183167

});

184168185169

it("keeps heartbeat guidance in heartbeat collaboration mode only", async () => {

186-

const direct = requireGeneratedSnapshot(

187-

generatedSnapshots,

188-

"telegram-direct-codex-message-tool.md",

189-

);

190-

const group = requireGeneratedSnapshot(

191-

generatedSnapshots,

192-

"discord-group-codex-message-tool.md",

193-

);

194-

const heartbeat = requireGeneratedSnapshot(

195-

generatedSnapshots,

196-

"telegram-heartbeat-codex-tool.md",

197-

);

170+

const direct = readCommittedSnapshot("telegram-direct-codex-message-tool.md");

171+

const group = readCommittedSnapshot("discord-group-codex-message-tool.md");

172+

const heartbeat = readCommittedSnapshot("telegram-heartbeat-codex-tool.md");

198173

const heartbeatPhrase = "Use heartbeats to create useful proactive progress";

199174200175

expect(direct).toContain('"collaborationMode": {');