Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(cli): keep the --wait refusal's existing wording prefix (#6625)
time-attacke8037dbf8c45
diff --git a/src/core/cli-options.ts b/src/core/cli-options.tsindex d32c437434..9972016b03 100644--- a/src/core/cli-options.ts+++ b/src/core/cli-options.ts@@ -64,7 +64,7 @@ function parseWaitSeconds(val: string | undefined): number {const seconds = val !== undefined && /^\d+(?:\.\d+)?$/.test(val) ? Number(val) : NaN;if (!Number.isFinite(seconds) || seconds > 600) {throw opError('invalid_params',- `--wait takes a number of seconds from 0 to 600, no units (got ${val === undefined ? 'nothing' : JSON.stringify(val)}).`,+ `--wait requires a number of seconds from 0 to 600, no units (got ${val === undefined ? 'nothing' : JSON.stringify(val)}).`,'Give --wait seconds with no unit, for example --wait 45 or --wait 300 for five minutes.');}return Math.round(seconds * 1000);diff --git a/test/cli-options.test.ts b/test/cli-options.test.tsindex f0da91dbe4..17fed45cbc 100644--- a/test/cli-options.test.ts+++ b/test/cli-options.test.ts@@ -429,7 +429,7 @@ describe('--wait flag (#5232 write wait; #6625 movement owns its own)', () => {const CLI = join(import.meta.dir, '..', 'src', 'cli.ts');const write = spawnSync('bun', [CLI, 'remember', 'x', '--wait', '5m'], { encoding: 'utf-8', env: { ...process.env, NO_COLOR: '1' } });expect(write.status).toBe(2);- expect(write.stderr).toContain('Error [invalid_params]: --wait takes a number of seconds from 0 to 600, no units (got "5m").');+ expect(write.stderr).toContain('Error [invalid_params]: --wait requires a number of seconds from 0 to 600, no units (got "5m").');const movement = spawnSync('bun', [CLI, 'sources', 'writer', 'movement', '--wait', '10x'], { encoding: 'utf-8', env: { ...process.env, NO_COLOR: '1' } });expect(movement.stderr).toContain('--wait must be a positive integer with optional s/m/h suffix');expect(movement.stderr).not.toContain('seconds from 0 to 600');