From ce9f9db56a16ee94a8ad889306118d65ffb6cec9 Mon Sep 17 00:00:00 2001 From: lennney <94768569+lennney@users.noreply.github.com> Date: Fri, 3 Jul 2026 00:31:22 +0800 Subject: [PATCH] fix(config): strip UTF-8 BOM from relay config file input When a config file starts with UTF-8 BOM (\u{feff}), the BOM character was not stripped before parsing, causing root_key_value() to fail matching 'model_provider' (it matched '\u{feff}model_provider' instead). This made relay_config_status_from_home() report configured=false. Fix: strip the BOM prefix before processing in apply_relay_config_file_to_home. --- crates/codex-plus-core/src/relay_config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/codex-plus-core/src/relay_config.rs b/crates/codex-plus-core/src/relay_config.rs index fc9e76a4..1011b112 100644 --- a/crates/codex-plus-core/src/relay_config.rs +++ b/crates/codex-plus-core/src/relay_config.rs @@ -447,6 +447,7 @@ pub fn apply_relay_config_file_to_home( home: &Path, config_contents: &str, ) -> anyhow::Result { + let config_contents = config_contents.strip_prefix('\u{feff}').unwrap_or(config_contents); if config_contents.trim().is_empty() { anyhow::bail!("config.toml 内容不能为空"); }