Summary
Startup floods the terminal with debug logs (Loading real Pino dependencies, Command not in PATH, Server verification failed, etc.) when the user's environment has NODE_ENV=development. nanocoder is a TUI and should not key its console verbosity off ambient NODE_ENV. Reported in #605.
Root cause
NODE_ENV is the master switch for log verbosity. In development, the default level becomes debug and dev-only log lines are emitted (source/utils/logging/logger-provider.ts:119,148; source/utils/logging/config.ts:42).
- The real Pino logger writes file-only (
source/utils/logging/pino-logger.ts:37-43), but it loads asynchronously. Until it resolves, logging goes through the fallback logger, which writes to console (logger-provider.ts:255-264). The first getLogger() caches this fallback and it is never replaced after Pino loads (logger-provider.ts:144-145), so the console path stays live for the whole session.
- LSP auto-discovery probes ~17 language servers via
where <cmd> and logs each "not installed" result at debug with the full Error object (source/lsp/server-discovery.ts:257,286).
Proposed changes
Acceptance criteria
NODE_ENV=development nanocoder in a dir with no language servers installed shows a clean TUI; the same detail still lands in the log file.
NANOCODER_LOG_LEVEL=debug nanocoder still surfaces debug output (explicit opt-in preserved).
pnpm run test:ava source/utils/logging/pino-logger.spec.ts and pnpm run test:types pass.
Workaround
Unset NODE_ENV (or set it to production) before launching.
Summary
Startup floods the terminal with debug logs (
Loading real Pino dependencies,Command not in PATH,Server verification failed, etc.) when the user's environment hasNODE_ENV=development. nanocoder is a TUI and should not key its console verbosity off ambientNODE_ENV. Reported in #605.Root cause
NODE_ENVis the master switch for log verbosity. Indevelopment, the default level becomesdebugand dev-only log lines are emitted (source/utils/logging/logger-provider.ts:119,148;source/utils/logging/config.ts:42).source/utils/logging/pino-logger.ts:37-43), but it loads asynchronously. Until it resolves, logging goes through the fallback logger, which writes toconsole(logger-provider.ts:255-264). The firstgetLogger()caches this fallback and it is never replaced after Pino loads (logger-provider.ts:144-145), so the console path stays live for the whole session.where <cmd>and logs each "not installed" result atdebugwith the fullErrorobject (source/lsp/server-discovery.ts:257,286).Proposed changes
NODE_ENV. Make the fallback console loggersilentunless an explicit opt-in (NANOCODER_LOG_LEVEL, or a--debugflag) is set. Files:source/utils/logging/logger-provider.ts(getDefaultLogLevel),source/utils/logging/config.ts(getEnvironmentConfig).tracewithout the fullErrordump, or aggregate into a single "N of M language servers found" line (source/lsp/server-discovery.ts).process.stdout.fdproduction destination and contradictory comments inconfig.ts.Acceptance criteria
NODE_ENV=development nanocoderin a dir with no language servers installed shows a clean TUI; the same detail still lands in the log file.NANOCODER_LOG_LEVEL=debug nanocoderstill surfaces debug output (explicit opt-in preserved).pnpm run test:ava source/utils/logging/pino-logger.spec.tsandpnpm run test:typespass.Workaround
Unset
NODE_ENV(or set it toproduction) before launching.