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

推荐订阅源

V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
罗磊的独立博客
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
雷峰网
雷峰网
V
Visual Studio Blog
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - Franky
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
MongoDB | Blog
MongoDB | 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
fix(cli): reject loose numeric options · openclaw/opencla...
steipete · 2026-05-27 · via Recent Commits to openclaw:main

@@ -38,6 +38,10 @@ import type {

3838

ImageGenerationBackground,

3939

ImageGenerationOutputFormat,

4040

} from "../image-generation/types.js";

41+

import {

42+

parseStrictFiniteNumber,

43+

parseStrictPositiveInteger,

44+

} from "../infra/parse-finite-number.js";

4145

import { buildMediaUnderstandingRegistry } from "../media-understanding/provider-registry.js";

4246

import type { RunMediaUnderstandingFileResult } from "../media-understanding/runtime-types.js";

4347

import {

@@ -1156,13 +1160,24 @@ function parseOptionalFiniteNumber(

11561160

if (raw === undefined || (typeof raw === "string" && raw.trim() === "")) {

11571161

return undefined;

11581162

}

1159-

const value = Number(raw);

1160-

if (!Number.isFinite(value)) {

1163+

const value = parseStrictFiniteNumber(raw);

1164+

if (value === undefined) {

11611165

throw new Error(`${label} must be a finite number`);

11621166

}

11631167

return value;

11641168

}

116511691170+

function parseOptionalPositiveInteger(raw: unknown, label: string): number | undefined {

1171+

if (raw === undefined || (typeof raw === "string" && raw.trim() === "")) {

1172+

return undefined;

1173+

}

1174+

const value = parseStrictPositiveInteger(raw);

1175+

if (value === undefined) {

1176+

throw new Error(`${label} must be a positive integer`);

1177+

}

1178+

return value;

1179+

}

1180+11661181

function normalizeImageOutputFormat(

11671182

raw: string | undefined,

11681183

): ImageGenerationOutputFormat | undefined {

@@ -1933,7 +1948,7 @@ export function registerCapabilityCli(program: Command) {

19331948

capability: "image.generate",

19341949

prompt: String(opts.prompt),

19351950

model: opts.model as string | undefined,

1936-

count: opts.count ? Number.parseInt(String(opts.count), 10) : undefined,

1951+

count: parseOptionalPositiveInteger(opts.count, "--count"),

19371952

size: opts.size as string | undefined,

19381953

aspectRatio: opts.aspectRatio as string | undefined,

19391954

resolution: opts.resolution as "1K" | "2K" | "4K" | undefined,

@@ -2410,7 +2425,7 @@ export function registerCapabilityCli(program: Command) {

24102425

const result = await runWebSearchCommand({

24112426

query: String(opts.query),

24122427

provider: opts.provider as string | undefined,

2413-

limit: opts.limit ? Number.parseInt(String(opts.limit), 10) : undefined,

2428+

limit: parseOptionalPositiveInteger(opts.limit, "--limit"),

24142429

});

24152430

emitJsonOrText(defaultRuntime, Boolean(opts.json), result, formatEnvelopeForText);

24162431

});