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

推荐订阅源

云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
月光博客
月光博客
T
Tailwind CSS Blog
小众软件
小众软件
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
B
Blog RSS Feed
博客园 - 司徒正美
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
博客园 - Franky
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research

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: isolate compact hook runtime plan · openclaw/opencl...
shakkernerd · 2026-05-10 · via Recent Commits to openclaw:main

@@ -1,6 +1,7 @@

11

import { vi, type Mock } from "vitest";

22

import type { PluginMetadataSnapshot } from "../../plugins/plugin-metadata-snapshot.js";

33

import { clearAgentHarnesses } from "../harness/registry.js";

4+

import type { AgentRuntimePlan, BuildAgentRuntimePlanParams } from "../runtime-plan/types.js";

45

import type { CompactionTranscriptRotation } from "./compaction-successor-transcript.js";

5667

type MockResolvedModel = {

@@ -110,6 +111,75 @@ export const rotateTranscriptAfterCompactionMock: Mock<

110111

rotated: false,

111112

}));

112113114+

function createCompactHooksRuntimePlan(params: BuildAgentRuntimePlanParams): AgentRuntimePlan {

115+

const modelApi = params.modelApi ?? params.model?.api ?? undefined;

116+

const transcriptPolicy = {

117+

sanitizeMode: "full" as const,

118+

sanitizeToolCallIds: false,

119+

preserveNativeAnthropicToolUseIds: false,

120+

repairToolUseResultPairing: false,

121+

preserveSignatures: false,

122+

sanitizeThinkingSignatures: false,

123+

dropThinkingBlocks: false,

124+

applyGoogleTurnOrdering: false,

125+

validateGeminiTurns: false,

126+

validateAnthropicTurns: false,

127+

allowSyntheticToolResults: false,

128+

};

129+130+

return {

131+

resolvedRef: {

132+

provider: params.provider,

133+

modelId: params.modelId,

134+

...(modelApi ? { modelApi } : {}),

135+

...(params.resolvedTransport ? { transport: params.resolvedTransport } : {}),

136+

},

137+

auth: {

138+

providerForAuth: params.provider,

139+

authProfileProviderForAuth: params.authProfileProvider ?? params.provider,

140+

...(params.sessionAuthProfileId

141+

? { forwardedAuthProfileId: params.sessionAuthProfileId }

142+

: {}),

143+

},

144+

prompt: {

145+

provider: params.provider,

146+

modelId: params.modelId,

147+

resolveSystemPromptContribution: vi.fn(() => undefined),

148+

transformSystemPrompt: vi.fn((context: { systemPrompt: string }) => context.systemPrompt),

149+

},

150+

tools: {

151+

preparedPlanning: {

152+

loadMetadataSnapshot: () => ({}),

153+

},

154+

normalize: vi.fn((tools) => tools),

155+

logDiagnostics: vi.fn(),

156+

},

157+

transcript: {

158+

policy: transcriptPolicy,

159+

resolvePolicy: vi.fn(() => transcriptPolicy),

160+

},

161+

delivery: {

162+

isSilentPayload: vi.fn(() => false),

163+

resolveFollowupRoute: vi.fn(() => undefined),

164+

},

165+

outcome: {

166+

classifyRunResult: vi.fn(() => null),

167+

},

168+

transport: {

169+

extraParams: {},

170+

resolveExtraParams: vi.fn(() => ({})),

171+

},

172+

observability: {

173+

resolvedRef: `${params.provider}/${params.modelId}`,

174+

provider: params.provider,

175+

modelId: params.modelId,

176+

...(modelApi ? { modelApi } : {}),

177+

...(params.sessionAuthProfileId ? { authProfileId: params.sessionAuthProfileId } : {}),

178+

...(params.resolvedTransport ? { transport: params.resolvedTransport } : {}),

179+

},

180+

};

181+

}

182+113183

const emptyPluginMetadataSnapshot: PluginMetadataSnapshot = {

114184

policyHash: "",

115185

index: {

@@ -569,6 +639,12 @@ export async function loadCompactHooksHarness(): Promise<{

569639

resolveMemorySearchConfig: resolveMemorySearchConfigMock,

570640

}));

571641642+

vi.doMock("../runtime-plan/build.js", () => ({

643+

buildAgentRuntimePlan: vi.fn((params: BuildAgentRuntimePlanParams) =>

644+

createCompactHooksRuntimePlan(params),

645+

),

646+

}));

647+572648

vi.doMock("../../plugins/memory-runtime.js", () => ({

573649

getActiveMemorySearchManager: getMemorySearchManagerMock,

574650

}));