resolveConfig
resolveConfig(
partialConfig,commandLineConfigOverrides):GthConfig
Defined in: core/dist/config/loader.d.ts:157
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.
Parameters
Section titled “Parameters”partialConfig
Section titled “partialConfig”Omit<Partial<GthConfig>, "consoleLevel"> & object