Eliminato chatgpt_base_url (B)

Da 24a3cfe2: via la chiave chatgpt_base_url e l'URL predefinito https://chatgpt.com/backend-api/
(la chiave resta accettata nei config e ignorata); schemi dell'app-server rigenerati.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-17 12:39:59 +01:00
parent 7effb5ec86
commit 499ee3a939
63 changed files with 160 additions and 532 deletions

View File

@@ -11,7 +11,6 @@ project_doc_fallback_filenames = []
background_terminal_max_timeout = 300000
file_opener = "vscode"
hide_agent_reasoning = false
chatgpt_base_url = "https://chatgpt.com/backend-api/"
project_root_markers = [".git"]
[history]

View File

@@ -159,7 +159,6 @@ pub struct ConfigRequirements {
pub allowed_login_methods: Option<Sourced<Vec<ForcedLoginMethod>>>,
pub allowed_chatgpt_workspaces: Option<Sourced<Vec<String>>>,
pub cli_auth_credentials_store: Option<Sourced<AuthCredentialsStoreMode>>,
pub chatgpt_base_url: Option<Sourced<String>>,
pub sqlite_home: Option<Sourced<AbsolutePathBuf>>,
pub unsafe_enforce_sqlite_journal_mode: Option<Sourced<bool>>,
pub log_dir: Option<Sourced<AbsolutePathBuf>>,
@@ -207,7 +206,6 @@ impl Default for ConfigRequirements {
allowed_login_methods: None,
allowed_chatgpt_workspaces: None,
cli_auth_credentials_store: None,
chatgpt_base_url: None,
sqlite_home: None,
unsafe_enforce_sqlite_journal_mode: None,
log_dir: None,
@@ -1125,6 +1123,7 @@ pub struct ConfigRequirementsToml {
pub allowed_login_methods: Option<Vec<ForcedLoginMethod>>,
pub allowed_chatgpt_workspaces: Option<Vec<String>>,
pub cli_auth_credentials_store: Option<AuthCredentialsStoreMode>,
/// Ignored. Kept so existing requirements files still load.
pub chatgpt_base_url: Option<String>,
pub sqlite_home: Option<AbsolutePathBuf>,
/// Require migration of existing WAL databases on NFS before opening writable pools.
@@ -1331,7 +1330,6 @@ pub struct ConfigRequirementsWithSources {
pub allowed_login_methods: Option<Sourced<Vec<ForcedLoginMethod>>>,
pub allowed_chatgpt_workspaces: Option<Sourced<Vec<String>>>,
pub cli_auth_credentials_store: Option<Sourced<AuthCredentialsStoreMode>>,
pub chatgpt_base_url: Option<Sourced<String>>,
pub sqlite_home: Option<Sourced<AbsolutePathBuf>>,
pub unsafe_enforce_sqlite_journal_mode: Option<Sourced<bool>>,
pub log_dir: Option<Sourced<AbsolutePathBuf>>,
@@ -1488,7 +1486,6 @@ impl ConfigRequirementsWithSources {
allowed_login_methods,
allowed_chatgpt_workspaces,
cli_auth_credentials_store,
chatgpt_base_url,
sqlite_home,
unsafe_enforce_sqlite_journal_mode,
log_dir,
@@ -1582,7 +1579,6 @@ impl ConfigRequirementsWithSources {
allowed_login_methods,
allowed_chatgpt_workspaces,
cli_auth_credentials_store,
chatgpt_base_url,
sqlite_home,
unsafe_enforce_sqlite_journal_mode,
log_dir,
@@ -1635,7 +1631,7 @@ impl ConfigRequirementsWithSources {
allowed_login_methods: allowed_login_methods.map(|sourced| sourced.value),
allowed_chatgpt_workspaces: allowed_chatgpt_workspaces.map(|sourced| sourced.value),
cli_auth_credentials_store: cli_auth_credentials_store.map(|sourced| sourced.value),
chatgpt_base_url: chatgpt_base_url.map(|sourced| sourced.value),
chatgpt_base_url: None,
sqlite_home: sqlite_home.map(|sourced| sourced.value),
unsafe_enforce_sqlite_journal_mode: unsafe_enforce_sqlite_journal_mode
.map(|sourced| sourced.value),
@@ -1751,7 +1747,6 @@ impl ConfigRequirementsToml {
&& self.allowed_login_methods.is_none()
&& self.allowed_chatgpt_workspaces.is_none()
&& self.cli_auth_credentials_store.is_none()
&& self.chatgpt_base_url.is_none()
&& self.sqlite_home.is_none()
&& self.unsafe_enforce_sqlite_journal_mode.is_none()
&& self.log_dir.is_none()
@@ -1862,7 +1857,6 @@ impl ConfigRequirementsToml {
}
apply_exact!(cli_auth_credentials_store);
apply_exact!(chatgpt_base_url);
apply_exact!(sqlite_home);
apply_exact!(log_dir);
if let Some(storage) = self
@@ -1916,7 +1910,7 @@ impl ConfigRequirementsToml {
return Some("model_providers");
}
let otel = self.otel.as_ref();
let managed_fields: [(bool, &[&str], &'static str); 12] = [
let managed_fields: [(bool, &[&str], &'static str); 11] = [
(
self.model_provider.is_some(),
&["model_provider"],
@@ -1952,11 +1946,6 @@ impl ConfigRequirementsToml {
&["cli_auth_credentials_store"],
"cli_auth_credentials_store",
),
(
self.chatgpt_base_url.is_some(),
&["chatgpt_base_url"],
"chatgpt_base_url",
),
(
otel.is_some_and(|otel| otel.tool_result.is_some()),
&["otel", "tool_result"],
@@ -2054,7 +2043,6 @@ impl TryFrom<ConfigRequirementsWithSources> for ConfigRequirements {
allowed_login_methods,
allowed_chatgpt_workspaces,
cli_auth_credentials_store,
chatgpt_base_url,
sqlite_home,
unsafe_enforce_sqlite_journal_mode,
log_dir,
@@ -2448,7 +2436,6 @@ impl TryFrom<ConfigRequirementsWithSources> for ConfigRequirements {
allowed_login_methods,
allowed_chatgpt_workspaces,
cli_auth_credentials_store,
chatgpt_base_url,
sqlite_home,
unsafe_enforce_sqlite_journal_mode,
log_dir,
@@ -2547,7 +2534,6 @@ mod tests {
.expect("managed path should be absolute");
let requirements = ConfigRequirementsToml {
cli_auth_credentials_store: Some(AuthCredentialsStoreMode::Ephemeral),
chatgpt_base_url: Some("https://managed.example/backend-api/".to_string()),
sqlite_home: Some(managed_path.clone()),
log_dir: Some(managed_path.clone()),
model_catalog_json: Some(managed_path),
@@ -2563,7 +2549,6 @@ mod tests {
&["cli_auth_credentials_store"],
Some("cli_auth_credentials_store"),
),
(&["chatgpt_base_url"], Some("chatgpt_base_url")),
(&["sqlite_home"], Some("sqlite_home")),
(&["log_dir"], Some("log_dir")),
(&["model_catalog_json"], Some("model_catalog_json")),
@@ -2691,7 +2676,7 @@ log_sse_deltas = false
allowed_login_methods,
allowed_chatgpt_workspaces,
cli_auth_credentials_store,
chatgpt_base_url,
chatgpt_base_url: _,
sqlite_home,
unsafe_enforce_sqlite_journal_mode,
log_dir,
@@ -2746,8 +2731,6 @@ log_sse_deltas = false
.map(|value| Sourced::new(value, RequirementSource::Unknown)),
cli_auth_credentials_store: cli_auth_credentials_store
.map(|value| Sourced::new(value, RequirementSource::Unknown)),
chatgpt_base_url: chatgpt_base_url
.map(|value| Sourced::new(value, RequirementSource::Unknown)),
sqlite_home: sqlite_home.map(|value| Sourced::new(value, RequirementSource::Unknown)),
unsafe_enforce_sqlite_journal_mode: unsafe_enforce_sqlite_journal_mode
.map(|value| Sourced::new(value, RequirementSource::Unknown)),
@@ -3307,7 +3290,7 @@ log_sse_deltas = false
allowed_login_methods: Some(vec![ForcedLoginMethod::Chatgpt]),
allowed_chatgpt_workspaces: Some(vec!["managed-workspace".to_string()]),
cli_auth_credentials_store: Some(AuthCredentialsStoreMode::Keyring),
chatgpt_base_url: Some("https://managed.example/backend-api/".to_string()),
chatgpt_base_url: None,
sqlite_home: Some(sqlite_home.clone()),
unsafe_enforce_sqlite_journal_mode: Some(true),
log_dir: Some(log_dir.clone()),
@@ -3372,10 +3355,6 @@ log_sse_deltas = false
AuthCredentialsStoreMode::Keyring,
source.clone(),
)),
chatgpt_base_url: Some(Sourced::new(
"https://managed.example/backend-api/".to_string(),
source.clone(),
)),
sqlite_home: Some(Sourced::new(sqlite_home, source.clone())),
unsafe_enforce_sqlite_journal_mode: Some(Sourced::new(
/*value*/ true,

View File

@@ -416,7 +416,8 @@ pub struct ConfigToml {
/// `default`, `priority`, or `flex`; legacy `fast` also works).
pub service_tier: Option<String>,
/// Base URL for requests to ChatGPT (as opposed to the OpenAI API).
/// Ignored. Kept so existing config files still load.
#[schemars(skip)]
pub chatgpt_base_url: Option<String>,
/// Optional product SKU forwarded on host-owned Codex Apps MCP requests.
@@ -1013,6 +1014,25 @@ mod tests {
const WORKSPACE_ID_A: &str = "123e4567-e89b-42d3-a456-426614174000";
const WORKSPACE_ID_B: &str = "123e4567-e89b-42d3-a456-426614174001";
#[test]
fn removed_chatgpt_base_url_key_is_still_accepted() {
let config: ConfigToml = toml::from_str(
r#"
chatgpt_base_url = "https://example.test/backend-api/"
[profiles.work]
chatgpt_base_url = "https://example.test/backend-api/"
"#,
)
.expect("config with the removed key should still load");
assert!(config.profiles.contains_key("work"));
toml::from_str::<crate::ConfigRequirementsToml>(
r#"chatgpt_base_url = "https://example.test/backend-api/""#,
)
.expect("requirements with the removed key should still load");
}
#[test]
fn sandbox_mode_uses_executor_platform_and_sandbox_level() {
use Platform::Linux;

View File

@@ -88,7 +88,6 @@ const DEFAULT_PROGRAM_DATA_DIR_WINDOWS: &str = r"C:\ProgramData";
// config layers.
const PROJECT_LOCAL_CONFIG_DENYLIST: &[&str] = &[
"openai_base_url",
"chatgpt_base_url",
"apps_mcp_product_sku",
"responses_api_metadata",
"model_provider",

View File

@@ -40,6 +40,8 @@ pub struct ConfigProfile {
pub model_catalog_json: Option<AbsolutePathBuf>,
/// Deprecated: `friendly` and `pragmatic` no longer select a style.
pub personality: Option<Personality>,
/// Ignored. Kept so existing config files still load.
#[schemars(skip)]
pub chatgpt_base_url: Option<String>,
/// Optional path to a file containing model instructions.
pub model_instructions_file: Option<AbsolutePathBuf>,

View File

@@ -247,7 +247,7 @@ fn populate_merged_regular_fields_with_sources(
allowed_login_methods,
allowed_chatgpt_workspaces,
cli_auth_credentials_store,
chatgpt_base_url,
chatgpt_base_url: _,
sqlite_home,
unsafe_enforce_sqlite_journal_mode,
log_dir,
@@ -295,7 +295,6 @@ fn populate_merged_regular_fields_with_sources(
set_sourced!(allowed_login_methods, &["allowed_login_methods"]);
set_sourced!(allowed_chatgpt_workspaces, &["allowed_chatgpt_workspaces"]);
set_sourced!(cli_auth_credentials_store, &["cli_auth_credentials_store"]);
set_sourced!(chatgpt_base_url, &["chatgpt_base_url"]);
set_sourced!(sqlite_home, &["sqlite_home"]);
set_sourced!(
unsafe_enforce_sqlite_journal_mode,