aKode fase 3: provider locali, chiavi per provider, modelli dal server, SearXNG
- Provider: rimossi openai, Bedrock e GCP integrati e ogni fallback a OpenAI;
restano ollama, lmstudio e i provider personalizzati. Senza provider, exec e
TUI mostrano come configurarlo.
- Chiave per provider: api_key = "keyring", provider_api_key_store =
auto|keyring|file (fallback su file 0600 / ACL Windows); `codex login
--provider <id> --with-api-key`, `logout --provider`; login status e doctor
mostrano dove sta la chiave senza rivelarla.
- Modelli letti da GET {base_url}/models; contesto da config, poi dal server
(/props, meta.n_ctx), poi 32768; apply_patch come tool function; niente tool
ospitati; niente piu' avviso "metadata not found".
- Unione dei soli messaggi system/developer iniziali in un unico system;
quelli successivi restano al loro posto come user (cache del server
preservata: turno N prefisso esatto del turno N+1).
- Modelli ausiliari (memorie, guardian-v2) = modello di sessione se il
preferito gpt-* non e' nel catalogo.
- Ricerca web: crate web-tools, backend SearXNG con web_search e web_fetch
(protezione SSRF); senza backend nessuno strumento web.
- Skill: rimossa openai-docs; skill-installer punta a git.difonzo.net.
- apply_patch accetta gli header @@ -a,b +c,d @@ dei diff unificati.
- Rimossi resti: request_plugin_install, AppsInstructions, --cyber-access-program,
URL updater/realtime predefiniti.
- Fix: importazione sessioni con provider vuoto.
- Istruzioni di sistema invariate. Test: cancellati solo quelli del codice
rimosso, test di sicurezza adattati; restano solo fallimenti d'ambiente.
- Prova reale su imeAI + SearXNG: risposta, modifica file, web_search,
cache riusata, connessioni solo verso .25 e .57.
Co-Authored-By: Claude Opus 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