Input-validation and cache-invalidation gaps surfaced (report-only, not fixed) during the #368 config.ts tier split (PR #493). All predate the split — verbatim. Part of #360.
NaN pass-through (config/env-tier.ts:186,190): AFK_MAX_TOKENS=abc / AFK_TEMPERATURE=abc yield NaN via parseInt/parseFloat with no validation; NaN flows into CliConfig.maxTokens/temperature and wins the merge over defaults.
loadJsonConfig parse-failure fall-through caches the wrong tier permanently (config/json-tier.ts:273-279): a malformed cwd afk.config.json falls through to the user-global file and memoizes THAT — a later fix to the cwd file is invisible until _resetConfigCache()/process restart.
json.systemPrompt truthiness check (config/json-tier.ts:102): uses if (json.systemPrompt) not a typeof guard like its siblings, so a non-string truthy value ({"systemPrompt": 5}) is assigned unvalidated.
_resetConfigCache clears envConfigCache but not the dotenv-loaded flag (facade config.ts:67): after reset, loadEnvConfig re-reads process.env but never re-reads .env files — tests writing new .env fixtures between cases can be silently ignored. (Intentional per comment, but a footgun.)
importFrom cwd-exclusion compares by exact string path (config/json-tier.ts:217): a symlinked/case-variant cwd defeats the project-local exclusion. Defense-in-depth only (real gate is loadImportFromConfig).
Source: PR #493 "Suspected findings."
Input-validation and cache-invalidation gaps surfaced (report-only, not fixed) during the #368
config.tstier split (PR #493). All predate the split — verbatim. Part of #360.NaNpass-through (config/env-tier.ts:186,190):AFK_MAX_TOKENS=abc/AFK_TEMPERATURE=abcyieldNaNviaparseInt/parseFloatwith no validation;NaNflows intoCliConfig.maxTokens/temperatureand wins the merge over defaults.loadJsonConfigparse-failure fall-through caches the wrong tier permanently (config/json-tier.ts:273-279): a malformed cwdafk.config.jsonfalls through to the user-global file and memoizes THAT — a later fix to the cwd file is invisible until_resetConfigCache()/process restart.json.systemPrompttruthiness check (config/json-tier.ts:102): usesif (json.systemPrompt)not atypeofguard like its siblings, so a non-string truthy value ({"systemPrompt": 5}) is assigned unvalidated._resetConfigCacheclearsenvConfigCachebut not the dotenv-loaded flag (facadeconfig.ts:67): after reset,loadEnvConfigre-readsprocess.envbut never re-reads.envfiles — tests writing new.envfixtures between cases can be silently ignored. (Intentional per comment, but a footgun.)importFromcwd-exclusion compares by exact string path (config/json-tier.ts:217): a symlinked/case-variant cwd defeats the project-local exclusion. Defense-in-depth only (real gate isloadImportFromConfig).Source: PR #493 "Suspected findings."