fix(codex): P2 - override profile when enable_aibridge=true
The previous fix would skip setting profile when one already existed, breaking enable_aibridge=true with custom base configs. Now when enable_aibridge=true, we explicitly remove any existing profile line and set profile="aibridge" (since enable_aibridge=true is an explicit user intention to use AI Bridge).
This commit is contained in:
parent
46726a903d
commit
9af62366b7
@ -154,15 +154,13 @@ function populate_config_toml() {
|
|||||||
# Set aibridge as default profile when AI Bridge is enabled
|
# Set aibridge as default profile when AI Bridge is enabled
|
||||||
# This allows users to run `codex` without --profile flag
|
# This allows users to run `codex` without --profile flag
|
||||||
if [ "$ARG_ENABLE_AIBRIDGE" = "true" ]; then
|
if [ "$ARG_ENABLE_AIBRIDGE" = "true" ]; then
|
||||||
# Only prepend if profile key doesn't already exist
|
|
||||||
if ! grep -q "^profile\s*=" "$CONFIG_PATH"; then
|
|
||||||
printf "Setting aibridge as default profile\n"
|
printf "Setting aibridge as default profile\n"
|
||||||
|
# Remove any existing profile line from base config (since enable_aibridge=true is explicit)
|
||||||
|
sed -i '/^profile\s*=/d' "$CONFIG_PATH"
|
||||||
|
# Prepend profile = "aibridge" to the config
|
||||||
local temp_config
|
local temp_config
|
||||||
temp_config=$(cat "$CONFIG_PATH")
|
temp_config=$(cat "$CONFIG_PATH")
|
||||||
echo -e "profile = \"aibridge\"\n\n$temp_config" > "$CONFIG_PATH"
|
echo -e "profile = \"aibridge\"\n\n$temp_config" > "$CONFIG_PATH"
|
||||||
else
|
|
||||||
printf "Profile already defined in base config, skipping default profile setup\n"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
append_mcp_servers_section "$CONFIG_PATH"
|
append_mcp_servers_section "$CONFIG_PATH"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user