fix(service): persist CODEX_BIN across background service launches#7
Draft
wetlink wants to merge 1 commit into
Draft
fix(service): persist CODEX_BIN across background service launches#7wetlink wants to merge 1 commit into
wetlink wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Bridge 通過 Codex App Server 的
model/list動態獲取可用模型,因此無需在項目內硬編碼 GPT-5.6。當新版 Codex CLI 僅通過CODEX_BIN指定時,前台運行能正常發現 GPT-5.6,但安裝為後台服務後可能重新使用PATH中的舊版 Codex。這會造成同一台機器上的前台與後台行為不一致:前台可以選擇 GPT-5.6,服務重啟或重新登錄後,模型列表中卻不再出現 GPT-5.6,以及新版 CLI 提供的
max/ultra推理強度。根因
resolveCodexBin()已將CODEX_BIN作為最高優先級的顯式覆蓋,但三個後台服務適配器生成啟動配置時只保留了PATH,沒有跨越服務邊界傳遞CODEX_BIN:修改內容
EnvironmentVariables中寫入經 XML 轉義的CODEX_BINEnvironment="CODEX_BIN=...".cmdset "CODEX_BIN=..."同時在
test/service-definitions.test.ts補充三個平台的專項測試,覆蓋路徑中的空格、反斜線與 XML 特殊字符。行為與兼容性
CODEX_BIN才會寫入服務配置。CODEX_BIN時,生成結果及現有二進制查找順序保持不變。model/list、模型選擇卡或默認模型邏輯。CODEX_BIN>PATH> 私有安裝 > App Bundle 的既有解析優先級。用戶影響
依賴自定義或較新版 Codex 二進制的用戶,在服務重啟、系統重新登錄或後台自動拉起後,仍會使用安裝服務時明確指定的同一個 Codex。模型列表與推理強度因此和前台運行保持一致。
驗證