From 7c9beb5829ad97058ca504f25cdc9810877deaee Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Mar 2026 03:48:15 -0700 Subject: [PATCH] fix(gateway): add missing yaml import for PII redaction config read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The privacy.redact_pii config reader on line 1546 used bare 'yaml' which is not in scope — yaml is imported as '_yaml' at module level (line 93) and as '_y' in other methods. The NameError was silently caught by the try/except, so PII redaction never activated even when configured. Add a local 'import yaml as _pii_yaml' consistent with the pattern used elsewhere in the file. --- gateway/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gateway/run.py b/gateway/run.py index b476ae231..91ea86fdb 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -1542,8 +1542,9 @@ class GatewayRunner: # Read privacy.redact_pii from config (re-read per message) _redact_pii = False try: + import yaml as _pii_yaml with open(_config_path, encoding="utf-8") as _pf: - _pcfg = yaml.safe_load(_pf) or {} + _pcfg = _pii_yaml.safe_load(_pf) or {} _redact_pii = bool((_pcfg.get("privacy") or {}).get("redact_pii", False)) except Exception: pass