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

推荐订阅源

C
Check Point Blog
罗磊的独立博客
量子位
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
M
MIT News - Artificial intelligence
月光博客
月光博客
IT之家
IT之家
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
D
Docker
The GitHub Blog
The GitHub Blog
B
Blog
V
Visual Studio Blog
博客园 - Franky
N
Netflix TechBlog - Medium
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
博客园 - 聂微东
U
Unit 42

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: validate cron context count · openclaw/openclaw@28597d2
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -700,6 +700,26 @@ describe("cron tool", () => {

700700

expect(text).toContain("Message 12");

701701

});

702702
703+

it.each([1.5, -1, "2messages"])(

704+

"rejects invalid contextMessages value %s",

705+

async (contextMessages) => {

706+

const tool = createTestCronTool({ agentSessionKey: "main" });

707+
708+

await expect(

709+

tool.execute("call-invalid-context", {

710+

action: "add",

711+

contextMessages,

712+

job: {

713+

name: "reminder",

714+

schedule: { at: new Date(123).toISOString() },

715+

payload: { kind: "systemEvent", text: "Reminder: the thing." },

716+

},

717+

}),

718+

).rejects.toThrow("contextMessages must be a non-negative integer");

719+

expect(callGatewayMock).not.toHaveBeenCalled();

720+

},

721+

);

722+
703723

it("does not add context when contextMessages is 0 (default)", async () => {

704724

callGatewayMock.mockResolvedValueOnce({ ok: true });

705725
Original file line numberDiff line numberDiff line change

@@ -11,7 +11,12 @@ import type { DeliveryContext } from "../../utils/delivery-context.shared.js";

1111

import { resolveSessionAgentId } from "../agent-scope.js";

1212

import { optionalStringEnum, stringEnum } from "../schema/typebox.js";

1313

import { CRON_TOOL_DISPLAY_SUMMARY } from "../tool-description-presets.js";

14-

import { type AnyAgentTool, jsonResult, readStringParam } from "./common.js";

14+

import {

15+

type AnyAgentTool,

16+

jsonResult,

17+

readNonNegativeIntegerParam,

18+

readStringParam,

19+

} from "./common.js";

1520

import { callGatewayTool, readGatewayCallOptions, type GatewayCallOptions } from "./gateway.js";

1621

import { resolveInternalSessionKey, resolveMainSessionAlias } from "./sessions-helpers.js";

1722

@@ -301,7 +306,7 @@ export const CronToolSchema = Type.Object(

301306

mode: optionalStringEnum(CRON_WAKE_MODES),

302307

runMode: optionalStringEnum(CRON_RUN_MODES),

303308

contextMessages: Type.Optional(

304-

Type.Number({ minimum: 0, maximum: REMINDER_CONTEXT_MESSAGES_MAX }),

309+

Type.Integer({ minimum: 0, maximum: REMINDER_CONTEXT_MESSAGES_MAX }),

305310

),

306311

agentId: Type.Optional(Type.String({ description: "List filter: agent id" })),

307312

},

@@ -723,10 +728,7 @@ Use jobId canonical; id accepted compat. contextMessages (0-10) adds previous me

723728

}

724729

}

725730
726-

const contextMessages =

727-

typeof params.contextMessages === "number" && Number.isFinite(params.contextMessages)

728-

? params.contextMessages

729-

: 0;

731+

const contextMessages = readNonNegativeIntegerParam(params, "contextMessages") ?? 0;

730732

if (

731733

job &&

732734

typeof job === "object" &&