From 43634c4ba30b4deb033cbc31bc108173abfccc7f Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Wed, 18 Mar 2026 10:01:01 -0600 Subject: [PATCH] fix: run resource-skew check before early TTY gate The early TTY check blocked the resource-skew detection test which runs gsd with piped stdin. Move exitIfManagedResourcesAreNewer() before the TTY gate so version mismatch errors surface in non-TTY environments. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/cli.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index 55dec9df3..1216af4e5 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -94,6 +94,10 @@ function parseCliArgs(argv: string[]): CliFlags { const cliFlags = parseCliArgs(process.argv) const isPrintMode = cliFlags.print || cliFlags.mode !== undefined +// Early resource-skew check — must run before TTY gate so version mismatch +// errors surface even in non-TTY environments. +exitIfManagedResourcesAreNewer(agentDir) + // Early TTY check — must come before heavy initialization to avoid dangling // handles that prevent process.exit() from completing promptly. const hasSubcommand = cliFlags.messages.length > 0