Skip to content

resolveConfig

resolveConfig(partialConfig, commandLineConfigOverrides): GthConfig

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/config/loader.ts:1143

Resolve a fully-merged GthConfig from a partial config + CLI overrides WITHOUT any global side effects. It deep-merges defaults, applies CLI overrides, resolves the numeric consoleLevel (warning + defaulting to INFO on an invalid value), and computes canInterruptInferenceWithEsc and useColour. The process-global setters (setUseColour / setConsoleLevel) are applied separately by mergeConfig, so this function can be reasoned about and reused without touching global state.

It WRITES nothing globally, but it does READ the environment: canInterruptInferenceWithEsc consults stdin’s TTY status, and (CFG-30) useColour consults FORCE_COLOR, NO_COLOR and stdout’s TTY status. So it is deterministic for a given environment rather than a pure function of its arguments — a test that pins a resolved config should declare the terminal and the colour environment it expects in its setup. The ladder itself is a pure helper (resolveUseColour) so it can be tested rung by rung without process globals.

Omit<Partial<GthConfig>, "consoleLevel"> & object

CommandLineConfigOverrides

GthConfig