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

推荐订阅源

D
DataBreaches.Net
罗磊的独立博客
雷峰网
雷峰网
量子位
V
Visual Studio Blog
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
月光博客
月光博客
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
腾讯CDC
Engineering at Meta
Engineering at Meta
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Jina AI
Jina AI
A
About on SuperTechFans

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
fix(cron): delay cli model-start phase · openclaw/opencla...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -1,6 +1,8 @@

11

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

22

import {

33

clearFastTestEnv,

4+

getCliSessionIdMock,

5+

isCliProviderMock,

46

loadRunCronIsolatedAgentTurn,

57

makeCronSession,

68

makeCronSessionEntry,

@@ -17,6 +19,7 @@ import {

1719

runEmbeddedPiAgentMock,

1820

runWithModelFallbackMock,

1921

updateSessionStoreMock,

22+

runCliAgentMock,

2023

} from "./run.test-harness.js";

21242225

const runCronIsolatedAgentTurn = await loadRunCronIsolatedAgentTurn();

@@ -67,6 +70,16 @@ function makeSuccessfulRunResult(provider = "google", model = "gemini-2.0-flash"

6770

};

6871

}

697273+

function createDeferred<T = void>() {

74+

let resolve!: (value: T | PromiseLike<T>) => void;

75+

let reject!: (reason?: unknown) => void;

76+

const promise = new Promise<T>((res, rej) => {

77+

resolve = res;

78+

reject = rej;

79+

});

80+

return { promise, resolve, reject };

81+

}

82+7083

// ---------- tests ----------

71847285

describe("runCronIsolatedAgentTurn — cron model override forwarding (#58065)", () => {

@@ -187,6 +200,74 @@ describe("runCronIsolatedAgentTurn — cron model override forwarding (#58065)",

187200

);

188201

});

189202203+

it("does not mark CLI cron runs as model-started before CLI session resolution", async () => {

204+

isCliProviderMock.mockReturnValue(true);

205+

runWithModelFallbackMock.mockImplementation(async ({ provider, model, run }) => {

206+

const result = await run(provider, model);

207+

return { result, provider, model, attempts: [] };

208+

});

209+

resolveCronSessionMock.mockReturnValue(

210+

makeCronSession({

211+

sessionEntry: makeCronSessionEntry({

212+

model: undefined,

213+

modelProvider: undefined,

214+

}),

215+

isNewSession: false,

216+

}),

217+

);

218+

const getCliSessionStarted = createDeferred();

219+

const releaseCliSessionLookup = createDeferred<string | undefined>();

220+

getCliSessionIdMock.mockImplementation(async () => {

221+

getCliSessionStarted.resolve();

222+

return await releaseCliSessionLookup.promise;

223+

});

224+

runCliAgentMock.mockImplementation(async ({ onExecutionPhase }) => {

225+

onExecutionPhase?.({

226+

phase: "model_call_started",

227+

provider: "google",

228+

model: "gemini-2.0-flash",

229+

firstModelCallStarted: true,

230+

});

231+

return {

232+

payloads: [{ text: "summary done" }],

233+

meta: { agentMeta: { usage: { input: 10, output: 20 } } },

234+

};

235+

});

236+

const phases: unknown[] = [];

237+238+

const runPromise = runCronIsolatedAgentTurn(

239+

makeParams({

240+

job: makeJob({ sessionTarget: "session:existing-cron-session" }),

241+

onExecutionPhase: (info: unknown) => phases.push(info),

242+

}),

243+

);

244+245+

await getCliSessionStarted.promise;

246+

expect(phases).not.toContainEqual(

247+

expect.objectContaining({

248+

phase: "model_call_started",

249+

firstModelCallStarted: true,

250+

}),

251+

);

252+253+

releaseCliSessionLookup.resolve("previous-cli-session");

254+

const result = await runPromise;

255+256+

expect(result.status).toBe("ok");

257+

expect(runCliAgentMock).toHaveBeenCalledWith(

258+

expect.objectContaining({

259+

cliSessionId: "previous-cli-session",

260+

onExecutionPhase: expect.any(Function),

261+

}),

262+

);

263+

expect(phases).toContainEqual(

264+

expect.objectContaining({

265+

phase: "model_call_started",

266+

firstModelCallStarted: true,

267+

}),

268+

);

269+

});

270+190271

it("validates cron thinking with catalog reasoning metadata", async () => {

191272

resolveAllowedModelRefMock.mockImplementation(() => ({

192273

ref: { provider: "ollama", model: "qwen3:0.6b" },