Skip to content

Commit ed08dc0

Browse files
roodboiclaude
andcommitted
fix(cli): usage-error JSON envelope emits without logger output
Logger backends write to stdout on hosts without gum, corrupting the parseable envelope (caught by CI, invisible on dev machines). The envelope already carries the message. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 99a4b96 commit ed08dc0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/cli/run.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ async function handleRunCliError(opts: {
122122
const { error, jsonRequested } = opts;
123123
if (error instanceof CliUsageError) {
124124
if (jsonRequested) {
125+
// Envelope only: the message is inside it, and logger backends may
126+
// write to stdout on some hosts, corrupting the parseable output.
125127
emitCliResult({
126128
result: errorResult({ code: "E_USAGE", message: error.message }),
127129
});
128-
logger.error({ message: error.message });
129130
return 1;
130131
}
131132
logger.error({ message: error.message });

0 commit comments

Comments
 (0)