feat(cli): add --wait-timeout option to run command

Replace hardcoded 10-minute timeout with configurable --wait-timeout.
Default is no limit, matching the wait command behavior. Extracts
parseDuration to shared utils so both run and wait can use it.

Fixes OUTPUT_SCHEMA_FAILED errors when agents take >10 minutes.
This commit is contained in:
Mohamed Boudra
2026-03-15 10:41:06 +07:00
parent 93a3a742ac
commit 22c6df3f85
4 changed files with 70 additions and 46 deletions
+4
View File
@@ -45,6 +45,10 @@ export function createAgentCommand(): Command {
.option('--mode <mode>', 'Provider-specific mode (e.g., plan, default, bypass)')
.option('--cwd <path>', 'Working directory (default: current)')
.option('--label <key=value>', 'Add label(s) to the agent (can be used multiple times)', collectMultiple, [])
.option(
'--wait-timeout <duration>',
'Maximum time to wait for agent to finish (e.g., 30s, 5m, 1h). Default: no limit'
)
.option('--output-schema <schema>', 'Output JSON matching the provided schema file path or inline JSON schema')
).action(withOutput(runRunCommand))