You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Codex custom models losing their custom system prompt when the generated catalog inherits model_messages from the base model.
Problem
Codeg generates model_catalog_json entries for custom Codex models by cloning the selected base model and then applying user overrides.
When a custom model overrides base_instructions, the generated catalog correctly contains the custom base_instructions, but it may still keep the base model's inherited model_messages.instructions_template.
With Codex CLI 0.145.0, session instructions are rendered from model_messages.instructions_template when it is present. As a result, the custom base_instructions can be bypassed and the session still receives the official base model instructions.
Fix
When a custom model overrides base_instructions and does not explicitly override model_messages, sync model_messages.instructions_template to the same custom prompt.
Also remove inherited comp_hash when instruction-related fields change unless the user explicitly overrides comp_hash.
Explicit model_messages overrides are preserved.
Tests
Added coverage for:
syncing base_instructions into model_messages.instructions_template
preserving explicit model_messages overrides
preserving inherited model_messages and comp_hash when no instruction override is present
Validation
Verified this PR only changes src-tauri/src/acp/codex_model_catalog.rs
git diff --check passed locally
Full Rust test run was not completed locally because the local machine is resource constrained; CI should run the full suite
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
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.
Summary
Fix Codex custom models losing their custom system prompt when the generated catalog inherits
model_messagesfrom the base model.Problem
Codeg generates
model_catalog_jsonentries for custom Codex models by cloning the selected base model and then applying user overrides.When a custom model overrides
base_instructions, the generated catalog correctly contains the custombase_instructions, but it may still keep the base model's inheritedmodel_messages.instructions_template.With Codex CLI 0.145.0, session instructions are rendered from
model_messages.instructions_templatewhen it is present. As a result, the custombase_instructionscan be bypassed and the session still receives the official base model instructions.Fix
When a custom model overrides
base_instructionsand does not explicitly overridemodel_messages, syncmodel_messages.instructions_templateto the same custom prompt.Also remove inherited
comp_hashwhen instruction-related fields change unless the user explicitly overridescomp_hash.Explicit
model_messagesoverrides are preserved.Tests
Added coverage for:
base_instructionsintomodel_messages.instructions_templatemodel_messagesoverridesmodel_messagesandcomp_hashwhen no instruction override is presentValidation
src-tauri/src/acp/codex_model_catalog.rsgit diff --checkpassed locally