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:
andrea.difonzo
2026-11-17 12:31:29 +01:00
parent 22a79feba1
commit 2f8b6a3e16
481 changed files with 4319 additions and 25142 deletions

View File

@@ -826,6 +826,11 @@ async fn run_exec_session(args: ExecRunArgs) -> anyhow::Result<()> {
thread_source,
} = args;
// aKode has no default provider: explain how to configure one instead of failing later.
if !config.model_provider_configured() {
anyhow::bail!(codex_model_provider_info::NO_MODEL_PROVIDER_CONFIGURED_ERROR);
}
let mut event_processor: Box<dyn EventProcessor> = match json_mode {
true => Box::new(EventProcessorWithJsonOutput::new(last_message_file.clone())),
_ => Box::new(EventProcessorWithHumanOutput::create_with_ansi(

View File

@@ -9,6 +9,7 @@ mod completion_backfill;
mod ephemeral;
mod hooks;
mod mcp_required_exit;
mod no_model_provider;
mod originator;
mod output_last_message;
mod output_schema;

View File

@@ -0,0 +1,19 @@
#![allow(clippy::unwrap_used)]
use core_test_support::test_codex_exec::test_codex_exec;
use predicates::str::contains;
/// aKode has no default provider: without one, exec explains how to configure it and never
/// contacts any server.
#[test]
fn exec_without_model_provider_explains_how_to_configure_one() {
let test = test_codex_exec();
test.cmd_without_provider()
.arg("--skip-git-repo-check")
.arg("hello")
.assert()
.failure()
.stderr(contains("No model provider is configured"))
.stderr(contains("[model_providers.local]"))
.stderr(contains("codex login --provider local --with-api-key"));
}

View File

@@ -625,13 +625,20 @@ async fn exec_resume_accepts_global_flags_after_subcommand() -> anyhow::Result<(
.success();
// Resume while passing global flags after the subcommand to ensure clap accepts them.
// aKode has no built-in provider: select the mock provider through flags placed after
// the subcommand too.
let base = format!("{}/v1", server.uri());
let base_config = format!("openai_base_url={}", serde_json::to_string(&base)?);
test.cmd()
let provider_config = format!(
"model_providers.mock={{name=\"mock\",base_url={},requires_openai_auth=true,supports_websockets=false}}",
serde_json::to_string(&base)?
);
test.cmd_without_provider()
.arg("resume")
.arg("--last")
.arg("--config")
.arg(base_config)
.arg("model_provider=\"mock\"")
.arg("--config")
.arg(provider_config)
.arg("--json")
.arg("--model")
.arg("gpt-5.2-codex")