From 6c3b13aa27c1c0256ebf70f0eecf5562a62dc75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Fri, 27 Feb 2026 13:39:17 +0300 Subject: [PATCH] fix: remove console.warn that leaks into TUI textbox getConfigContext() emitted a console.warn when called before initConfigContext() completed. Since initConfigContext runs async (spawns opencode --version subprocess), other modules calling getConfigDir/getConfigJson could trigger this warning during startup. The fallback behavior is intentional and safe (defaults to standard CLI paths), but console.warn writes to stderr which the TUI captures, causing the warning to render inside the user's textbox. Fixes #2183 --- src/cli/config-manager/config-context.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cli/config-manager/config-context.ts b/src/cli/config-manager/config-context.ts index 67448f29a..78eb88d77 100644 --- a/src/cli/config-manager/config-context.ts +++ b/src/cli/config-manager/config-context.ts @@ -19,9 +19,6 @@ export function initConfigContext(binary: OpenCodeBinaryType, version: string | export function getConfigContext(): ConfigContext { if (!configContext) { - if (process.env.NODE_ENV !== "production") { - console.warn("[config-context] getConfigContext() called before initConfigContext(); defaulting to CLI paths.") - } const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null }) configContext = { binary: "opencode", version: null, paths } }