Skip to content

fix(config): strip UTF-8 BOM from relay config file input#1

Closed
lennney wants to merge 191 commits into
mainfrom
fix/utf8-bom-config
Closed

fix(config): strip UTF-8 BOM from relay config file input#1
lennney wants to merge 191 commits into
mainfrom
fix/utf8-bom-config

Conversation

@lennney

@lennney lennney commented Jul 2, 2026

Copy link
Copy Markdown
Owner

问题

当 config.toml 以 UTF-8 BOM (\u{feff}) 开头时,relay_config_status_from_home() 报告 configured=false

根因

root_key_value() 行解析时 trim() 不去掉 BOM(BOM 不是 ASCII 空白),导致第一行解析为 \u{feff}model_provider = \custom\ 而非 model_provider = \custom\,匹配失败。

修复

apply_relay_config_file_to_home() 入口处 strip BOM 前缀。

let config_contents = config_contents.strip_prefix('\u{feff}').unwrap_or(config_contents);

验证

  • apply_relay_config_file_accepts_utf8_bom_config 测试通过 ✅
  • 1 文件,+2 行

babelllll and others added 30 commits May 27, 2026 10:23
fix: detect standalone Codex installations on Windows

Previously, `resolve_codex_app_dir` only searched in `WindowsApps` for
MS Store versions of Codex. Users who installed Codex via the standalone
installer (which places the executable at
`%LOCALAPPDATA%\OpenAI\Codex\bin\codex.exe`) would get "Codex App
directory not found" errors.

This adds `find_standalone_codex_app_dir()` which searches common
standalone installation paths as a fallback when no MS Store version
is found.

Search order:
1. %LOCALAPPDATA%\OpenAI\Codex\bin\
2. %LOCALAPPDATA%\OpenAI\Codex\
3. %LOCALAPPDATA%\Programs\OpenAI\Codex\

Co-Authored-By: Claude <noreply@anthropic.com>
@
fix: pr-build.yaml ref_name containing a path separator
…w-tool-name-overwrite

fix: 修复中转硅基流动时,Codex提示“unsupported call”问题
…etection

fix: detect standalone Codex installations on Windows
供應商測試時,若 profile 未填 testModel,原本直接回退到全域
relayTestModel(預設 gpt-5.4-mini),導致對非 OpenAI 供應商(如
DeepSeek)發出不存在的模型名而 HTTP 400。

改為三級回退:
  profile.testModel → profile config.toml 的 model= → 全域 relayTestModel

複用既有的 relay_profile_model(改為 pub),並補回歸測試。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fallback

fix(relay-test): 測試模型回退優先用 profile 自身 model
When the process is running, display "已运行 X 小时 Y 分钟" instead of the absolute start time. This makes it easier to see how long Codex has been active at a glance.

新增 formatDuration() 工具函数,LatestLaunch 对运行中的进程动态显示运行时长。
When the polling detects that Codex transitioned from "running" to "stopped" / "failed" unexpectedly, show a notice dialog asking if the user wants to restart.

This improves UX by alerting users when Codex crashes instead of silently showing "stopped" status.

新增崩溃检测:在 refreshOverview 中追踪进程状态变化,检测到意外停止时弹出通知。
Replace implicit system-font/Google Fonts assumption with bundled
font files shipped inside the Tauri binary via @fontsource npm packages.

changes:
- add @fontsource/inter, @fontsource/jetbrains-mono as dependencies
- import both in main.tsx so Vite bundles the woff2 files at build time

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Introduce config ownership modes and write guards so Codex++ and CC Switch no longer silently overwrite each other's ~/.codex config.

- Add config_coordinator module with fingerprint tracking and conflict detection

- Add configOwnership setting (auto / ccSwitch / codexPlusPlus)

- Route linked provider switches through cc-switch database snapshots

- Skip launcher auto-apply when CC Switch owns live config

- Expose coordination status in manager UI
When testing a relay profile, many upstream services (proxies, aggregators) expose their API under a /v1 prefix. Users often omit it from the Base URL, causing a confusing 404 on /responses or /chat/completions.

This patch retries with /v1 appended when the first attempt returns 404 and the Base URL doesn't already end in /v1. If the fallback succeeds, the response includes a hint suggesting the user add /v1 to their Base URL.

Co-Authored-By: Claude <noreply@anthropic.com>
Port the provider preset system from cc-switch (MIT) to Codex++.

## Changes
- New `src/presets.ts`: 20+ provider presets covering OpenAI, DeepSeek, Zhipu GLM, Kimi, Bailian, StepFun, MiniMax, Volcano Ark, SiliconFlow, OpenRouter and more, with correct base URLs, protocols and model lists
- New `src/components/ProviderPresetSelector.tsx`: collapsible UI component that renders presets grouped by category (official, CN official, aggregator, third-party)
- Modified `RelayProfileEditor`: shows preset selector when creating a new profile; selecting a preset fills in name, base URL, protocol, model, test model and model list
- Added CSS styles for the preset selector

When the user creates a new relay profile, they can click '从预设模板创建' to expand the preset grid and pick from curated providers. Selecting a preset auto-fills all relevant fields, reducing manual configuration errors.

Based on cc-switch (MIT) codexProviderPresets.ts by Jason Young.
https://github.com/farion1231/cc-switch

Co-Authored-By: Claude <noreply@anthropic.com>
0xTotoroX and others added 27 commits June 28, 2026 22:18
Fix guard port collisions for multi-user Windows RDP sessions by allowing env overrides and USERNAME-based auto offsets.
Prefer SQLite databases containing the threads table for thread-specific operations, falling back to the previous behavior when no threads database exists.
…llowup

# Conflicts:
#	crates/codex-plus-core/src/assets.rs
# Conflicts:
#	apps/codex-plus-manager/src/App.tsx
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.
@lennney

lennney commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

移到上游 BigPizzaV3#1314

@lennney lennney closed this Jul 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if (currentId === id && path.length > 2) {

P2 Badge Preserve first nested context subtable header

For an existing config that starts an entry with a nested table such as [mcp_servers.foo.env] without a preceding [mcp_servers.foo], this condition is false because currentId is not yet foo, so the parser drops the relative [env] header and then records the following keys as top-level body fields. Saving or migrating that entry rewrites the MCP subtable into the wrong shape.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

&profile.auto_compact_limit,
)?;
let config_with_catalog = apply_model_catalog_to_config(home, profile, &config_with_limits)?;
let config_with_catalog = apply_custom_catalog_fallback(home, &config_with_catalog, profile)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Define the missing catalog fallback helper

This new call prevents codex-plus-core from compiling because apply_custom_catalog_fallback is not defined or imported anywhere in the repository (checked with rg "apply_custom_catalog_fallback"). Any build that includes this crate stops here before relay switching/apply paths can be used.

Useful? React with 👍 / 👎.

Comment on lines +1406 to +1407
if !entries.iter().any(|entry| entry.suffix_window.is_some()) {
return Ok(config_text.to_string());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove stale generated catalog pointers

When a profile already contains this self-generated model_catalog_json and the user later removes all model suffixes/windows, this branch returns the original config unchanged. That leaves Codex loading the old generated catalog, so clearing per-model windows does not actually disable the old context-window settings.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.