← Back to PRs

#19115: fix(logging): improved redaction for config objects and unquoted keys

by Clawborn open 2026-02-17 11:37 View on GitHub →
size: M trusted-contributor
Config objects and unquoted keys in log output were not being properly redacted, potentially leaking sensitive values. Fix: Improve redaction patterns to handle config objects and unquoted key formats. Recreated from #18287 with only relevant files (3 instead of 20). <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR improves log redaction in two areas and adds dimension mismatch error recovery for the QMD memory manager. - **Redaction improvements** (`src/logging/redact.ts`): Extends JSON field pattern with `privateKey` and `clientSecret`. Adds a new regex for JS-style unquoted keys (e.g., `util.inspect` output). Introduces `redactObject()` for recursively redacting sensitive values in config objects before logging. - **QMD dimension mismatch recovery** (`src/memory/qmd-manager.ts`): Detects embedding dimension mismatch errors during `update`/`embed` and attempts a one-time index reset and retry. Also reorders imports (cosmetic). - **Critical issue**: `resetIndex()` calls `this.close()` which permanently sets `this.closed = true` and clears the periodic update timer, rendering the manager non-functional after the first dimension mismatch repair. Subsequent `runUpdate` calls will silently no-op. <h3>Confidence Score: 2/5</h3> - The redaction changes are safe, but the QMD dimension mismatch repair has a critical bug that will permanently disable the memory manager after the first repair attempt. - The logging/redaction improvements in `redact.ts` are well-implemented and tested. However, `resetIndex()` in `qmd-manager.ts` calls `this.close()` which permanently sets `this.closed = true` and clears the update timer. After a dimension mismatch repair, the manager instance will never process another update, silently breaking memory functionality for the rest of the session. - Pay close attention to `src/memory/qmd-manager.ts` — the `resetIndex()` method permanently disables the manager by calling `close()`. <sub>Last reviewed commit: f02df1d</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs