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:
@@ -78,11 +78,6 @@ async fn daemon_exclusion_survives_fork_picker() -> Result<()> {
|
||||
daemon_startup("fork").await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn daemon_auto_start_preserves_bedrock_onboarding() -> Result<()> {
|
||||
daemon_startup("bedrock").await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[cfg(windows)]
|
||||
async fn elevated_local_tui_uses_embedded_without_starting_daemon() -> Result<()> {
|
||||
@@ -146,12 +141,6 @@ async fn restrictive_launcher_uses_embedded_if_daemon_cannot_start() -> Result<(
|
||||
daemon_startup("restrictive-job").await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[cfg(unix)]
|
||||
async fn bedrock_onboarding_discovers_credentials_on_the_running_daemon() -> Result<()> {
|
||||
daemon_startup("bedrock-running").await
|
||||
}
|
||||
|
||||
async fn daemon_startup(command: &str) -> Result<()> {
|
||||
#[cfg(windows)]
|
||||
let elevated = codex_app_server_daemon::is_elevated()?;
|
||||
@@ -177,17 +166,24 @@ async fn daemon_startup(command: &str) -> Result<()> {
|
||||
"failed to prepare CLI test executable"
|
||||
);
|
||||
let bedrock_onboarding = matches!(command, "bedrock" | "bedrock-running");
|
||||
// aKode has no built-in catalog for providers without a catalog URL; keep the bundled one.
|
||||
let catalog = home.path().join("test-models.json");
|
||||
fs::write(&catalog, include_str!("../../models-manager/models.json"))?;
|
||||
fs::write(
|
||||
home.path().join("config.toml"),
|
||||
format!(
|
||||
"model = \"gpt-5.6-terra\"\n\
|
||||
model_provider = \"mock\"\n\
|
||||
model_catalog_json = {}\n\
|
||||
cli_auth_credentials_store = \"file\"\n\
|
||||
suppress_unstable_features_warning = true\n\
|
||||
windows.sandbox = \"unelevated\"\n\
|
||||
tui.disable_paste_burst = true\n\
|
||||
{}\n\
|
||||
notice.model_migrations.\"gpt-5.6-terra\" = \"gpt-6-sol\"\n\
|
||||
[model_providers.mock]\nname = \"mock\"\nbase_url = \"http://127.0.0.1:9/v1\"\nrequires_openai_auth = true\n\
|
||||
[projects.{}]\ntrust_level = \"{}\"\n",
|
||||
serde_json::to_string(&catalog.display().to_string())?,
|
||||
if command == "discovered" {
|
||||
"tui.status_line=[\"model\",\"thread-id\",\"thread-name\"]\nfeatures.daemon_auto_start=false"
|
||||
} else if bedrock_onboarding {
|
||||
@@ -380,7 +376,7 @@ async fn daemon_startup(command: &str) -> Result<()> {
|
||||
"session_id": thread_id, "id": thread_id,
|
||||
"timestamp": "2025-01-05T12:00:00Z", "cwd": workspace_path,
|
||||
"originator": "codex", "cli_version": "0.0.0",
|
||||
"source": "cli", "model_provider": "openai"
|
||||
"source": "cli", "model_provider": "mock"
|
||||
}
|
||||
});
|
||||
let message = serde_json::json!({
|
||||
|
||||
Reference in New Issue
Block a user