fix(cli): validate directory limits before resolution · openclaw/openclaw@513a223
steipete
·
2026-05-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -155,6 +155,7 @@ export function registerDirectoryCli(program: Command) {
|
155 | 155 | title: string; |
156 | 156 | emptyMessage: string; |
157 | 157 | }) => { |
| 158 | +const limit = parseLimit(params.opts.limit); |
158 | 159 | const { cfg, channelId, accountId, plugin } = await resolve({ |
159 | 160 | channel: params.opts.channel as string | undefined, |
160 | 161 | account: params.opts.account as string | undefined, |
@@ -170,7 +171,7 @@ export function registerDirectoryCli(program: Command) {
|
170 | 171 | cfg, |
171 | 172 | accountId, |
172 | 173 | query: (params.opts.query as string | undefined) ?? null, |
173 | | -limit: parseLimit(params.opts.limit), |
| 174 | + limit, |
174 | 175 | runtime: defaultRuntime, |
175 | 176 | }); |
176 | 177 | if (params.opts.json) { |
@@ -266,6 +267,7 @@ export function registerDirectoryCli(program: Command) {
|
266 | 267 | .option("--limit <n>", "Limit results") |
267 | 268 | .action(async (opts) => { |
268 | 269 | try { |
| 270 | +const limit = parseLimit(opts.limit); |
269 | 271 | const { cfg, channelId, accountId, plugin } = await resolve({ |
270 | 272 | channel: opts.channel as string | undefined, |
271 | 273 | account: opts.account as string | undefined, |
@@ -282,7 +284,7 @@ export function registerDirectoryCli(program: Command) {
|
282 | 284 | cfg, |
283 | 285 | accountId, |
284 | 286 | groupId, |
285 | | -limit: parseLimit(opts.limit), |
| 287 | + limit, |
286 | 288 | runtime: defaultRuntime, |
287 | 289 | }); |
288 | 290 | if (opts.json) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。