From 15e74692b0ff0d6787cdf7646ecca2522739b34c Mon Sep 17 00:00:00 2001 From: Ariane Emory Date: Fri, 9 Jan 2026 14:31:36 -0500 Subject: [PATCH] fix: report config errors instead of silent termination The yargs .fail() handler was only checking for specific argument errors and silently exiting for all other errors, including invalid config keys. This change re-throws errors so they're caught by the outer error handling logic that properly formats and displays them to users. --- packages/opencode/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index e1c2cbd1d51..6099443e798 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -99,14 +99,16 @@ const cli = yargs(hideBin(process.argv)) .command(GithubCommand) .command(PrCommand) .command(SessionCommand) - .fail((msg) => { + .fail((msg, err) => { if ( msg?.startsWith("Unknown argument") || msg?.startsWith("Not enough non-option arguments") || msg?.startsWith("Invalid values:") ) { + if (err) throw err cli.showHelp("log") } + if (err) throw err process.exit(1) }) .strict()