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

推荐订阅源

罗磊的独立博客
U
Unit 42
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
小众软件
小众软件
V
Visual Studio Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
GbyAI
GbyAI
爱范儿
爱范儿
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
博客园_首页
D
Docker
A
About on SuperTechFans
G
Google Developers Blog
I
InfoQ
T
The Blog of Author Tim Ferriss
V
V2EX
博客园 - Franky

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: dedupe gateway plugin mock reads · openclaw/opencla...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -205,6 +205,18 @@ function requireRecord(value: unknown, label: string): Record<string, unknown> {

205205

return value;

206206

}

207207208+

function getLastMockFirstArg(

209+

mock: { mock: { calls: ReadonlyArray<ReadonlyArray<unknown>> } },

210+

label: string,

211+

): unknown {

212+

const calls = mock.mock.calls;

213+

const call = calls[calls.length - 1];

214+

if (!call) {

215+

throw new Error(`Expected ${label} mock to have at least one call`);

216+

}

217+

return call[0];

218+

}

219+208220

function readRecordField(record: Record<string, unknown>, key: string, label: string) {

209221

const value = record[key];

210222

if (!isRecord(value)) {

@@ -214,20 +226,27 @@ function readRecordField(record: Record<string, unknown>, key: string, label: st

214226

}

215227216228

function getLastPluginLoadOptions(): Record<string, unknown> {

217-

return requireRecord(loadOpenClawPlugins.mock.calls.at(-1)?.[0], "plugin load options");

229+

return requireRecord(

230+

getLastMockFirstArg(loadOpenClawPlugins, "plugin load"),

231+

"plugin load options",

232+

);

218233

}

219234220235

function getLastPluginLoadOption(key: string) {

221236

return getLastPluginLoadOptions()[key];

222237

}

223238224239

function getLastDispatchedContext(): GatewayRequestContext | undefined {

225-

const call = handleGatewayRequest.mock.calls.at(-1)?.[0];

240+

const call = getLastMockFirstArg(handleGatewayRequest, "gateway request") as

241+

| HandleGatewayRequestOptions

242+

| undefined;

226243

return call?.context;

227244

}

228245229246

function getLastDispatchedParams(): Record<string, unknown> | undefined {

230-

const call = handleGatewayRequest.mock.calls.at(-1)?.[0];

247+

const call = getLastMockFirstArg(handleGatewayRequest, "gateway request") as

248+

| HandleGatewayRequestOptions

249+

| undefined;

231250

return call?.req?.params as Record<string, unknown> | undefined;

232251

}

233252

@@ -236,13 +255,17 @@ function getRequiredLastDispatchedParams(): Record<string, unknown> {

236255

}

237256238257

function getLastDispatchedClientScopes(): string[] {

239-

const call = handleGatewayRequest.mock.calls.at(-1)?.[0];

258+

const call = getLastMockFirstArg(handleGatewayRequest, "gateway request") as

259+

| HandleGatewayRequestOptions

260+

| undefined;

240261

const scopes = call?.client?.connect?.scopes;

241262

return Array.isArray(scopes) ? scopes : [];

242263

}

243264244265

function getLastDispatchedClientInternal(): Record<string, unknown> {

245-

const call = handleGatewayRequest.mock.calls.at(-1)?.[0];

266+

const call = getLastMockFirstArg(handleGatewayRequest, "gateway request") as

267+

| HandleGatewayRequestOptions

268+

| undefined;

246269

return (call?.client?.internal ?? {}) as Record<string, unknown>;

247270

}

248271

@@ -252,7 +275,7 @@ function getLastPluginLoadLogger(): {

252275

error: (message: string) => void;

253276

debug?: (message: string) => void;

254277

} {

255-

const call = loadOpenClawPlugins.mock.calls.at(-1)?.[0] as

278+

const call = getLastMockFirstArg(loadOpenClawPlugins, "plugin load") as

256279

| {

257280

logger?: {

258281

info: (message: string) => void;

@@ -292,7 +315,7 @@ async function createSubagentRuntime(

292315

coreGatewayHandlers: {},

293316

baseMethods: [],

294317

});

295-

const call = loadOpenClawPlugins.mock.calls.at(-1)?.[0] as

318+

const call = getLastMockFirstArg(loadOpenClawPlugins, "plugin load") as

296319

| { runtimeOptions?: { allowGatewaySubagentBinding?: boolean } }

297320

| undefined;

298321

if (call?.runtimeOptions?.allowGatewaySubagentBinding !== true) {