diff --git a/akode-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/akode-rs/app-server-protocol/schema/json/akode_app_server_protocol.schemas.json similarity index 99% rename from akode-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json rename to akode-rs/app-server-protocol/schema/json/akode_app_server_protocol.schemas.json index e4e9636f..43961f6f 100644 --- a/akode-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/akode-rs/app-server-protocol/schema/json/akode_app_server_protocol.schemas.json @@ -9215,12 +9215,6 @@ } ] }, - "chatgptBaseUrl": { - "type": [ - "string", - "null" - ] - }, "checkForUpdateOnStartup": { "type": [ "boolean", diff --git a/akode-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/akode-rs/app-server-protocol/schema/json/akode_app_server_protocol.v2.schemas.json similarity index 99% rename from akode-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json rename to akode-rs/app-server-protocol/schema/json/akode_app_server_protocol.v2.schemas.json index 2d28d045..b3004fa1 100644 --- a/akode-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/akode-rs/app-server-protocol/schema/json/akode_app_server_protocol.v2.schemas.json @@ -5203,12 +5203,6 @@ } ] }, - "chatgptBaseUrl": { - "type": [ - "string", - "null" - ] - }, "checkForUpdateOnStartup": { "type": [ "boolean", diff --git a/akode-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json b/akode-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json index 5d83499c..48587d68 100644 --- a/akode-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json +++ b/akode-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json @@ -540,12 +540,6 @@ } ] }, - "chatgptBaseUrl": { - "type": [ - "string", - "null" - ] - }, "checkForUpdateOnStartup": { "type": [ "boolean", diff --git a/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst b/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst index 33e1a720..f73e6f27 100644 Binary files a/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst and b/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst differ diff --git a/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst b/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst index 6ae5bcb3..ac6d18cf 100644 Binary files a/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst and b/akode-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst differ diff --git a/akode-rs/app-server-protocol/schema/typescript/v2/ConfigRequirements.ts b/akode-rs/app-server-protocol/schema/typescript/v2/ConfigRequirements.ts index c9cf1cfe..31af695f 100644 --- a/akode-rs/app-server-protocol/schema/typescript/v2/ConfigRequirements.ts +++ b/akode-rs/app-server-protocol/schema/typescript/v2/ConfigRequirements.ts @@ -28,4 +28,4 @@ modelProviders: { [key in string]?: JsonValue } | null, /** * Effective login methods after managed, forced-login, and workspace restrictions. * An empty list permits no login method. Older servers may omit this field. */ -allowedLoginMethods: Array | null, cliAuthCredentialsStore: CliAuthCredentialsStoreMode | null, chatgptBaseUrl: string | null, additionalDeveloperInstructions: string | null, allowedApprovalPolicies: Array | null, allowedSandboxModes: Array | null, allowedWindowsSandboxImplementations: Array | null, allowedPermissionProfiles: { [key in string]?: boolean } | null, defaultPermissions: string | null, allowedWebSearchModes: Array | null, allowManagedHooksOnly: boolean | null, allowBrowserAndComputerUse: boolean | null, allowAppshots: boolean | null, allowRemoteControl: boolean | null, computerUse: ComputerUseRequirements | null, browserUse: BrowserUseRequirements | null, inAppBrowser: InAppBrowserRequirements | null, featureRequirements: { [key in string]?: boolean } | null, enforceResidency: ResidencyRequirement | null, autoReview: AutoReviewRequirements | null, models: ModelsRequirements | null, sqliteHome: PathUri | null, logDir: PathUri | null, modelCatalogJson: PathUri | null, checkForUpdateOnStartup: boolean | null, allowLoginShell: boolean | null, feedback: FeedbackRequirements | null, otel: OtelRequirements | null}; +allowedLoginMethods: Array | null, cliAuthCredentialsStore: CliAuthCredentialsStoreMode | null, additionalDeveloperInstructions: string | null, allowedApprovalPolicies: Array | null, allowedSandboxModes: Array | null, allowedWindowsSandboxImplementations: Array | null, allowedPermissionProfiles: { [key in string]?: boolean } | null, defaultPermissions: string | null, allowedWebSearchModes: Array | null, allowManagedHooksOnly: boolean | null, allowBrowserAndComputerUse: boolean | null, allowAppshots: boolean | null, allowRemoteControl: boolean | null, computerUse: ComputerUseRequirements | null, browserUse: BrowserUseRequirements | null, inAppBrowser: InAppBrowserRequirements | null, featureRequirements: { [key in string]?: boolean } | null, enforceResidency: ResidencyRequirement | null, autoReview: AutoReviewRequirements | null, models: ModelsRequirements | null, sqliteHome: PathUri | null, logDir: PathUri | null, modelCatalogJson: PathUri | null, checkForUpdateOnStartup: boolean | null, allowLoginShell: boolean | null, feedback: FeedbackRequirements | null, otel: OtelRequirements | null}; diff --git a/akode-rs/app-server-protocol/src/protocol/v2/config.rs b/akode-rs/app-server-protocol/src/protocol/v2/config.rs index 915cb015..de00996c 100644 --- a/akode-rs/app-server-protocol/src/protocol/v2/config.rs +++ b/akode-rs/app-server-protocol/src/protocol/v2/config.rs @@ -400,7 +400,6 @@ pub struct ConfigRequirements { /// An empty list permits no login method. Older servers may omit this field. pub allowed_login_methods: Option>, pub cli_auth_credentials_store: Option, - pub chatgpt_base_url: Option, pub additional_developer_instructions: Option, #[experimental(nested)] pub allowed_approval_policies: Option>, diff --git a/akode-rs/app-server-protocol/src/protocol/v2/tests.rs b/akode-rs/app-server-protocol/src/protocol/v2/tests.rs index 3c02fa15..574ae6d7 100644 --- a/akode-rs/app-server-protocol/src/protocol/v2/tests.rs +++ b/akode-rs/app-server-protocol/src/protocol/v2/tests.rs @@ -2195,7 +2195,6 @@ fn config_requirements_granular_allowed_approval_policy_is_marked_experimental() allowed_login_methods: None, application: None, cli_auth_credentials_store: None, - chatgpt_base_url: None, additional_developer_instructions: None, allowed_approval_policies: Some(vec![AskForApproval::Granular { sandbox_approval: true, diff --git a/akode-rs/app-server-transport/src/transport/remote_control.rs b/akode-rs/app-server-transport/src/transport/remote_control.rs index d42d89dc..e8d7c5b1 100644 --- a/akode-rs/app-server-transport/src/transport/remote_control.rs +++ b/akode-rs/app-server-transport/src/transport/remote_control.rs @@ -31,7 +31,6 @@ use tokio_util::sync::CancellationToken; const REMOTE_CONTROL_REMOVED_MESSAGE: &str = "remote control is not available in this build"; pub struct RemoteControlStartConfig { - pub remote_control_url: String, pub installation_id: String, pub policy: RemoteControlPolicy, } diff --git a/akode-rs/app-server/README.md b/akode-rs/app-server/README.md index 9b945c1b..ec1c8990 100644 --- a/akode-rs/app-server/README.md +++ b/akode-rs/app-server/README.md @@ -562,9 +562,7 @@ The experimental `account/read.workspaceRouting` response field returns the sele App-server discovers routing for saved ChatGPT logins at startup and for new logins or workspace switches. After requirements and routing are ready, it sends the existing `account/updated` notification. Newly initialized connections also receive this notification once saved-workspace routing is ready, including when discovery finished before the connection initialized. Clients then reread `configRequirements/read` and `account/read`. Saved ChatGPT credentials without a selected workspace ID retain their account information and return `workspaceRouting: null`; app-server does not guess a workspace from the backend's default account. Discovery failures for a selected workspace, including missing or null fields from older backends, return an `account/read` error. They never produce a successful unrestricted result. A later read retries failed discovery. Logout clears the cached routing, and results from earlier authentication owners are discarded. Token refreshes for the same known user and workspace invalidate cached routing without cancelling discovery or failing sign-in. Configuration is reloaded after discovery; a changed backend, model provider, or required backend rejects the result so the next read discovers against current configuration. Account notifications recheck the auth owner generation after waiting for outbound queue capacity. Superseded sign-in attempts emit a failed `account/login/completed` event instead of silently dropping completion. Notifications remain snapshots: clients reread current account and requirements state rather than treating a queued notification as authorization. -Routing compares origins by scheme, host, and effective port, ignoring API paths. A required -`chatgpt_base_url` must match discovery; if neither provides an origin, `NO_CONSTRAINT` uses the -configured base URL. +Routing compares origins by scheme, host, and effective port, ignoring API paths. Responses HTTP (including compaction) and WebSockets wait for discovery and preserve API paths. Guardian v2 classifier HTTP and pooled WebSockets use the same routing. diff --git a/akode-rs/app-server/src/application_network_tests.rs b/akode-rs/app-server/src/application_network_tests.rs index e789d36d..9a47a3cb 100644 --- a/akode-rs/app-server/src/application_network_tests.rs +++ b/akode-rs/app-server/src/application_network_tests.rs @@ -36,7 +36,6 @@ async fn embedded_transports_stay_blocked_until_the_same_policy_is_published() - .loader_overrides(overrides.clone()) .build() .await?; - config.chatgpt_base_url = server.uri(); let policy = EmbeddedNetworkPolicy::load(&overrides).await; let application = policy .bind(config.http_client_factory()) diff --git a/akode-rs/app-server/src/in_process_bootstrap.rs b/akode-rs/app-server/src/in_process_bootstrap.rs index 48d0f184..04b0822a 100644 --- a/akode-rs/app-server/src/in_process_bootstrap.rs +++ b/akode-rs/app-server/src/in_process_bootstrap.rs @@ -118,8 +118,6 @@ pub(super) async fn configure( policy_auth_manager.clone() }; let config = Arc::make_mut(config); - config.chatgpt_base_url = policy_config.chatgpt_base_url; - config.chatgpt_base_url_is_explicit = policy_config.chatgpt_base_url_is_explicit; config.enforce_residency = policy_config.enforce_residency; config.application_network_policy = policy_config.application_network_policy; config.application_auth_route_config = policy_config.application_auth_route_config; diff --git a/akode-rs/app-server/src/in_process_bootstrap_tests.rs b/akode-rs/app-server/src/in_process_bootstrap_tests.rs index de8e873a..3ddfd74c 100644 --- a/akode-rs/app-server/src/in_process_bootstrap_tests.rs +++ b/akode-rs/app-server/src/in_process_bootstrap_tests.rs @@ -22,13 +22,6 @@ async fn startup_reloads_the_callers_selected_project() -> anyhow::Result<()> { std::fs::create_dir_all(selected.join(".akode"))?; std::fs::create_dir(selected.join(".git"))?; set_project_trust_level(&home, &selected, TrustLevel::Trusted)?; - let selected_url = "https://selected.example/backend-api/"; - let user_config = home.join("config.toml"); - let trust = std::fs::read_to_string(&user_config)?; - std::fs::write( - &user_config, - format!("chatgpt_base_url = '{selected_url}'\n{trust}"), - )?; let project_config = selected.join(".akode/config.toml"); std::fs::write(&project_config, "model = 'selected-model'")?; let loader_overrides = LoaderOverrides::without_managed_config_for_tests(); @@ -43,7 +36,6 @@ async fn startup_reloads_the_callers_selected_project() -> anyhow::Result<()> { .build() .await?, ); - assert_eq!(config.chatgpt_base_url, selected_url); assert_eq!(config.model.as_deref(), Some("selected-model")); let manager = ConfigManager::new( home, @@ -63,7 +55,6 @@ async fn startup_reloads_the_callers_selected_project() -> anyhow::Result<()> { config.cwd.as_path().canonicalize()?, selected.canonicalize()? ); - assert_eq!(config.chatgpt_base_url, selected_url); std::fs::write(&project_config, "[malformed")?; let error = configure( diff --git a/akode-rs/app-server/src/lib.rs b/akode-rs/app-server/src/lib.rs index c65b7290..dd6cc33f 100644 --- a/akode-rs/app-server/src/lib.rs +++ b/akode-rs/app-server/src/lib.rs @@ -838,7 +838,6 @@ pub async fn run_main_with_transport_options( let (remote_control_accept_handle, remote_control_handle) = start_remote_control( RemoteControlStartConfig { - remote_control_url: config.chatgpt_base_url.clone(), installation_id: installation_id.clone(), policy: remote_control_policy, }, @@ -1473,9 +1472,11 @@ fn test_user_config_file_from_env() -> Option { } fn loader_overrides_with_test_user_config_file( - mut loader_overrides: LoaderOverrides, + loader_overrides: LoaderOverrides, test_user_config_file: Option, ) -> IoResult { + #[cfg(debug_assertions)] + let mut loader_overrides = loader_overrides; #[cfg(debug_assertions)] if let Some(path) = test_user_config_file { let path = AbsolutePathBuf::from_absolute_path(path).map_err(|err| { diff --git a/akode-rs/app-server/src/request_processors/config_processor.rs b/akode-rs/app-server/src/request_processors/config_processor.rs index c7efd8ce..cd7018af 100644 --- a/akode-rs/app-server/src/request_processors/config_processor.rs +++ b/akode-rs/app-server/src/request_processors/config_processor.rs @@ -478,7 +478,6 @@ pub(crate) fn map_requirements_to_api( } }, ), - chatgpt_base_url: requirements.chatgpt_base_url, additional_developer_instructions: requirements.additional_developer_instructions, allowed_approval_policies: requirements.allowed_approval_policies.map(|policies| { policies diff --git a/akode-rs/app-server/tests/common/config.rs b/akode-rs/app-server/tests/common/config.rs index 4a12df36..7e569583 100644 --- a/akode-rs/app-server/tests/common/config.rs +++ b/akode-rs/app-server/tests/common/config.rs @@ -228,16 +228,6 @@ pub fn write_mock_responses_config_toml( config.write(codex_home) } -pub fn write_mock_responses_config_toml_with_chatgpt_base_url( - codex_home: &Path, - server_uri: &str, - chatgpt_base_url: &str, -) -> std::io::Result<()> { - MockResponsesConfig::new(server_uri) - .with_root_config(&format!("chatgpt_base_url = \"{chatgpt_base_url}\"")) - .write(codex_home) -} - #[cfg(test)] #[path = "config_tests.rs"] mod tests; diff --git a/akode-rs/app-server/tests/common/config_tests.rs b/akode-rs/app-server/tests/common/config_tests.rs index 1dbe8392..866dd55b 100644 --- a/akode-rs/app-server/tests/common/config_tests.rs +++ b/akode-rs/app-server/tests/common/config_tests.rs @@ -13,7 +13,7 @@ fn mock_responses_config_composes_model_provider_features_and_extra_tables() { .with_sandbox_mode("workspace-write") .enable_feature(Feature::FastMode) .disable_feature(Feature::ShellSnapshot) - .with_root_config("chatgpt_base_url = \"http://127.0.0.1:1234\"") + .with_root_config("check_for_update_on_startup = false") .with_provider_config("requires_openai_auth = true") .with_extra_config("[extra]\nenabled = true") .write(home.path()) @@ -25,7 +25,7 @@ fn mock_responses_config_composes_model_provider_features_and_extra_tables() { "model = \"custom-model\"", "approval_policy = \"on-request\"", "sandbox_mode = \"workspace-write\"", - "chatgpt_base_url = \"http://127.0.0.1:1234\"", + "check_for_update_on_startup = false", "model_provider = \"openai-custom\"", "shell_snapshot = false", "fast_mode = true", diff --git a/akode-rs/app-server/tests/common/lib.rs b/akode-rs/app-server/tests/common/lib.rs index 5640fb88..ec5ecc74 100644 --- a/akode-rs/app-server/tests/common/lib.rs +++ b/akode-rs/app-server/tests/common/lib.rs @@ -14,7 +14,6 @@ use akode_app_server_protocol::JSONRPCResponse; pub use config::MockResponsesConfig; pub use config::bundled_model_catalog_config; pub use config::write_mock_responses_config_toml; -pub use config::write_mock_responses_config_toml_with_chatgpt_base_url; pub use core_test_support::PathBufExt; pub use core_test_support::format_with_current_shell; pub use core_test_support::format_with_current_shell_display; diff --git a/akode-rs/app-server/tests/common/test_app_server.rs b/akode-rs/app-server/tests/common/test_app_server.rs index e3c0b955..1cfa6a87 100644 --- a/akode-rs/app-server/tests/common/test_app_server.rs +++ b/akode-rs/app-server/tests/common/test_app_server.rs @@ -131,11 +131,6 @@ use core_test_support::test_codex::test_env; use serde::de::DeserializeOwned; use tempfile::TempDir; use tokio::process::Command; -use wiremock::Mock; -use wiremock::MockServer; -use wiremock::ResponseTemplate; -use wiremock::matchers::method; -use wiremock::matchers::path; use crate::json_logging::JsonLogCapture; use crate::local_websocket_exec_server::LocalWebsocketExecServer; @@ -156,7 +151,6 @@ pub struct TestAppServer { // Fields drop in declaration order. Tear down the delayed child before // removing an owned AKODE_HOME that may still be its cwd on Windows. _delayed_exec_server: Option<(LocalWebsocketExecServer, WebsocketDelayInterposer)>, - _attribution_settings_server: Option, _owned_install_dir: Option, _owned_codex_home: Option, } @@ -180,7 +174,6 @@ impl TestAppServer { env_overrides: Vec::new(), args: vec![DISABLE_PLUGIN_STARTUP_TASKS_ARG.to_string()], exec_server_delay: None, - mock_chatgpt_backend: false, } } @@ -344,7 +337,6 @@ impl TestAppServer { auto_env: None, json_logs, _delayed_exec_server: None, - _attribution_settings_server: None, _owned_install_dir: None, _owned_codex_home: None, }) @@ -1804,7 +1796,6 @@ pub struct TestAppServerBuilder { env_overrides: Vec<(String, Option)>, args: Vec, exec_server_delay: Option, - mock_chatgpt_backend: bool, } enum TestAppServerEnvironment { @@ -1813,11 +1804,6 @@ enum TestAppServerEnvironment { } impl TestAppServerBuilder { - pub fn with_mock_chatgpt_backend(mut self) -> Self { - self.mock_chatgpt_backend = true; - self - } - /// Uses this existing AKODE_HOME instead of a temporary one. pub fn with_codex_home(mut self, codex_home: &Path) -> Self { self.codex_home = Some(codex_home.to_path_buf()); @@ -1913,7 +1899,6 @@ impl TestAppServerBuilder { mut env_overrides, args, exec_server_delay, - mock_chatgpt_backend, } = self; let (codex_home, owned_codex_home) = match codex_home { Some(codex_home) => (codex_home, None), @@ -1925,42 +1910,6 @@ impl TestAppServerBuilder { ) } }; - let attribution_settings_server = if mock_chatgpt_backend - || codex_home.join("auth.json").is_file() - { - let config_path = codex_home.join("config.toml"); - let config = std::fs::read_to_string(&config_path)?; - if config - .lines() - .any(|line| line.trim_start().starts_with("chatgpt_base_url")) - { - None - } else { - let settings_server = MockServer::start().await; - Mock::given(method("GET")) - .and(path("/backend-api/wham/config/bundle")) - .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({}))) - .mount(&settings_server) - .await; - Mock::given(method("GET")) - .and(path("/backend-api/wham/settings/user")) - .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ - "commit_attribution_enabled": false, - }))) - .mount(&settings_server) - .await; - std::fs::write( - &config_path, - format!( - "chatgpt_base_url = \"{}/backend-api\"\n{config}", - settings_server.uri() - ), - )?; - Some(settings_server) - } - } else { - None - }; let (auto_env, delayed_exec_server) = match environment { TestAppServerEnvironment::Auto => { let environments_toml = codex_home.join("environments.toml"); @@ -2090,7 +2039,6 @@ impl TestAppServerBuilder { app_server._owned_install_dir = owned_install_dir; app_server._owned_codex_home = owned_codex_home; app_server._delayed_exec_server = delayed_exec_server; - app_server._attribution_settings_server = attribution_settings_server; Ok(app_server) } } diff --git a/akode-rs/app-server/tests/suite/logging.rs b/akode-rs/app-server/tests/suite/logging.rs index e3d82b2b..49c31a46 100644 --- a/akode-rs/app-server/tests/suite/logging.rs +++ b/akode-rs/app-server/tests/suite/logging.rs @@ -219,7 +219,6 @@ async fn credentials_stay_out_of_persisted_and_feedback_logs() -> Result<()> { let codex_home = TempDir::new()?; let server_uri = server.uri(); MockResponsesConfig::new(&server_uri) - .with_root_config(&format!("chatgpt_base_url = \"{server_uri}/backend-api\"")) .with_provider_config("requires_openai_auth = true\nsupports_websockets = false") .with_extra_config(&format!( r#" diff --git a/akode-rs/app-server/tests/suite/v2/account.rs b/akode-rs/app-server/tests/suite/v2/account.rs index 829aa300..7cf885ba 100644 --- a/akode-rs/app-server/tests/suite/v2/account.rs +++ b/akode-rs/app-server/tests/suite/v2/account.rs @@ -38,7 +38,6 @@ struct CreateConfigTomlParams { forced_workspace_ids: Option>, requires_openai_auth: Option, base_url: Option, - chatgpt_base_url: Option, model_provider_id: Option, extra_provider_config: Option, } @@ -70,10 +69,6 @@ fn create_config_toml(codex_home: &Path, params: CreateConfigTomlParams) -> std: Some(false) => String::new(), None => String::new(), }; - let chatgpt_base_url_line = params - .chatgpt_base_url - .map(|url| format!("chatgpt_base_url = \"{url}\"\n")) - .unwrap_or_default(); let model_provider_id = params .model_provider_id .unwrap_or_else(|| "mock_provider".to_string()); @@ -96,7 +91,6 @@ stream_max_retries = 0 model = "mock-model" approval_policy = "never" sandbox_mode = "danger-full-access" -{chatgpt_base_url_line} {forced_line} {forced_workspace_line} @@ -262,13 +256,7 @@ async fn startup_enforces_local_requirements_without_contacting_the_backend( let codex_home = TempDir::new()?; let mock_server = MockServer::start().await; let require_mxc = "[windows]\nrequire_mxc = true\n"; - create_config_toml( - codex_home.path(), - CreateConfigTomlParams { - chatgpt_base_url: Some(format!("{}/backend-api", mock_server.uri())), - ..Default::default() - }, - )?; + create_config_toml(codex_home.path(), CreateConfigTomlParams::default())?; std::fs::write( codex_home.path().join("requirements.toml"), if local_mxc { @@ -367,7 +355,6 @@ async fn login_account_api_key_rejected_when_forced_chatgpt() -> Result<()> { )?; let mut mcp = TestAppServer::builder() - .with_mock_chatgpt_backend() .with_codex_home(codex_home.path()) .without_auto_env() .build_initialized_with_timeout(DEFAULT_READ_TIMEOUT) diff --git a/akode-rs/app-server/tests/suite/v2/application_network.rs b/akode-rs/app-server/tests/suite/v2/application_network.rs index c5085879..114a265d 100644 --- a/akode-rs/app-server/tests/suite/v2/application_network.rs +++ b/akode-rs/app-server/tests/suite/v2/application_network.rs @@ -6,7 +6,6 @@ use akode_app_server_protocol::TurnStatus; use anyhow::Result; use app_test_support::MockResponsesConfig; use app_test_support::TestAppServer; -use app_test_support::write_api_key_auth; use app_test_support::write_models_cache; use core_test_support::streaming_sse::StreamingSseChunk; use core_test_support::streaming_sse::start_streaming_sse_server; @@ -14,51 +13,6 @@ use pretty_assertions::assert_eq; use std::time::Duration; use tempfile::TempDir; use tokio::time::timeout; -use wiremock::Mock; -use wiremock::MockServer; -use wiremock::ResponseTemplate; -use wiremock::matchers::method; -use wiremock::matchers::path; - -#[tokio::test] -async fn standalone_startup_applies_local_policy_before_fetching_stored_account_requirements() --> Result<()> { - let backend = MockServer::start().await; - let bundle_path = "/backend-api/wham/config/bundle"; - Mock::given(method("GET")) - .and(path(bundle_path)) - .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({}))) - .expect(0) - .mount(&backend) - .await; - let home = TempDir::new()?; - std::fs::write( - home.path().join("config.toml"), - format!( - "chatgpt_base_url = '{}/backend-api/'\ncli_auth_credentials_store = 'file'\n", - backend.uri() - ), - )?; - std::fs::write( - home.path().join("requirements.toml"), - "[application.network]", - )?; - write_api_key_auth(home.path())?; - let _app = TestAppServer::builder() - .with_codex_home(home.path()) - .with_env_overrides(&[("OPENAI_API_KEY", None)]) - .build_initialized() - .await?; - assert!( - backend - .received_requests() - .await - .unwrap() - .iter() - .all(|request| request.url.path() != bundle_path) - ); - Ok(()) -} #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn explicit_reloads_apply_local_edits_and_cancel_active_responses() -> Result<()> { diff --git a/akode-rs/app-server/tests/suite/v2/client_metadata.rs b/akode-rs/app-server/tests/suite/v2/client_metadata.rs index 6f6d0e70..27fa6d7f 100644 --- a/akode-rs/app-server/tests/suite/v2/client_metadata.rs +++ b/akode-rs/app-server/tests/suite/v2/client_metadata.rs @@ -334,7 +334,6 @@ async fn turn_start_sends_nested_subagent_lineage_after_cold_thread_resume_v2() let codex_home = TempDir::new()?; MockResponsesConfig::new(&server.uri()) - .with_root_config(&format!("chatgpt_base_url = \"{}\"", server.uri())) .with_provider_config("supports_websockets = false") .write(codex_home.path())?; @@ -445,7 +444,6 @@ async fn turn_steer_updates_client_metadata_on_follow_up_responses_request_v2( responses::mount_response_sequence(&server, vec![first_response, second_response]).await; MockResponsesConfig::new(&server.uri()) - .with_root_config(&format!("chatgpt_base_url = \"{}\"", server.uri())) .with_provider_config("supports_websockets = false") .write(codex_home.path())?; diff --git a/akode-rs/app-server/tests/suite/v2/config_requirements_application.rs b/akode-rs/app-server/tests/suite/v2/config_requirements_application.rs index b27394c6..77bdf54b 100644 --- a/akode-rs/app-server/tests/suite/v2/config_requirements_application.rs +++ b/akode-rs/app-server/tests/suite/v2/config_requirements_application.rs @@ -25,7 +25,7 @@ async fn read_requirements(server: &mut TestAppServer) -> Result { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn application_network_defaults_and_null_base_url_are_exposed() -> Result<()> { +async fn application_network_defaults_are_exposed() -> Result<()> { for (contents, application) in [ ("", Value::Null), ("[application]", json!({"network": null, "storage": null})), @@ -48,13 +48,7 @@ async fn application_network_defaults_and_null_base_url_are_exposed() -> Result< let requirements = wire["requirements"] .as_object() .expect("requirements object"); - assert_eq!( - ( - requirements.get("application"), - requirements.get("chatgptBaseUrl") - ), - (Some(&application), Some(&Value::Null)), - ); + assert_eq!(requirements.get("application"), Some(&application)); } let home = TempDir::new()?; let mut server = start_server(&home).await?; @@ -77,7 +71,6 @@ async fn application_destinations_stay_separate_from_agent_network() -> Result<( home.path().join("requirements.toml"), format!( r#" -chatgpt_base_url = "https://managed.example.com/backend-api/" [{table}.domains] "github.com" = "allow" [application.network.domains] @@ -92,12 +85,10 @@ chatgpt_base_url = "https://managed.example.com/backend-api/" ( &wire["requirements"]["application"], &wire["requirements"]["network"]["domains"], - &wire["requirements"]["chatgptBaseUrl"] ), ( &json!({"network": {"enabled": true, "domains": {"gov.example.com": "allow", "github.com": "deny"}}, "storage": null}), &json!({"github.com": "allow"}), - &json!("https://managed.example.com/backend-api/") ), "{table}" ); diff --git a/akode-rs/app-server/tests/suite/v2/config_rpc.rs b/akode-rs/app-server/tests/suite/v2/config_rpc.rs index be762caa..649a5e6f 100644 --- a/akode-rs/app-server/tests/suite/v2/config_rpc.rs +++ b/akode-rs/app-server/tests/suite/v2/config_rpc.rs @@ -157,17 +157,10 @@ review_domains = ["review.example.com"] #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn managed_auth_settings_are_exposed_enforced_and_read_only() -> Result<()> { let codex_home = TempDir::new()?; - write_config( - &codex_home, - r#"cli_auth_credentials_store = "file" -chatgpt_base_url = "https://user.example/backend-api/" -"#, - )?; + write_config(&codex_home, "cli_auth_credentials_store = \"file\"\n")?; std::fs::write( codex_home.path().join("requirements.toml"), - r#"cli_auth_credentials_store = "ephemeral" -chatgpt_base_url = "https://managed.example/backend-api/" -"#, + "cli_auth_credentials_store = \"ephemeral\"\n", )?; let mut app_server = TestAppServer::builder() .with_codex_home(codex_home.path()) @@ -183,14 +176,8 @@ chatgpt_base_url = "https://managed.example/backend-api/" .await??; let requirements = requirements.requirements.expect("managed requirements"); assert_eq!( - ( - requirements.cli_auth_credentials_store, - requirements.chatgpt_base_url.as_deref(), - ), - ( - Some(CliAuthCredentialsStoreMode::Ephemeral), - Some("https://managed.example/backend-api/"), - ), + requirements.cli_auth_credentials_store, + Some(CliAuthCredentialsStoreMode::Ephemeral), ); let config_id = app_server @@ -202,23 +189,11 @@ chatgpt_base_url = "https://managed.example/backend-api/" let config: ConfigReadResponse = timeout(DEFAULT_READ_TIMEOUT, app_server.read_response(config_id)).await??; assert_eq!( - ( - config.config.additional.get("cli_auth_credentials_store"), - config.config.additional.get("chatgpt_base_url"), - ), - ( - Some(&json!("ephemeral")), - Some(&json!("https://managed.example/backend-api/")), - ), + config.config.additional.get("cli_auth_credentials_store"), + Some(&json!("ephemeral")), ); - for (field, value) in [ - ("cli_auth_credentials_store", json!("file")), - ( - "chatgpt_base_url", - json!("https://user.example/backend-api/"), - ), - ] { + for (field, value) in [("cli_auth_credentials_store", json!("file"))] { let write_id = app_server .send_config_value_write_request(ConfigValueWriteParams { file_path: None, @@ -246,7 +221,7 @@ chatgpt_base_url = "https://managed.example/backend-api/" assert_eq!( std::fs::read_to_string(codex_home.path().join("config.toml"))?, - "cli_auth_credentials_store = \"file\"\nchatgpt_base_url = \"https://user.example/backend-api/\"\n", + "cli_auth_credentials_store = \"file\"\n", ); Ok(()) diff --git a/akode-rs/app-server/tests/suite/v2/external_agent_config.rs b/akode-rs/app-server/tests/suite/v2/external_agent_config.rs index 9ac0a088..78fcdefb 100644 --- a/akode-rs/app-server/tests/suite/v2/external_agent_config.rs +++ b/akode-rs/app-server/tests/suite/v2/external_agent_config.rs @@ -1473,10 +1473,7 @@ async fn external_agent_config_import_reports_session_config_error_subtype() -> .with_env_overrides(&[("HOME", Some(home_dir.as_str()))]) .build_initialized_with_timeout(DEFAULT_TIMEOUT) .await?; - std::fs::write( - codex_home.path().join("config.toml"), - "chatgpt_base_url = [", - )?; + std::fs::write(codex_home.path().join("config.toml"), "model = [")?; let request_id = mcp .send_raw_request( diff --git a/akode-rs/app-server/tests/suite/v2/guardian_v2_model_tests.rs b/akode-rs/app-server/tests/suite/v2/guardian_v2_model_tests.rs index 129e198f..620b17c9 100644 --- a/akode-rs/app-server/tests/suite/v2/guardian_v2_model_tests.rs +++ b/akode-rs/app-server/tests/suite/v2/guardian_v2_model_tests.rs @@ -218,7 +218,6 @@ approvals_reviewer = "auto_review" sandbox_mode = "read-only" cli_auth_credentials_store = "file" model_provider = "openai" -chatgpt_base_url = "{responses_url}/backend-api" [features] guardian_approval = true diff --git a/akode-rs/app-server/tests/suite/v2/hooks_list.rs b/akode-rs/app-server/tests/suite/v2/hooks_list.rs index c953d8c4..dc734f21 100644 --- a/akode-rs/app-server/tests/suite/v2/hooks_list.rs +++ b/akode-rs/app-server/tests/suite/v2/hooks_list.rs @@ -801,10 +801,6 @@ exec "{real_git}" "$@" MockResponsesConfig::new(&server.uri()) .enable_feature(Feature::Plugins) .enable_feature(Feature::CodexHooks) - .with_root_config(&format!( - "chatgpt_base_url = \"{}/backend-api/\"", - server.uri() - )) .with_extra_config(&format!( r#"[plugins."demo@test"] enabled = true diff --git a/akode-rs/app-server/tests/suite/v2/model_list_requirements_tests.rs b/akode-rs/app-server/tests/suite/v2/model_list_requirements_tests.rs index 410141e8..0494a024 100644 --- a/akode-rs/app-server/tests/suite/v2/model_list_requirements_tests.rs +++ b/akode-rs/app-server/tests/suite/v2/model_list_requirements_tests.rs @@ -113,7 +113,6 @@ requires_openai_auth = true format!("model_provider = 'gateway'\n{providers}"), )?; let mut server = TestAppServer::builder() - .with_mock_chatgpt_backend() .with_codex_home(home.path()) .with_env_overrides(&[("OPENAI_API_KEY", None)]) .build_initialized_with_timeout(Duration::from_secs(/*secs*/ 60)) @@ -297,7 +296,6 @@ async fn model_list_reuses_catalog_until_account_change() -> Result<()> { ); std::fs::write(home.path().join("config.toml"), toml::to_string(&config)?)?; let mut server = TestAppServer::builder() - .with_mock_chatgpt_backend() .with_codex_home(home.path()) .with_env_overrides(&[("OPENAI_API_KEY", None)]) .build_initialized() @@ -364,7 +362,6 @@ async fn model_list_preserves_invalid_startup_config_fallback() -> Result<()> { serde_json::to_string(&catalog_path.display().to_string())? ); let mut server = TestAppServer::builder() - .with_mock_chatgpt_backend() .with_args(&["-c", &catalog_override]) .with_codex_home(home.path()) .with_env_overrides(&[("OPENAI_API_KEY", None)]) diff --git a/akode-rs/app-server/tests/suite/v2/plugin_entitlement_metadata.rs b/akode-rs/app-server/tests/suite/v2/plugin_entitlement_metadata.rs index 81777c64..15cee06c 100644 --- a/akode-rs/app-server/tests/suite/v2/plugin_entitlement_metadata.rs +++ b/akode-rs/app-server/tests/suite/v2/plugin_entitlement_metadata.rs @@ -78,10 +78,7 @@ async fn entitlement_access_respects_plugin_provenance(case: AccessCall) -> Resu MockResponsesConfig::new(&server.uri()) .enable_feature(Feature::Plugins) .disable_feature(Feature::Apps) - .with_root_config(&format!( - "chatgpt_base_url = \"{}\"\ncli_auth_credentials_store = \"file\"", - server.uri() - )) + .with_root_config("cli_auth_credentials_store = \"file\"") .with_extra_config(&extra_config) .write(home.path())?; let api_key = matches!(case, AccessCall::ApiKey).then_some("entitlement-test-api-key"); diff --git a/akode-rs/app-server/tests/suite/v2/request_validation.rs b/akode-rs/app-server/tests/suite/v2/request_validation.rs index 48b631e4..6a905e8d 100644 --- a/akode-rs/app-server/tests/suite/v2/request_validation.rs +++ b/akode-rs/app-server/tests/suite/v2/request_validation.rs @@ -14,8 +14,8 @@ use akode_protocol::models::ImageDetail; use akode_protocol::models::ImageReference; use akode_protocol::models::ResponseItem; use anyhow::Result; +use app_test_support::MockResponsesConfig; use app_test_support::TestAppServer; -use app_test_support::write_mock_responses_config_toml_with_chatgpt_base_url; use pretty_assertions::assert_eq; use serde_json::json; use std::time::Duration; @@ -155,11 +155,7 @@ async fn thread_start_keeps_unknown_field_compatibility_with_named_permissions() #[tokio::test] async fn request_handlers_reject_remote_image_urls() -> Result<()> { let codex_home = TempDir::new()?; - write_mock_responses_config_toml_with_chatgpt_base_url( - codex_home.path(), - "http://localhost/unused", - "http://localhost/unused", - )?; + MockResponsesConfig::new("http://localhost/unused").write(codex_home.path())?; let mut mcp = TestAppServer::builder() .with_codex_home(codex_home.path()) .build_initialized_with_timeout(DEFAULT_READ_TIMEOUT) diff --git a/akode-rs/app-server/tests/suite/v2/selected_capability_stack.rs b/akode-rs/app-server/tests/suite/v2/selected_capability_stack.rs index d4e44f6f..6a708918 100644 --- a/akode-rs/app-server/tests/suite/v2/selected_capability_stack.rs +++ b/akode-rs/app-server/tests/suite/v2/selected_capability_stack.rs @@ -17,11 +17,11 @@ use akode_utils_absolute_path::AbsolutePathBuf; use akode_utils_path_uri::PathUri; use anyhow::Context; use anyhow::Result; +use app_test_support::MockResponsesConfig; use app_test_support::TestAppServer; use app_test_support::create_final_assistant_message_sse_response; use app_test_support::to_response; use app_test_support::write_api_key_auth; -use app_test_support::write_mock_responses_config_toml_with_chatgpt_base_url; use core_test_support::process::wait_for_pid_file; use core_test_support::responses; use core_test_support::responses::ResponsesRequest; @@ -72,7 +72,7 @@ async fn selected_plugin_mcp_startup_respects_explicit_mentions( ) -> Result<()> { let explicitly_mentioned = !matches!(mention, PluginMention::Unmentioned); let responses_server = responses::start_mock_server().await; - let fixture = selected_capability_fixture(&responses_server.uri(), &responses_server.uri())?; + let fixture = selected_capability_fixture(&responses_server.uri())?; write_api_key_auth(fixture.codex_home.path())?; let config_path = fixture.codex_home.path().join("config.toml"); let config = std::fs::read_to_string(&config_path)?.replace( @@ -195,16 +195,9 @@ impl SelectedCapabilityFixture { } } -fn selected_capability_fixture( - responses_server_uri: &str, - apps_url: &str, -) -> Result { +fn selected_capability_fixture(responses_server_uri: &str) -> Result { let codex_home = TempDir::new()?; - write_mock_responses_config_toml_with_chatgpt_base_url( - codex_home.path(), - responses_server_uri, - apps_url, - )?; + MockResponsesConfig::new(responses_server_uri).write(codex_home.path())?; let config_path = codex_home.path().join("config.toml"); let config = std::fs::read_to_string(&config_path)?.replacen( "model_provider = \"mock_provider\"", diff --git a/akode-rs/app-server/tests/suite/v2/skills_list.rs b/akode-rs/app-server/tests/suite/v2/skills_list.rs index aaae5692..408bc1cc 100644 --- a/akode-rs/app-server/tests/suite/v2/skills_list.rs +++ b/akode-rs/app-server/tests/suite/v2/skills_list.rs @@ -988,9 +988,7 @@ async fn skills_changed_notification_is_emitted_after_skill_change() -> Result<( let server = create_mock_responses_server_repeating_assistant("Done").await; let codex_home = TempDir::new()?; - MockResponsesConfig::new(&server.uri()) - .with_root_config(&format!("chatgpt_base_url = \"{}\"", server.uri())) - .write(codex_home.path())?; + MockResponsesConfig::new(&server.uri()).write(codex_home.path())?; write_skill(&codex_home, "demo")?; let mut mcp = TestAppServer::builder() diff --git a/akode-rs/app-server/tests/suite/v2/thread_archive.rs b/akode-rs/app-server/tests/suite/v2/thread_archive.rs index 888dcc18..37c5eba6 100644 --- a/akode-rs/app-server/tests/suite/v2/thread_archive.rs +++ b/akode-rs/app-server/tests/suite/v2/thread_archive.rs @@ -280,9 +280,7 @@ async fn thread_archive_shuts_down_resumed_archived_descendant() -> Result<()> { async fn thread_archive_without_turns(history_mode: ThreadHistoryMode) -> Result<()> { let server = create_mock_responses_server_repeating_assistant("Done").await; let codex_home = TempDir::new()?; - MockResponsesConfig::new(&server.uri()) - .with_root_config(&format!(r#"chatgpt_base_url = "{}""#, server.uri())) - .write(codex_home.path())?; + MockResponsesConfig::new(&server.uri()).write(codex_home.path())?; let mut mcp = TestAppServer::builder() .with_codex_home(codex_home.path()) @@ -519,9 +517,7 @@ async fn thread_archive_and_unarchive_spawned_descendants(fail_child_restore: bo async fn thread_archive_succeeds_when_descendant_archive_fails() -> Result<()> { let server = create_mock_responses_server_repeating_assistant("Done").await; let codex_home = TempDir::new()?; - MockResponsesConfig::new(&server.uri()) - .with_root_config(&format!(r#"chatgpt_base_url = "{}""#, server.uri())) - .write(codex_home.path())?; + MockResponsesConfig::new(&server.uri()).write(codex_home.path())?; let parent_id = create_fake_rollout( codex_home.path(), diff --git a/akode-rs/app-server/tests/suite/v2/turn_start.rs b/akode-rs/app-server/tests/suite/v2/turn_start.rs index 7da71204..646e1ada 100644 --- a/akode-rs/app-server/tests/suite/v2/turn_start.rs +++ b/akode-rs/app-server/tests/suite/v2/turn_start.rs @@ -82,7 +82,6 @@ use app_test_support::create_mock_responses_server_sequence; use app_test_support::create_mock_responses_server_sequence_unchecked; use app_test_support::format_with_current_shell_display; use app_test_support::write_api_key_auth; -use app_test_support::write_mock_responses_config_toml_with_chatgpt_base_url; use app_test_support::write_models_cache; use app_test_support::write_models_cache_with_models; use core_test_support::mcp_test_server::CALENDAR_LIST_EVENTS_TOOL_NAME; @@ -535,9 +534,7 @@ async fn turn_start_with_empty_input_runs_model_request() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; - MockResponsesConfig::new(&server.uri()) - .with_root_config(&format!("chatgpt_base_url = \"{}\"", server.uri())) - .write(codex_home.path())?; + MockResponsesConfig::new(&server.uri()).write(codex_home.path())?; let mut mcp = TestAppServer::builder() .with_codex_home(codex_home.path()) @@ -1473,11 +1470,7 @@ async fn turn_start_forwards_trigger_and_source_after_retry() -> Result<()> { .await; let codex_home = TempDir::new()?; - write_mock_responses_config_toml_with_chatgpt_base_url( - codex_home.path(), - &server.uri(), - &server.uri(), - )?; + MockResponsesConfig::new(&server.uri()).write(codex_home.path())?; let config_path = codex_home.path().join("config.toml"); let config = std::fs::read_to_string(&config_path)? .replace("stream_max_retries = 0", "stream_max_retries = 1"); @@ -4022,10 +4015,7 @@ async fn turn_start_emits_spawn_agent_item_with_model_metadata_v2() -> Result<() let codex_home = TempDir::new()?; MockResponsesConfig::new(&server.uri()) .enable_feature(Feature::Collab) - .with_root_config(&format!( - "chatgpt_base_url = \"{}\"\ntools.update_plan.enabled = true", - server.uri() - )) + .with_root_config("tools.update_plan.enabled = true") .write(codex_home.path())?; let mut mcp = TestAppServer::builder() @@ -4245,7 +4235,6 @@ async fn direct_input_to_multi_agent_v2_subagent_is_rejected( MockResponsesConfig::new(&server.uri()) .enable_feature(Feature::MultiAgentV2) .enable_feature(Feature::Goals) - .with_root_config(&format!("chatgpt_base_url = \"{}\"", server.uri())) .write(codex_home.path())?; write_models_cache(codex_home.path()).await?; diff --git a/akode-rs/app-server/tests/suite/v2/turn_steer.rs b/akode-rs/app-server/tests/suite/v2/turn_steer.rs index decf8062..e0bdf12a 100644 --- a/akode-rs/app-server/tests/suite/v2/turn_steer.rs +++ b/akode-rs/app-server/tests/suite/v2/turn_steer.rs @@ -20,12 +20,12 @@ use akode_app_server_protocol::UserInput as V2UserInput; use akode_protocol::user_input::MAX_USER_INPUT_TEXT_CHARS; use anyhow::Context; use anyhow::Result; +use app_test_support::MockResponsesConfig; use app_test_support::TestAppServer; use app_test_support::create_command_execution_sse_response; use app_test_support::create_mock_responses_server_sequence; use app_test_support::create_mock_responses_server_sequence_unchecked; use app_test_support::write_api_key_auth; -use app_test_support::write_mock_responses_config_toml_with_chatgpt_base_url; use core_test_support::skip_if_remote; use pretty_assertions::assert_eq; use serde_json::Value; @@ -42,11 +42,7 @@ async fn turn_steer_requires_active_turn() -> Result<()> { std::fs::create_dir(&codex_home)?; let server = create_mock_responses_server_sequence(vec![]).await; - write_mock_responses_config_toml_with_chatgpt_base_url( - &codex_home, - &server.uri(), - &server.uri(), - )?; + MockResponsesConfig::new(&server.uri()).write(&codex_home)?; write_api_key_auth(&codex_home)?; let mut mcp = TestAppServer::builder() @@ -153,11 +149,7 @@ async fn turn_steer_rejects_oversized_text_input() -> Result<()> { )?, ]) .await; - write_mock_responses_config_toml_with_chatgpt_base_url( - &codex_home, - &server.uri(), - &server.uri(), - )?; + MockResponsesConfig::new(&server.uri()).write(&codex_home)?; write_api_key_auth(&codex_home)?; let mut mcp = TestAppServer::builder() @@ -270,11 +262,7 @@ async fn turn_steer_returns_active_turn_id(tool_outputs: bool) -> Result<()> { app_test_support::create_final_assistant_message_sse_response("Done")?, ]) .await; - write_mock_responses_config_toml_with_chatgpt_base_url( - &codex_home, - &server.uri(), - &server.uri(), - )?; + MockResponsesConfig::new(&server.uri()).write(&codex_home)?; write_api_key_auth(&codex_home)?; let mut mcp = TestAppServer::builder() @@ -441,11 +429,7 @@ async fn turn_steer_rejects_context_only_input_without_merging_context() -> Resu app_test_support::create_final_assistant_message_sse_response("Done")?, ]) .await; - write_mock_responses_config_toml_with_chatgpt_base_url( - &codex_home, - &server.uri(), - &server.uri(), - )?; + MockResponsesConfig::new(&server.uri()).write(&codex_home)?; write_api_key_auth(&codex_home)?; let mut mcp = TestAppServer::builder() diff --git a/akode-rs/cli/tests/worktree.rs b/akode-rs/cli/tests/worktree.rs index 384c2358..bfa8256f 100644 --- a/akode-rs/cli/tests/worktree.rs +++ b/akode-rs/cli/tests/worktree.rs @@ -188,7 +188,6 @@ async fn worktree_start_and_fork(backend: &str) -> anyhow::Result<()> { format!( r#" cli_auth_credentials_store = "file" -chatgpt_base_url = "{}/source/backend-api" check_for_update_on_startup = false features.daemon_auto_start = {} features.mcp_oauth_refresh_coordination = true @@ -208,7 +207,6 @@ trust_level = "trusted" [projects.{}] trust_level = "trusted" "#, - server.uri(), backend == "daemon", server.uri(), serde_json::to_string(&source)?, diff --git a/akode-rs/config/defaults.toml b/akode-rs/config/defaults.toml index b4b0a832..9072c32c 100644 --- a/akode-rs/config/defaults.toml +++ b/akode-rs/config/defaults.toml @@ -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] diff --git a/akode-rs/config/src/config_requirements.rs b/akode-rs/config/src/config_requirements.rs index ff0c28a3..b6f8e45f 100644 --- a/akode-rs/config/src/config_requirements.rs +++ b/akode-rs/config/src/config_requirements.rs @@ -159,7 +159,6 @@ pub struct ConfigRequirements { pub allowed_login_methods: Option>>, pub allowed_chatgpt_workspaces: Option>>, pub cli_auth_credentials_store: Option>, - pub chatgpt_base_url: Option>, pub sqlite_home: Option>, pub unsafe_enforce_sqlite_journal_mode: Option>, pub log_dir: Option>, @@ -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>, pub allowed_chatgpt_workspaces: Option>, pub cli_auth_credentials_store: Option, + /// Ignored. Kept so existing requirements files still load. pub chatgpt_base_url: Option, pub sqlite_home: Option, /// Require migration of existing WAL databases on NFS before opening writable pools. @@ -1331,7 +1330,6 @@ pub struct ConfigRequirementsWithSources { pub allowed_login_methods: Option>>, pub allowed_chatgpt_workspaces: Option>>, pub cli_auth_credentials_store: Option>, - pub chatgpt_base_url: Option>, pub sqlite_home: Option>, pub unsafe_enforce_sqlite_journal_mode: Option>, pub log_dir: Option>, @@ -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 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 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, diff --git a/akode-rs/config/src/config_toml.rs b/akode-rs/config/src/config_toml.rs index f669fd84..76430ba4 100644 --- a/akode-rs/config/src/config_toml.rs +++ b/akode-rs/config/src/config_toml.rs @@ -424,7 +424,8 @@ pub struct ConfigToml { /// `default`, `priority`, or `flex`; legacy `fast` also works). pub service_tier: Option, - /// 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, /// Optional product SKU forwarded on host-owned Codex Apps MCP requests. @@ -1025,6 +1026,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::( + 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; diff --git a/akode-rs/config/src/loader/mod.rs b/akode-rs/config/src/loader/mod.rs index b8a8e47f..9d8194ff 100644 --- a/akode-rs/config/src/loader/mod.rs +++ b/akode-rs/config/src/loader/mod.rs @@ -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", diff --git a/akode-rs/config/src/profile_toml.rs b/akode-rs/config/src/profile_toml.rs index 52da44ac..22653332 100644 --- a/akode-rs/config/src/profile_toml.rs +++ b/akode-rs/config/src/profile_toml.rs @@ -40,6 +40,8 @@ pub struct ConfigProfile { pub model_catalog_json: Option, /// Deprecated: `friendly` and `pragmatic` no longer select a style. pub personality: Option, + /// Ignored. Kept so existing config files still load. + #[schemars(skip)] pub chatgpt_base_url: Option, /// Optional path to a file containing model instructions. pub model_instructions_file: Option, diff --git a/akode-rs/config/src/requirements_layers/stack.rs b/akode-rs/config/src/requirements_layers/stack.rs index 1323bb8c..0b78d72b 100644 --- a/akode-rs/config/src/requirements_layers/stack.rs +++ b/akode-rs/config/src/requirements_layers/stack.rs @@ -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, diff --git a/akode-rs/core/config.schema.json b/akode-rs/core/config.schema.json index e610c94e..2001cb2b 100644 --- a/akode-rs/core/config.schema.json +++ b/akode-rs/core/config.schema.json @@ -750,9 +750,6 @@ "approvals_reviewer": { "$ref": "#/definitions/ApprovalsReviewer" }, - "chatgpt_base_url": { - "type": "string" - }, "experimental_compact_prompt_file": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -7532,10 +7529,6 @@ "browser_use": { "$ref": "#/definitions/BrowserUseConfigToml" }, - "chatgpt_base_url": { - "description": "Base URL for requests to ChatGPT (as opposed to the OpenAI API).", - "type": "string" - }, "check_for_update_on_startup": { "description": "When `true`, checks for Codex updates on startup and surfaces update prompts. Set to `false` only if your Codex updates are centrally managed. Defaults to `true`.", "type": "boolean" diff --git a/akode-rs/core/src/agent/role_tests.rs b/akode-rs/core/src/agent/role_tests.rs index 05d6e840..af306004 100644 --- a/akode-rs/core/src/agent/role_tests.rs +++ b/akode-rs/core/src/agent/role_tests.rs @@ -441,7 +441,6 @@ async fn apply_role_cannot_expand_parent_authority() { r#"developer_instructions = "Stay focused" model = "role-model" openai_base_url = "https://attacker.example/v1" -chatgpt_base_url = "https://attacker.example/backend-api" model_provider = "ollama" approval_policy = "never" sandbox_mode = "danger-full-access" @@ -487,7 +486,6 @@ command = "attacker-command" assert_eq!(config.model_providers, parent.model_providers); assert_eq!(config.approvals_reviewer, parent.approvals_reviewer); assert_eq!(config.mcp_servers, parent.mcp_servers); - assert_eq!(config.chatgpt_base_url, parent.chatgpt_base_url); assert_eq!(config.notify, parent.notify); for feature in [Feature::MemoryTool, Feature::RequestPermissionsTool] { assert!(!config.features.enabled(feature)); @@ -500,7 +498,6 @@ command = "attacker-command" .expect("role should have a projected layer"); for key in [ "openai_base_url", - "chatgpt_base_url", "model_provider", "approval_policy", "sandbox_mode", diff --git a/akode-rs/core/src/compact_remote_v2_installation_tests.rs b/akode-rs/core/src/compact_remote_v2_installation_tests.rs index aa3b9e3c..82efaa8e 100644 --- a/akode-rs/core/src/compact_remote_v2_installation_tests.rs +++ b/akode-rs/core/src/compact_remote_v2_installation_tests.rs @@ -59,7 +59,6 @@ async fn prepared_prefix_rejection_respects_caller_intent( let mut provider = crate::config::test_model_provider_info_with_base_url(None).clone(); provider.base_url = Some(format!("{}/v1", server.uri())); provider.supports_websockets = false; - let server_uri = server.uri(); let (sess, turn, _events) = crate::session::tests::make_session_and_context_with_auth_and_config_and_rx( CodexAuth::from_api_key("Test API Key"), @@ -67,7 +66,6 @@ async fn prepared_prefix_rejection_respects_caller_intent( move |config| { config.model = Some("gpt-5.2".to_string()); config.model_provider = provider; - config.chatgpt_base_url = server_uri; let _ = config.features.disable(Feature::TokenBudget); }, ) diff --git a/akode-rs/core/src/config/auth_keyring_tests.rs b/akode-rs/core/src/config/auth_keyring_tests.rs index 6fd8ba28..6718f04c 100644 --- a/akode-rs/core/src/config/auth_keyring_tests.rs +++ b/akode-rs/core/src/config/auth_keyring_tests.rs @@ -123,20 +123,13 @@ fn managed_auth_restrictions_apply_and_fail_closed() { #[test] fn bootstrap_auth_config_applies_managed_store() { let configured_store = AuthCredentialsStoreMode::File; - let configured_url = "https://user.example/backend-api/"; let managed_store = AuthCredentialsStoreMode::Keyring; - let managed_url = "https://managed.example/backend-api/"; let config_toml = ConfigToml { cli_auth_credentials_store: Some(configured_store), - chatgpt_base_url: Some(configured_url.to_string()), ..Default::default() }; let requirements = ConfigRequirements { cli_auth_credentials_store: Some(Sourced::new(managed_store, RequirementSource::Unknown)), - chatgpt_base_url: Some(Sourced::new( - managed_url.to_string(), - RequirementSource::Unknown, - )), ..Default::default() }; let bootstrap_config = ConfigTomlLoadResult { diff --git a/akode-rs/core/src/config/config_loader_tests.rs b/akode-rs/core/src/config/config_loader_tests.rs index 7f698d94..2230218f 100644 --- a/akode-rs/core/src/config/config_loader_tests.rs +++ b/akode-rs/core/src/config/config_loader_tests.rs @@ -2046,8 +2046,7 @@ auth = ["bearer"]"#, ), ] { let home = tempdir()?; - let source = - format!("openai_base_url = 'https://api.example.test/v1'\n[features]\n{features}\n"); + let source = format!("[features]\n{features}\n"); let configured: ConfigToml = toml::from_str(&source).expect("valid config"); tokio::fs::write(home.path().join(CONFIG_TOML_FILE), source).await?; let config = ConfigBuilder::without_managed_config_for_tests() @@ -2086,10 +2085,6 @@ auth = ["bearer"]"#, .and_then(|network_proxy| network_proxy.credentials.clone()) .unwrap_or_default(); assert_eq!(proxy.credential_providers, expected_providers); - assert_eq!( - proxy.credential_broker_openai_host.as_deref(), - Some("api.example.test") - ); } let active_profile = ActivePermissionProfile { @@ -3928,7 +3923,6 @@ async fn project_layer_ignores_unsupported_config_keys() -> std::io::Result<()> model = "project-model" model_instructions_file = "instructions.md" openai_base_url = "https://attacker.example/v1" -chatgpt_base_url = "https://attacker.example/backend-api" apps_mcp_product_sku = "attacker" responses_api_metadata = { codex_security_surface = "attacker" } model_provider = "attacker" @@ -3992,7 +3986,6 @@ wire_api = "responses" let ignored_project_config_keys = vec![ "openai_base_url", - "chatgpt_base_url", "apps_mcp_product_sku", "responses_api_metadata", "model_provider", diff --git a/akode-rs/core/src/config/config_tests.rs b/akode-rs/core/src/config/config_tests.rs index 94bd94c5..f510cc31 100644 --- a/akode-rs/core/src/config/config_tests.rs +++ b/akode-rs/core/src/config/config_tests.rs @@ -13778,19 +13778,12 @@ exclude_slash_tmp = true Ok(()) } -#[test_case::test_case("https://managed.example/backend-api/"; "custom")] #[tokio::test] -async fn config_applies_managed_auth_store_and_chatgpt_base_url( - managed_url: &str, -) -> std::io::Result<()> { +async fn config_applies_managed_auth_store() -> std::io::Result<()> { let codex_home = TempDir::new()?; let managed_store = AuthCredentialsStoreMode::Keyring; let requirements = akode_config::ConfigRequirements { cli_auth_credentials_store: Some(Sourced::new(managed_store, RequirementSource::Unknown)), - chatgpt_base_url: Some(Sourced::new( - managed_url.to_string(), - RequirementSource::Unknown, - )), ..Default::default() }; let config_layer_stack = ConfigLayerStack::new( @@ -13803,7 +13796,6 @@ async fn config_applies_managed_auth_store_and_chatgpt_base_url( LOCAL_FS.as_ref(), ConfigToml { cli_auth_credentials_store: Some(AuthCredentialsStoreMode::File), - chatgpt_base_url: Some("https://user.example/backend-api/".to_string()), ..Default::default() }, ConfigOverrides { @@ -13816,14 +13808,9 @@ async fn config_applies_managed_auth_store_and_chatgpt_base_url( .await?; assert_eq!(config.cli_auth_credentials_store_mode, managed_store); - assert_eq!(config.chatgpt_base_url, managed_url); - assert!(config.chatgpt_base_url_is_explicit); assert!(config.startup_warnings.iter().any(|warning| { warning.contains("Configured value for `cli_auth_credentials_store` is overridden") })); - assert!(config.startup_warnings.iter().any(|warning| { - warning.contains("Configured value for `chatgpt_base_url` is overridden") - })); Ok(()) } diff --git a/akode-rs/core/src/config/mod.rs b/akode-rs/core/src/config/mod.rs index 9efb309a..820a9aee 100644 --- a/akode-rs/core/src/config/mod.rs +++ b/akode-rs/core/src/config/mod.rs @@ -1146,12 +1146,6 @@ pub struct Config { /// Optional verbosity control for GPT-5 models (Responses API `text.verbosity`). pub model_verbosity: Option, - /// Base URL for requests to ChatGPT (as opposed to the OpenAI API). - pub chatgpt_base_url: String, - - /// Whether configuration or managed requirements explicitly selected the ChatGPT base URL. - pub chatgpt_base_url_is_explicit: bool, - /// Whether Codex-owned clients should respect host system proxy settings. pub respect_system_proxy: bool, @@ -3479,22 +3473,12 @@ impl Config { config_layer_stack.requirements(), &mut startup_warnings, ); - // Packaged defaults supply a URL even when no override was configured. - let chatgpt_base_url_is_explicit = - config_layer_stack.requirements().chatgpt_base_url.is_some() - || config_layer_stack - .layers_high_to_low() - .find(|layer| layer.config.get("chatgpt_base_url").is_some()) - .map_or(cfg.chatgpt_base_url.is_some(), |layer| { - !matches!(layer.name, ConfigLayerSource::PackagedDefaults { .. }) - }); // Destructure every field to ensure ConfigRequirements additions are // either applied above or handled while constructing the final Config. let ConfigRequirements { allowed_login_methods: _, allowed_chatgpt_workspaces: _, cli_auth_credentials_store, - chatgpt_base_url: _, sqlite_home: _, unsafe_enforce_sqlite_journal_mode, log_dir: _, @@ -4001,7 +3985,6 @@ impl Config { feature_enabled: enable_network_proxy, features: cfg.features.as_ref(), candidate_permission_profile: &permission_profile, - credential_broker_base_url: cfg.openai_base_url.as_deref(), }); if cfg.approval_policy == Some(AskForApproval::UnlessTrusted) { return Err(std::io::Error::new( @@ -4771,9 +4754,6 @@ impl Config { model_reasoning_summary: cfg.model_reasoning_summary, model_catalog, model_verbosity: cfg.model_verbosity, - chatgpt_base_url_is_explicit, - // No ChatGPT backend default: empty unless explicitly configured. - chatgpt_base_url: cfg.chatgpt_base_url.unwrap_or_default(), respect_system_proxy, apps_mcp_product_sku: cfg.apps_mcp_product_sku.clone(), responses_api_metadata: cfg.responses_api_metadata.unwrap_or_default(), @@ -5077,7 +5057,6 @@ impl Config { && self.features.enabled(Feature::NetworkProxy), features: cfg.features.as_ref(), candidate_permission_profile: permission_profile, - credential_broker_base_url: cfg.openai_base_url.as_deref(), }); build_network_proxy_spec( prepared_network.configured_proxy, diff --git a/akode-rs/core/src/config/network_config.rs b/akode-rs/core/src/config/network_config.rs index a2ae95fe..0020e460 100644 --- a/akode-rs/core/src/config/network_config.rs +++ b/akode-rs/core/src/config/network_config.rs @@ -78,7 +78,6 @@ pub struct NetworkConfigInputs<'a> { pub feature_enabled: bool, pub features: Option<&'a FeaturesToml>, pub candidate_permission_profile: &'a PermissionProfile, - pub credential_broker_base_url: Option<&'a str>, } /// The configured proxy before managed network requirements are applied. @@ -93,7 +92,6 @@ impl PreparedNetworkConfig { feature_enabled, features, candidate_permission_profile, - credential_broker_base_url, } = inputs; if feature_enabled && candidate_permission_profile @@ -107,7 +105,6 @@ impl PreparedNetworkConfig { } configured_proxy.enabled = true; } - configured_proxy.set_credential_broker_openai_base_url(credential_broker_base_url); Self { configured_proxy } } diff --git a/akode-rs/core/src/config/requirements.rs b/akode-rs/core/src/config/requirements.rs index 92708821..70611795 100644 --- a/akode-rs/core/src/config/requirements.rs +++ b/akode-rs/core/src/config/requirements.rs @@ -31,7 +31,6 @@ pub(super) fn apply_to_config( } apply_exact!(cli_auth_credentials_store); - apply_exact!(chatgpt_base_url); apply_exact!(sqlite_home); apply_exact!(log_dir); apply_exact!(model_catalog_json); diff --git a/akode-rs/core/src/mcp_tool_call_tests.rs b/akode-rs/core/src/mcp_tool_call_tests.rs index 8ac4231a..12b1b64d 100644 --- a/akode-rs/core/src/mcp_tool_call_tests.rs +++ b/akode-rs/core/src/mcp_tool_call_tests.rs @@ -2547,7 +2547,6 @@ async fn approve_mode_skips_guardian_in_every_permission_mode() { .set(approval_policy) .expect("test setup should allow updating approval policy"); let mut config = (*turn_context.config).clone(); - config.chatgpt_base_url = server.uri(); config.model_provider.base_url = Some(format!("{}/v1", server.uri())); config.approvals_reviewer = ApprovalsReviewer::User; let config = Arc::new(config); diff --git a/akode-rs/core/src/session/async_compaction_tests.rs b/akode-rs/core/src/session/async_compaction_tests.rs index b9c27ffe..17950ac2 100644 --- a/akode-rs/core/src/session/async_compaction_tests.rs +++ b/akode-rs/core/src/session/async_compaction_tests.rs @@ -24,7 +24,6 @@ async fn cancelled_turn_skips_launch_but_preserves_existing_work(trigger: Compac let mut provider = crate::config::test_model_provider_info_with_base_url(None).clone(); provider.base_url = Some(format!("{}/v1", server.uri())); provider.supports_websockets = false; - let server_uri = server.uri(); let (sess, mut turn, _events) = crate::session::tests::make_session_and_context_with_auth_and_config_and_rx( CodexAuth::from_api_key("Test API Key"), @@ -35,7 +34,6 @@ async fn cancelled_turn_skips_launch_but_preserves_existing_work(trigger: Compac config.model_auto_compact_token_limit = Some(90_000); config.async_compaction_threshold_percent = 50; config.model_provider = provider; - config.chatgpt_base_url = server_uri; config.features.enable(Feature::AsyncCompaction).unwrap(); config.features.disable(Feature::TokenBudget).unwrap(); }, diff --git a/akode-rs/core/src/session/tests.rs b/akode-rs/core/src/session/tests.rs index 1dd54267..3b5359a5 100644 --- a/akode-rs/core/src/session/tests.rs +++ b/akode-rs/core/src/session/tests.rs @@ -11615,7 +11615,6 @@ async fn make_remote_compaction_session( move |config| { config.model = Some("gpt-5.2".to_string()); config.model_provider = provider; - config.chatgpt_base_url = server_uri.to_string(); let _ = config.features.disable(Feature::TokenBudget); }, ) diff --git a/akode-rs/core/src/shell_snapshot_tests.rs b/akode-rs/core/src/shell_snapshot_tests.rs index 8347e5cf..a97527d1 100644 --- a/akode-rs/core/src/shell_snapshot_tests.rs +++ b/akode-rs/core/src/shell_snapshot_tests.rs @@ -309,6 +309,15 @@ async fn inactive_profiles_keep_snapshots_but_active_brokers_require_sandbox() - ..NetworkProxyConfig::default() }; network_config.set_credential_broker_enabled(/*enabled*/ true); + network_config.credential_providers.insert( + "local".to_string(), + CredentialProviderConfig { + env: vec!["LOCAL_TOKEN".to_string()], + patterns: vec!["local_[a-z]{24}".to_string()], + url_prefixes: vec!["https://public.local-provider.example/v1".to_string()], + ..CredentialProviderConfig::default() + }, + ); let network_spec = NetworkProxySpec::from_config_and_constraints( network_config, /*requirements*/ None, @@ -462,7 +471,7 @@ async fn inactive_profiles_keep_snapshots_but_active_brokers_require_sandbox() - // Identical concurrent captures must not share one command's cancellation. fs::write( dir.path().join(".akode/startup.sh"), - "export OPENAI_API_KEY=sk-snapshot-cache-test\nprintf started > capture-started\nwhile [ ! -f finish-startup ]; do sleep 0.01; done\n", + "export LOCAL_TOKEN=local_snapshotcachetestabcdefg\nprintf started > capture-started\nwhile [ ! -f finish-startup ]; do sleep 0.01; done\n", ) .await?; config.shell_environment_policy.r#set.insert( @@ -590,7 +599,12 @@ async fn inactive_profiles_keep_snapshots_but_active_brokers_require_sandbox() - let original_config = proxy.current_cfg().await?; let mut changed_config = original_config.clone(); - changed_config.set_credential_broker_openai_base_url(Some("https://gateway.example/v1")); + changed_config + .credential_providers + .get_mut("local") + .context("local credential provider")? + .url_prefixes + .push("https://gateway.example/v1".to_string()); for (config, remains_valid) in [ (original_config.clone(), true), (changed_config, false), @@ -625,8 +639,8 @@ async fn inactive_profiles_keep_snapshots_but_active_brokers_require_sandbox() - new_env = context .prepare_child_environment(&proxy, new_env, /*environment_id*/ None)? .env; - assert_ne!(new_env["OPENAI_API_KEY"], old_env["OPENAI_API_KEY"]); - assert_ne!(new_env["OPENAI_API_KEY"], "sk-snapshot-cache-test"); + assert_ne!(new_env["LOCAL_TOKEN"], old_env["LOCAL_TOKEN"]); + assert_ne!(new_env["LOCAL_TOKEN"], "local_snapshotcachetestabcdefg"); // A credential change during capture should recapture once under the new configuration. fs::remove_file(refreshed.path()).await?; @@ -634,7 +648,7 @@ async fn inactive_profiles_keep_snapshots_but_active_brokers_require_sandbox() - fs::remove_file(dir.path().join("capture-started")).await?; fs::write( dir.path().join(".akode/startup.sh"), - "export OPENAI_API_KEY=sk-snapshot-cache-test\nprintf x >> capture-started\nwhile [ ! -f finish-startup ]; do sleep 0.01; done\n", + "export LOCAL_TOKEN=local_snapshotcachetestabcdefg\nprintf x >> capture-started\nwhile [ ! -f finish-startup ]; do sleep 0.01; done\n", ) .await?; let capture = @@ -644,7 +658,12 @@ async fn inactive_profiles_keep_snapshots_but_active_brokers_require_sandbox() - tokio::time::sleep(Duration::from_millis(10)).await; } let mut config = proxy.current_cfg().await?; - config.set_credential_broker_openai_base_url(Some("https://new-gateway.example/v1")); + config + .credential_providers + .get_mut("local") + .context("local credential provider")? + .url_prefixes + .push("https://new-gateway.example/v1".to_string()); proxy .replace_config_state(akode_network_proxy::build_config_state( config, @@ -688,6 +707,15 @@ async fn credential_snapshot_proxy() -> Result Resul declare -rx HOMEBREW_GITHUB_API_TOKEN=\"$GITHUB_TOKEN\"\n\ export GH_ENTERPRISE_TOKEN='ghp_enterprise_secret'\n\ export GH_HOST='attacker.example'\n\ - export OPENAI_API_KEY='sk-proj-snapshot-secret'\n\ + export SNAPSHOT_API_KEY='snapshot_abcdefghijklmnopqrstuvwx'\n\ export STRIPE_API_KEY='stripe_live_abcdefghijklmnopqrstuvwx'\n\ export STRIPE_HOST='https://startup.stripe.example/v1'\n\ export STRIPE_AUTH_HEADER=\"Bearer $STRIPE_API_KEY\"\n\ @@ -755,8 +783,8 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul export LOCAL_AUTH_HEADER=\"Bearer $LOCAL_TOKEN\"\n\ unset LOCAL_TOKEN\n\ export AUTH_BUNDLE=\"GitHub $GH_TOKEN\n\ - OpenAI $OPENAI_API_KEY\"\n\ - export OPENAI_BASE_URL='https://api.snapshot.example/v1'\n\ + Snapshot $SNAPSHOT_API_KEY\"\n\ + export SNAPSHOT_BASE_URL='https://api.snapshot.example/v1'\n\ export IDENTITY_SEEN=\"${OPENAI_IDENTITY_TOKEN_FILE-missing}\"\n\ export EXCLUDED_PARENT_HOME=\"${HOME-missing}\"\n\ export STARTUP_PATH_OVERRIDE_SEEN=\"${PATH%%:*}\"\n\ @@ -837,7 +865,7 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul assert_eq!( captured_credentials .context_env - .get("OPENAI_BASE_URL") + .get("SNAPSHOT_BASE_URL") .map(String::as_str), Some("https://api.snapshot.example/v1") ); @@ -847,7 +875,7 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul "ghp_shell_only_secret", "ghp_readonly_secret", "ghp_enterprise_secret", - "sk-proj-snapshot-secret", + "snapshot_abcdefghijklmnopqrstuvwx", "stripe_live_abcdefghijklmnopqrstuvwx", "pin_abcdefgh", "local_abcdefghijklmnopqrstuvwx", @@ -1054,7 +1082,7 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul ("GH_ENTERPRISE_TOKEN", "ghp_enterprise_secret"), ("GITHUB_ENTERPRISE_TOKEN", "ghp_removed_enterprise_secret"), ("UNSET_AUTH_HEADER", "Bearer ghp_removed_enterprise_secret"), - ("OPENAI_API_KEY", "sk-proj-snapshot-secret"), + ("SNAPSHOT_API_KEY", "snapshot_abcdefghijklmnopqrstuvwx"), ("STRIPE_API_KEY", "stripe_live_abcdefghijklmnopqrstuvwx"), ("STRIPE_HOST", "api.stripe.example"), ("VENDOR_PASSWORD", "pin_abcdefgh"), @@ -1063,7 +1091,7 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul assert_eq!(env.get(key).map(String::as_str), Some(value), "{key}"); } assert_eq!( - env.get("OPENAI_BASE_URL").map(String::as_str), + env.get("SNAPSHOT_BASE_URL").map(String::as_str), Some("https://api.snapshot.example/v1") ); let explicit_vendor_policy = ShellEnvironmentPolicy { @@ -1116,15 +1144,15 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul policy .exclude .push(EnvironmentVariablePattern::new_case_insensitive( - "OPENAI_BASE_URL", + "SNAPSHOT_BASE_URL", )); } let ambient_host = "https://api.ambient.example/v1"; let mut restored_env = - HashMap::from([("OPENAI_BASE_URL".to_string(), ambient_host.to_string())]); + HashMap::from([("SNAPSHOT_BASE_URL".to_string(), ambient_host.to_string())]); let context = snapshot_file.restore_credentials(&mut restored_env, &policy); assert_eq!( - restored_env["OPENAI_BASE_URL"], + restored_env["SNAPSHOT_BASE_URL"], if excluded_context { ambient_host } else { @@ -1134,9 +1162,12 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul restored_env = context .prepare_child_environment(&network_proxy, restored_env, /*environment_id*/ None)? .env; - assert_ne!(restored_env["OPENAI_API_KEY"], "sk-proj-snapshot-secret"); + assert_ne!( + restored_env["SNAPSHOT_API_KEY"], + "snapshot_abcdefghijklmnopqrstuvwx" + ); assert_eq!( - restored_env["OPENAI_BASE_URL"], + restored_env["SNAPSHOT_BASE_URL"], if excluded_context { ambient_host } else { @@ -1192,7 +1223,7 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul assert!(unbrokered_replay.status.success()); assert_eq!( String::from_utf8(unbrokered_replay.stdout)?, - "Bearer ghp_shell_only_secret\nGitHub ghp_shell_only_secret\nOpenAI sk-proj-snapshot-secret" + "Bearer ghp_shell_only_secret\nGitHub ghp_shell_only_secret\nSnapshot snapshot_abcdefghijklmnopqrstuvwx" ); let mut cleared_local_context = HashMap::from([ @@ -1217,7 +1248,7 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul assert_ne!(env["GH_TOKEN"], "ghp_shell_only_secret"); assert_ne!(env["GITHUB_TOKEN"], "ghp_readonly_secret"); assert_ne!(env["GH_ENTERPRISE_TOKEN"], "ghp_enterprise_secret"); - assert_ne!(env["OPENAI_API_KEY"], "sk-proj-snapshot-secret"); + assert_ne!(env["SNAPSHOT_API_KEY"], "snapshot_abcdefghijklmnopqrstuvwx"); assert_ne!( env["STRIPE_API_KEY"], "stripe_live_abcdefghijklmnopqrstuvwx" @@ -1251,11 +1282,11 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul assert_eq!( String::from_utf8(replay.stdout)?, format!( - "{}\nBearer {}\nGitHub {}\nOpenAI {}\n{}\n{}\nmissing\nBearer local_abcdefghijklmnopqrstuvwx", + "{}\nBearer {}\nGitHub {}\nSnapshot {}\n{}\n{}\nmissing\nBearer local_abcdefghijklmnopqrstuvwx", env["GITHUB_TOKEN"], env["GH_TOKEN"], env["GH_TOKEN"], - env["OPENAI_API_KEY"], + env["SNAPSHOT_API_KEY"], env["VENDOR_PASSWORD"], env["VENDOR_HOST"] ) @@ -1283,9 +1314,9 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul }, allow_login_shell: false, }; - for (github_token, openai_api_key) in [ - ("ghp_shell_only_secret", "sk-proj-snapshot-secret"), - (env["GH_TOKEN"].as_str(), env["OPENAI_API_KEY"].as_str()), + for (github_token, snapshot_api_key) in [ + ("ghp_shell_only_secret", "snapshot_abcdefghijklmnopqrstuvwx"), + (env["GH_TOKEN"].as_str(), env["SNAPSHOT_API_KEY"].as_str()), ] { std::fs::write( &startup, @@ -1293,10 +1324,10 @@ async fn snapshot_discovers_and_redacts_shell_initialized_credentials() -> Resul "export GH_TOKEN='{github_token}'\n\ export GITHUB_TOKEN=\"$GH_TOKEN\"\n\ export AUTH_HEADER=\"Bearer $GH_TOKEN\"\n\ - export OPENAI_API_KEY='{openai_api_key}'\n\ + export SNAPSHOT_API_KEY='{snapshot_api_key}'\n\ export AUTH_BUNDLE=\"GitHub $GH_TOKEN\n\ - OpenAI $OPENAI_API_KEY\"\n\ - unset OPENAI_API_KEY\n" + Snapshot $SNAPSHOT_API_KEY\"\n\ + unset SNAPSHOT_API_KEY\n" ), )?; let partially_filtered_path = dir.path().join("partially-filtered-snapshot.sh").abs(); diff --git a/akode-rs/core/tests/suite/injected_models_cache.rs b/akode-rs/core/tests/suite/injected_models_cache.rs index 3b222e9c..a20f3641 100644 --- a/akode-rs/core/tests/suite/injected_models_cache.rs +++ b/akode-rs/core/tests/suite/injected_models_cache.rs @@ -213,8 +213,6 @@ async fn run_agent_with_model(models_manager: SharedModelsManager, model_slug: & .features .enable(akode_features::Feature::RuntimeAgentInstances) .expect("test config should allow enabling runtime auth"); - // Model inference uses a third-party fixture; a custom ChatGPT base must not block startup. - config.chatgpt_base_url = "https://custom.example.test/backend-api".to_string(); }); let test = builder.build(&server).await?; let available_models = test diff --git a/akode-rs/core/tests/suite/plugin_entitlement_metadata.rs b/akode-rs/core/tests/suite/plugin_entitlement_metadata.rs index aca2ff8e..758e3769 100644 --- a/akode-rs/core/tests/suite/plugin_entitlement_metadata.rs +++ b/akode-rs/core/tests/suite/plugin_entitlement_metadata.rs @@ -138,11 +138,7 @@ async fn entitlement_metadata_follows_the_actual_plugin_call(case: AccessCase) - } else { CodexAuth::from_api_key("Test API Key") }; - let base_url = server.uri(); - let mut builder = test_codex() - .with_home(home) - .with_auth(auth) - .with_config(move |config| config.chatgpt_base_url = base_url); + let mut builder = test_codex().with_home(home).with_auth(auth); if let Some(remote_url) = &remote_url { builder = builder.with_exec_server_url(remote_url.clone()); } diff --git a/akode-rs/core/tests/suite/plugins.rs b/akode-rs/core/tests/suite/plugins.rs index 5d0530ff..dcd338a1 100644 --- a/akode-rs/core/tests/suite/plugins.rs +++ b/akode-rs/core/tests/suite/plugins.rs @@ -315,12 +315,10 @@ async fn legacy_remote_marketplace_plugin_commands_are_not_attributed() -> Resul ) .await; - let chatgpt_base_url = server.uri(); let mut builder = builder .with_home(Arc::clone(&codex_home)) .with_catalog_discovery_api_key() - .with_model("gpt-5.2") - .with_config(move |config| config.chatgpt_base_url = chatgpt_base_url); + .with_model("gpt-5.2"); let test_codex = builder.build_with_auto_env(&server).await?; let codex = Arc::clone(&test_codex.codex); let cwd = test_codex.config.cwd.clone(); diff --git a/akode-rs/core/tests/suite/reasoning_effort_override.rs b/akode-rs/core/tests/suite/reasoning_effort_override.rs index eba5fbdb..08e22c5d 100644 --- a/akode-rs/core/tests/suite/reasoning_effort_override.rs +++ b/akode-rs/core/tests/suite/reasoning_effort_override.rs @@ -1316,13 +1316,11 @@ async fn reasoning_effort_override_unavailable_recovers_saved_history( matches!(event, EventMsg::TurnComplete(_)) }) .await; - let chatgpt_base_url = format!("{}/backend-api", server.uri()); let mut builder = unavailable .builder() .with_auth(CodexAuth::from_api_key("Test API Key")) .with_config(move |config| { config.model_reasoning_effort = Some(ReasoningEffort::High); - config.chatgpt_base_url = chatgpt_base_url; }); if let Some(url) = initial.executor_environment().exec_server_url() { builder = builder.with_exec_server_url(url); @@ -1671,7 +1669,6 @@ async fn reasoning_effort_override_compaction_fallback_uses_each_models_effort() responses::sse(vec![responses::ev_completed("after")]), ) .await; - let chatgpt_base_url = format!("{}/backend-api", server.uri()); let test = override_builder() .with_auth(CodexAuth::from_api_key("Test API Key")) .with_model_info_override("gpt-5.4", |model| { @@ -1684,7 +1681,6 @@ async fn reasoning_effort_override_compaction_fallback_uses_each_models_effort() }) .with_model("gpt-5.4") .with_config(move |config| { - config.chatgpt_base_url = chatgpt_base_url; config.model_provider.stream_max_retries = Some(0); }) .build_with_auto_env(&server) diff --git a/akode-rs/core/tests/suite/rmcp_client.rs b/akode-rs/core/tests/suite/rmcp_client.rs index 95eda41d..bf27fa47 100644 --- a/akode-rs/core/tests/suite/rmcp_client.rs +++ b/akode-rs/core/tests/suite/rmcp_client.rs @@ -4450,12 +4450,10 @@ async fn streamable_http_chatgpt_auth_is_not_sent_to_configured_origin() -> anyh let untrusted_server = MockServer::start().await; let untrusted_apps = McpTestServer::mount(&untrusted_server).await?; let untrusted_mcp_url = format!("{}/mcp", untrusted_apps.base_url); - let untrusted_chatgpt_base_url = untrusted_apps.base_url; let fixture = test_codex() .with_auth(CodexAuth::from_api_key("Test API Key")) .with_config(move |config| { - config.chatgpt_base_url = untrusted_chatgpt_base_url; insert_mcp_server( config, "untrusted_origin", @@ -4506,67 +4504,6 @@ async fn streamable_http_chatgpt_auth_is_not_sent_to_configured_origin() -> anyh Ok(()) } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] -async fn configured_chatgpt_base_url_does_not_grant_mcp_chatgpt_auth() -> anyhow::Result<()> { - skip_if_no_network!(Ok(())); - - let server = responses::start_mock_server().await; - let untrusted_server = MockServer::start().await; - let untrusted_apps = McpTestServer::mount(&untrusted_server).await?; - let untrusted_mcp_url = format!("{}/mcp", untrusted_apps.base_url); - let untrusted_chatgpt_base_url = untrusted_apps.base_url; - - let fixture = test_codex() - .with_auth(CodexAuth::from_api_key("Test API Key")) - .with_pre_build_hook(move |codex_home| { - fs::write( - codex_home.join("config.toml"), - format!( - r#" -chatgpt_base_url = "{untrusted_chatgpt_base_url}" - -[mcp_servers.untrusted_origin] -url = "{untrusted_mcp_url}" -auth = "chatgpt" -"#, - ), - ) - .expect("write attacker-controlled MCP config"); - }) - .build(&server) - .await?; - - wait_for_mcp_server(&fixture.codex, "untrusted_origin").await?; - let observed_requests = untrusted_server - .received_requests() - .await - .expect("mock server should capture MCP startup requests") - .into_iter() - .filter(|request| request.url.path() == "/mcp") - .filter_map(|request| { - let body: Value = serde_json::from_slice(&request.body).ok()?; - let method = body.get("method")?.as_str()?.to_string(); - let authorization = request - .headers - .get("authorization") - .and_then(|value| value.to_str().ok()) - .map(str::to_string); - Some((method, authorization)) - }) - .collect::>(); - - assert_eq!( - observed_requests, - vec![ - ("initialize".to_string(), None), - ("notifications/initialized".to_string(), None), - ("tools/list".to_string(), None), - ], - ); - - Ok(()) -} - /// This test writes to a fallback credentials file in AKODE_HOME. /// Ideally, we wouldn't need to serialize the test but it's much more cumbersome to wire AKODE_HOME through the code. #[test] diff --git a/akode-rs/core/tests/suite/skills_extension.rs b/akode-rs/core/tests/suite/skills_extension.rs index eb878355..546bda81 100644 --- a/akode-rs/core/tests/suite/skills_extension.rs +++ b/akode-rs/core/tests/suite/skills_extension.rs @@ -2486,14 +2486,12 @@ async fn executor_skill_invocation_is_environment_scoped_and_deduplicated() -> R .await; let (extensions, _) = catalog_extensions(catalog, /*include_host_provider*/ false); - let chatgpt_base_url = server.uri(); let mut builder = test_codex() .with_home(codex_home) .with_auth(CodexAuth::from_api_key("Test API Key")) .with_extensions(extensions) .with_config(move |config| { configure_catalog_test(config); - config.chatgpt_base_url = chatgpt_base_url; }); let test = builder.build_with_auto_env(&server).await?; test.submit_turn("Read the executor skill twice.").await?; diff --git a/akode-rs/thread-manager-sample/src/main.rs b/akode-rs/thread-manager-sample/src/main.rs index 73e46f0f..c1562491 100644 --- a/akode-rs/thread-manager-sample/src/main.rs +++ b/akode-rs/thread-manager-sample/src/main.rs @@ -357,8 +357,6 @@ async fn new_config( model_reasoning_summary: None, model_catalog: None, model_verbosity: None, - chatgpt_base_url: String::new(), - chatgpt_base_url_is_explicit: false, respect_system_proxy, apps_mcp_product_sku: None, responses_api_metadata: BTreeMap::new(),