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

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
P
Proofpoint News Feed
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
美团技术团队
D
Docker
博客园 - Franky
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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(matrix): validate CLI numeric option ranges · opencla...
rohitjavvadi · 2026-06-14 · via Recent Commits to openclaw:main

@@ -232,7 +232,11 @@ function configureCliLogMode(verbose: boolean): void {

232232

setMatrixSdkConsoleLogging(verbose);

233233

}

234234235-

function parseOptionalInt(value: string | undefined, fieldName: string): number | undefined {

235+

function parseOptionalInt(

236+

value: string | undefined,

237+

fieldName: string,

238+

opts: { min?: number } = {},

239+

): number | undefined {

236240

const trimmed = value?.trim();

237241

if (!trimmed) {

238242

return undefined;

@@ -244,6 +248,13 @@ function parseOptionalInt(value: string | undefined, fieldName: string): number

244248

if (parsed === undefined) {

245249

throw new Error(`${fieldName} must be an integer`);

246250

}

251+

if (opts.min !== undefined && parsed < opts.min) {

252+

throw new Error(

253+

opts.min === 1

254+

? `${fieldName} must be a positive integer`

255+

: `${fieldName} must be a non-negative integer`,

256+

);

257+

}

247258

return parsed;

248259

}

249260

@@ -289,6 +300,9 @@ async function addMatrixAccount(params: {

289300

useEnv?: boolean;

290301

enableEncryption?: boolean;

291302

}): Promise<MatrixCliAccountAddResult> {

303+

const initialSyncLimit = parseOptionalInt(params.initialSyncLimit, "--initial-sync-limit", {

304+

min: 0,

305+

});

292306

const runtime = getMatrixRuntime();

293307

const cfg = runtime.config.current() as CoreConfig;

294308

if (!matrixSetupAdapter.applyAccountConfig) {

@@ -305,7 +319,7 @@ async function addMatrixAccount(params: {

305319

accessToken: params.accessToken,

306320

password: params.password,

307321

deviceName: params.deviceName,

308-

initialSyncLimit: parseOptionalInt(params.initialSyncLimit, "--initial-sync-limit"),

322+

initialSyncLimit,

309323

useEnv: params.useEnv === true,

310324

};

311325

const accountId =

@@ -1159,15 +1173,18 @@ async function runMatrixCliVerificationSummaryCommand(params: {

11591173

async function runMatrixCliSelfVerificationCommand(

11601174

options: MatrixCliSelfVerificationCommandOptions,

11611175

): Promise<void> {

1162-

const { accountId, cfg } = resolveMatrixCliAccountContext(options.account);

1176+

let resolvedAccountId: string | undefined;

11631177

await runMatrixCliCommand({

11641178

verbose: options.verbose === true,

11651179

json: false,

1166-

run: async () =>

1167-

await runMatrixSelfVerification({

1180+

run: async () => {

1181+

const timeoutMs = parseOptionalInt(options.timeoutMs, "--timeout-ms", { min: 1 });

1182+

const { accountId, cfg } = resolveMatrixCliAccountContext(options.account);

1183+

resolvedAccountId = accountId;

1184+

return await runMatrixSelfVerification({

11681185

accountId,

11691186

cfg,

1170-

timeoutMs: parseOptionalInt(options.timeoutMs, "--timeout-ms"),

1187+

timeoutMs,

11711188

onRequested: (summary) => {

11721189

printAccountLabel(accountId);

11731190

printMatrixVerificationSummary(summary);

@@ -1184,7 +1201,8 @@ async function runMatrixCliSelfVerificationCommand(

11841201

console.log("Compare this SAS with the other Matrix client.");

11851202

},

11861203

confirmSas: async () => await promptMatrixVerificationSasMatch(),

1187-

}),

1204+

});

1205+

},

11881206

onText: (summary, verbose) => {

11891207

printMatrixVerificationSummary(summary);

11901208

console.log(`Device verified by owner: ${summary.deviceOwnerVerified ? "yes" : "no"}`);

@@ -1196,6 +1214,7 @@ async function runMatrixCliSelfVerificationCommand(

11961214

console.log("Self-verification complete.");

11971215

},

11981216

onTextError: () => {

1217+

const accountId = resolvedAccountId ?? options.account;

11991218

printGuidance([

12001219

`Run ${formatMatrixCliCommand("verify self", accountId)} again and accept the request in another verified Matrix client for this account.`,

12011220

`Then run ${formatMatrixCliCommand("verify status --verbose", accountId)} to confirm Cross-signing verified: yes and Signed by owner: yes.`,