From c275fa3fab03f793fd4c4977199eb02d564d6572 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 22 Jul 2026 12:06:59 -0700 Subject: [PATCH] fix(cli): pre-set GBRAIN_EVAL_CAPTURE/SCRUB_PII env wins over DB stash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The #1475 stash unconditionally overwrote the env vars from the merged DB plane, silently clobbering an operator's exported value — inverting the env-above-config precedence the same code comment advertises. Unlike GBRAIN_EMBEDDING_MULTIMODAL, these keys have no loadConfig() env mapping, so file/env-wins in loadConfigWithEngine never covered them. Guard the stash writes: DB fills the gap only when the env var is unset. Co-Authored-By: Claude Fable 5 --- src/cli.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index dd73d363f..fc40d9d0a 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -2256,10 +2256,14 @@ async function connectEngine(opts?: { probeOnly?: boolean }): Promise