@@ -10,10 +10,7 @@ import { sanitizeAgentId } from "../../routing/session-key.js";
1010import { defaultRuntime } from "../../runtime.js" ;
1111import type { GatewayRpcOpts } from "../gateway-rpc.js" ;
1212import { addGatewayClientOptions , callGatewayFromCli } from "../gateway-rpc.js" ;
13- import {
14- parsePositiveIntOrUndefined ,
15- parseStrictPositiveIntOrUndefined ,
16- } from "../program/helpers.js" ;
13+ import { parseStrictPositiveIntOrUndefined } from "../program/helpers.js" ;
1714import { resolveCronCreateScheduleFromArgs } from "./schedule-options.js" ;
1815import {
1916 getCronChannelOptions ,
@@ -234,8 +231,19 @@ export function registerCronAddCommand(cron: Command) {
234231 ? opts . outputTimeoutSeconds
235232 : undefined ) ;
236233 const noOutputTimeoutSeconds =
237- parsePositiveIntOrUndefined ( rawNoOutputTimeoutSeconds ) ;
238- const outputMaxBytes = parsePositiveIntOrUndefined ( opts . outputMaxBytes ) ;
234+ parseStrictPositiveIntOrUndefined ( rawNoOutputTimeoutSeconds ) ;
235+ if (
236+ rawNoOutputTimeoutSeconds !== undefined &&
237+ noOutputTimeoutSeconds === undefined
238+ ) {
239+ throw new Error (
240+ "Invalid --no-output-timeout-seconds (must be a positive integer)." ,
241+ ) ;
242+ }
243+ const outputMaxBytes = parseStrictPositiveIntOrUndefined ( opts . outputMaxBytes ) ;
244+ if ( opts . outputMaxBytes !== undefined && outputMaxBytes === undefined ) {
245+ throw new Error ( "Invalid --output-max-bytes (must be a positive integer)." ) ;
246+ }
239247 return {
240248 kind : "command" as const ,
241249 argv : commandArgv ?? [ "sh" , "-lc" , commandShell ?? "" ] ,
0 commit comments