Rimossi i provider integrati OpenAI, Bedrock e GCP e ogni fallback a OpenAI (B)
Parte "sicurezza" della fase 3 di aKode (e39aae00), senza le funzioni di imeAI:
- via i provider integrati openai, amazon-bedrock, amazon-bedrock-runtime e gcp
(crate model-provider: moduli amazon_bedrock, gcp, chatgpt_base_url; login Bedrock;
onboarding Bedrock/GCP; richieste app-server di setup cloud);
- nessun URL predefinito verso api.openai.com / chatgpt.com: un provider senza
base_url non viene mai contattato; senza model_provider configurato exec e TUI
mostrano come scriverne uno in config.toml (NO_MODEL_PROVIDER_CONFIGURED_ERROR);
- via la skill openai-docs, la sample skill-installer (scaricava da github.com/openai/skills),
request_plugin_install, AppsInstructions, URL predefiniti di realtime e updater;
- test di sicurezza adattati (provider "mock" al posto di quello integrato), non cancellati.
Restano fuori da questo commit (categoria F/D/E, non portate): chiave per provider nel
portachiavi, modelli da /models, unione dei messaggi di sistema, crate web-tools e
SearXNG, header @@ in apply_patch, modello ausiliario, tool function per apply_patch.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,12 +22,12 @@ use regex_lite::Regex;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub mod mcp_test_server;
|
||||
#[cfg(unix)]
|
||||
pub mod code_mode_host;
|
||||
pub mod context_snapshot;
|
||||
pub mod exec_server;
|
||||
pub mod hooks;
|
||||
pub mod mcp_test_server;
|
||||
pub mod network_policy_mcp;
|
||||
pub mod oauth;
|
||||
pub mod process;
|
||||
@@ -207,17 +207,44 @@ pub async fn load_default_config_for_test(codex_home: &TempDir) -> Config {
|
||||
pub async fn load_default_config_for_test_with_managed_config(
|
||||
codex_home: &TempDir,
|
||||
managed_config: ManagedConfigFixture,
|
||||
) -> Config {
|
||||
let mut config = load_config_with_test_provider(codex_home, managed_config).await;
|
||||
if config.model_catalog.is_none() && config.model_provider.model_catalog_url.is_none() {
|
||||
config.model_catalog = codex_models_manager::bundled_models_response().ok();
|
||||
}
|
||||
config
|
||||
}
|
||||
|
||||
/// Like [`load_default_config_for_test_with_managed_config`], without injecting the bundled
|
||||
/// catalog into `config.model_catalog`. `test_codex` serves the bundled catalog through its
|
||||
/// models manager instead, so an explicit config catalog keeps its upstream meaning.
|
||||
pub(crate) async fn load_config_with_test_provider(
|
||||
codex_home: &TempDir,
|
||||
managed_config: ManagedConfigFixture,
|
||||
) -> Config {
|
||||
let loader_overrides = managed_config
|
||||
.loader_overrides_for_tests(codex_home.path())
|
||||
.expect("managed config fixture should be writable");
|
||||
ConfigBuilder::default()
|
||||
let mut config = ConfigBuilder::default()
|
||||
.loader_overrides(loader_overrides)
|
||||
.codex_home(codex_home.path().to_path_buf())
|
||||
.harness_overrides(default_test_overrides())
|
||||
.build()
|
||||
.await
|
||||
.expect("defaults for test should always succeed")
|
||||
.expect("defaults for test should always succeed");
|
||||
// aKode has no built-in OpenAI provider: give tests a mock Responses provider (stored-key
|
||||
// auth, unreachable endpoint unless a test overrides it) and the bundled model catalog.
|
||||
if !config.model_provider_configured() {
|
||||
let provider =
|
||||
crate::test_codex::test_model_provider_info(Some("http://127.0.0.1:9/v1".to_string()));
|
||||
config.model_provider_id = crate::test_codex::TEST_MODEL_PROVIDER_ID.to_string();
|
||||
config.model_providers.insert(
|
||||
crate::test_codex::TEST_MODEL_PROVIDER_ID.to_string(),
|
||||
provider.clone(),
|
||||
);
|
||||
config.model_provider = provider;
|
||||
}
|
||||
config
|
||||
}
|
||||
|
||||
pub fn managed_network_requirements() -> ManagedConfigFixture {
|
||||
|
||||
Reference in New Issue
Block a user