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:
@@ -110,9 +110,35 @@ impl MockResponsesConfig {
|
||||
provider_config,
|
||||
extra_config,
|
||||
} = self;
|
||||
let root_config = root_config.join("\n");
|
||||
let provider_config = provider_config.join("\n");
|
||||
let mut root_config = root_config.join("\n");
|
||||
let mut provider_config = provider_config.join("\n");
|
||||
let extra_config = extra_config.join("\n");
|
||||
// aKode providers without a catalog URL synthesize local metadata; tests keep the
|
||||
// bundled catalog the removed built-in defaults provided (unless they configure one).
|
||||
if !root_config.contains("model_catalog_json")
|
||||
&& !extra_config.contains("model_catalog_json")
|
||||
&& !provider_config.contains("model_catalog_url")
|
||||
{
|
||||
root_config.push('\n');
|
||||
root_config.push_str(&bundled_model_catalog_config(codex_home)?);
|
||||
}
|
||||
// Upstream custom providers offered hosted web search by default; aKode makes it an
|
||||
// explicit provider capability, so the mock provider opts in to keep request shapes.
|
||||
// Upstream also gave providers named "OpenAI" remote compaction V2 by name; aKode
|
||||
// requires the explicit capability.
|
||||
if !provider_config.contains("capabilities") && !extra_config.contains("capabilities") {
|
||||
if provider_name == "OpenAI" {
|
||||
provider_config.push_str(
|
||||
"\ncapabilities = { hosted_web_search = true, remote_compaction = \"v2\" }",
|
||||
);
|
||||
} else {
|
||||
provider_config.push_str("\ncapabilities = { hosted_web_search = true }");
|
||||
}
|
||||
}
|
||||
// Request-shape tests keep the upstream instruction layout; merging has its own tests.
|
||||
if !provider_config.contains("merge_system_messages") {
|
||||
provider_config.push_str("\nmerge_system_messages = false");
|
||||
}
|
||||
let feature_entries = features
|
||||
.into_iter()
|
||||
.map(|(feature, enabled)| {
|
||||
@@ -156,6 +182,23 @@ stream_max_retries = 0
|
||||
}
|
||||
}
|
||||
|
||||
/// Copy the bundled model catalog into `codex_home` and return the root-level
|
||||
/// `model_catalog_json = ...` line that selects it.
|
||||
///
|
||||
/// aKode has no default provider and no bundled catalog seed, so tests that start threads
|
||||
/// from a hand-written config (and relied on the removed defaults) opt in explicitly.
|
||||
pub fn bundled_model_catalog_config(codex_home: &Path) -> std::io::Result<String> {
|
||||
let catalog = codex_home.join(crate::models_cache::HARNESS_CATALOG_FILE);
|
||||
std::fs::write(
|
||||
&catalog,
|
||||
include_str!("../../../models-manager/models.json"),
|
||||
)?;
|
||||
Ok(format!(
|
||||
"model_catalog_json = {}\n",
|
||||
serde_json::to_string(&catalog.display().to_string())?
|
||||
))
|
||||
}
|
||||
|
||||
pub fn write_mock_responses_config_toml(
|
||||
codex_home: &Path,
|
||||
server_uri: &str,
|
||||
|
||||
Reference in New Issue
Block a user