From 05e82e79d78c220ea2f33c152b3d13ac6a936a96 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 15 Mar 2026 01:33:37 -0700 Subject: [PATCH] Fix silent failure when config keys are missing grep returns exit 1 when a key isn't found in the config file, which kills the script under set -euo pipefail. Added || true to all 4 config-parsing grep lines so missing keys gracefully fall back to defaults. Co-Authored-By: Claude Opus 4.6 --- scripts/query.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/query.sh b/scripts/query.sh index 7336b72..161bed8 100755 --- a/scripts/query.sh +++ b/scripts/query.sh @@ -51,14 +51,14 @@ codex_reasoning_effort="high" gemini_model="gemini-2.5-pro" if [ -f "$config_file" ]; then - val=$(grep '^provider=' "$config_file" | cut -d= -f2- | tr -d '[:space:]') + val=$(grep '^provider=' "$config_file" | cut -d= -f2- | tr -d '[:space:]' || true) [ -n "$val" ] && provider="$val" - val=$(grep '^codex_model=' "$config_file" | cut -d= -f2- | tr -d '[:space:]') + val=$(grep '^codex_model=' "$config_file" | cut -d= -f2- | tr -d '[:space:]' || true) [ -n "$val" ] && codex_model="$val" - val=$(grep '^codex_reasoning_effort=' "$config_file" | cut -d= -f2- | tr -d '[:space:]') + val=$(grep '^codex_reasoning_effort=' "$config_file" | cut -d= -f2- | tr -d '[:space:]' || true) [ -n "$val" ] && codex_reasoning_effort="$val" - val=$(grep '^gemini_model=' "$config_file" | cut -d= -f2- | tr -d '[:space:]') + val=$(grep '^gemini_model=' "$config_file" | cut -d= -f2- | tr -d '[:space:]' || true) [ -n "$val" ] && gemini_model="$val" log "config loaded: provider=$provider"