aKode 0.2.0: protezione dai loop, errori del server chiari, pulizia
- Protezione dai loop: se il modello ripete lo stesso comando con lo stesso errore 3 volte di fila il turno si ferma con un messaggio chiaro (e un suggerimento su /permissions per i blocchi della sandbox); configurabile con [agent] max_repeated_failures (0 = disattivata). - Errori dello stream: si mostra il messaggio del server invece di "stream closed before response.completed"; il contesto superato (llama.cpp, vLLM) diventa un messaggio in italiano; avviso una volta se il prompt iniziale supera la finestra del modello. - Pulizia: tolta la logica morta per le chiavi OpenAI nel credential broker (prefisso "sk-", watermark, prefissi ignorati); link alla documentazione OpenAI nella TUI sostituiti con il README del repository; test dello snapshot del broker adattato al token GitHub. - Versione 0.2.0 e sezione Novità nel README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -133,7 +133,8 @@ impl App {
|
||||
if let Some(effort) = outcome.active_effort.clone()
|
||||
&& outcome.activate.is_none()
|
||||
{
|
||||
self.app_event_tx.send(AppEvent::UpdateReasoningEffort(effort));
|
||||
self.app_event_tx
|
||||
.send(AppEvent::UpdateReasoningEffort(effort));
|
||||
}
|
||||
if let Some((provider_id, model)) = outcome.activate {
|
||||
self.switch_provider(app_server, provider_id, model).await;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
source: tui/src/app/daemon_menu_tests.rs
|
||||
assertion_line: 125
|
||||
expression: "render_bottom_popup(&app.chat_widget,\nwidth).replace(r\"C:\\cli-build\\bin\\codex\", \"/x/cli-build/bin/akode\")"
|
||||
---
|
||||
Agent command center Group: Project g
|
||||
@@ -11,7 +10,7 @@ expression: "render_bottom_popup(&app.chat_widget,\nwidth).replace(r\"C:\\cli-bu
|
||||
│
|
||||
|
||||
Update daemon and exit aKode?
|
||||
Use this CLI package v0.1.0 from /x/cli-build/bin/akode. Copy the
|
||||
Use this CLI package v0.2.0 from /x/cli-build/bin/akode. Copy the
|
||||
complete package and pin it against automatic updates.
|
||||
This may restart the daemon and interrupt active or queued work.
|
||||
Codex exits to update in this terminal. Relaunch it afterward.
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: "format!(\"enabled:\\n{}\\n---\\ndisabled:\\n{}\", text(after), text
|
||||
---
|
||||
enabled:
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ GPT-5.6-Sol · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
@@ -50,7 +50,7 @@ enabled:
|
||||
---
|
||||
disabled:
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ GPT-5.6-Sol · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
source: tui/src/app/tests.rs
|
||||
assertion_line: 9263
|
||||
expression: rendered
|
||||
---
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ <thread cwd>
|
||||
██▀████▀██
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
source: tui/src/app/tests/realtime_requests.rs
|
||||
assertion_line: 898
|
||||
expression: "normalize_voice_snapshot_directory(&rendered, &app.config.cwd)"
|
||||
---
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
source: tui/src/app/tests/realtime_requests.rs
|
||||
assertion_line: 1106
|
||||
expression: "normalize_voice_snapshot_directory(&rendered, &app.config.cwd)"
|
||||
---
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -14,7 +14,7 @@ Restored owner:
|
||||
|
||||
127.0.0.1:9 · gpt-test · /tmp/project ctx 0% · -- t/s
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
source: tui/src/app/tests/realtime_requests.rs
|
||||
assertion_line: 723
|
||||
expression: "normalize_voice_snapshot_directory(&rendered, &app.config.cwd)"
|
||||
---
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
source: tui/src/app/tests/new_session_tests.rs
|
||||
expression: "normalize_snapshot_paths(render_bottom_popup(&app.chat_widget, 80))"
|
||||
---
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ loading · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: "normalize_snapshot_paths(normalize_agent_center_snapshot(snapshots.
|
||||
---
|
||||
80 columns
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
@@ -26,7 +26,7 @@ expression: "normalize_snapshot_paths(normalize_agent_center_snapshot(snapshots.
|
||||
|
||||
32 columns
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-test · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -33,7 +33,7 @@ use super::popup_consts::MAX_POPUP_ROWS;
|
||||
use super::scroll_state::ScrollState;
|
||||
use super::selection_popup_common::GenericDisplayRow;
|
||||
|
||||
const MEMORIES_DOC_URL: &str = "https://developers.openai.com/codex/memories";
|
||||
const MEMORIES_DOC_URL: &str = "https://git.difonzo.net/andrea/aKode";
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
enum MemoriesSetting {
|
||||
|
||||
@@ -165,7 +165,7 @@ use tracing::warn;
|
||||
|
||||
const DEFAULT_MODEL_DISPLAY_NAME: &str = "loading";
|
||||
const MEMORIES_ENABLE_NOTICE: &str = "Memories will be enabled in the next session.";
|
||||
const MEMORIES_DOC_URL: &str = "https://developers.openai.com/codex/memories";
|
||||
const MEMORIES_DOC_URL: &str = "https://git.difonzo.net/andrea/aKode";
|
||||
const PLAN_MODE_REASONING_SCOPE_TITLE: &str = "Apply reasoning change";
|
||||
const PLAN_MODE_REASONING_SCOPE_PLAN_ONLY: &str = "Apply to Plan mode override";
|
||||
const PLAN_MODE_REASONING_SCOPE_ALL_MODES: &str = "Apply to global default and Plan mode override";
|
||||
|
||||
@@ -10,5 +10,5 @@ expression: "render_bottom_popup(&chat, 80)"
|
||||
this thread
|
||||
2. Not now Keep memories disabled
|
||||
|
||||
Learn more: https://developers.openai.com/codex/memories
|
||||
Learn more: https://git.difonzo.net/andrea/aKode
|
||||
enter select · esc back
|
||||
|
||||
@@ -12,6 +12,6 @@ expression: popup
|
||||
existing threads
|
||||
|
||||
|
||||
Learn more: https://developers.openai.com/codex/memories
|
||||
Learn more: https://git.difonzo.net/andrea/aKode
|
||||
|
||||
space toggle · enter save/select · esc cancel
|
||||
|
||||
@@ -3,7 +3,7 @@ source: tui/src/chatwidget/tests/permissions.rs
|
||||
expression: popup
|
||||
---
|
||||
Set up the aKode agent sandbox to protect your files and control network access. Learn more
|
||||
<https://developers.openai.com/codex/windows>
|
||||
<https://git.difonzo.net/andrea/aKode>
|
||||
|
||||
|
||||
› 1. Set up default sandbox (requires Administrator permissions)
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: "render_bottom_popup(&chat, 120)"
|
||||
---
|
||||
Your organization requires the default aKode agent sandbox to continue. Set it up to protect your files and control
|
||||
network access.
|
||||
Learn more <https://developers.openai.com/codex/windows>
|
||||
Learn more <https://git.difonzo.net/andrea/aKode>
|
||||
|
||||
|
||||
› 1. Set up default sandbox (requires Administrator permissions)
|
||||
|
||||
@@ -5,7 +5,7 @@ expression: popup
|
||||
Couldn't set up your sandbox with Administrator permissions
|
||||
|
||||
Your organization requires the default sandbox before aKode can continue.
|
||||
Learn more <https://developers.openai.com/codex/windows>
|
||||
Learn more <https://git.difonzo.net/andrea/aKode>
|
||||
|
||||
|
||||
› 1. Try setting up admin sandbox again
|
||||
|
||||
@@ -3,7 +3,7 @@ source: tui/src/chatwidget/tests/permissions.rs
|
||||
expression: "render_bottom_popup(&chat, 100)"
|
||||
---
|
||||
Set up the aKode agent sandbox to protect your files and control network access. Learn more
|
||||
<https://developers.openai.com/codex/windows>
|
||||
<https://git.difonzo.net/andrea/aKode>
|
||||
|
||||
|
||||
› 1. Use non-admin sandbox (higher risk if prompt injected)
|
||||
|
||||
@@ -1006,7 +1006,7 @@ async fn startup_windows_sandbox_prompt_blocks_disallowed_unelevated_fallback()
|
||||
|
||||
#[tokio::test]
|
||||
async fn windows_sandbox_help_links_keep_complete_wrapped_destinations() {
|
||||
let url = "https://developers.openai.com/codex/windows";
|
||||
let url = "https://git.difonzo.net/andrea/aKode";
|
||||
for fallback in [false, true] {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
let preset = builtin_approval_presets()
|
||||
|
||||
@@ -6,8 +6,8 @@ expression: visible
|
||||
Set up the aKode agent sandbox to
|
||||
protect your files and control
|
||||
network access. Learn more
|
||||
<https://developers.openai.com/codex
|
||||
/windows>
|
||||
<https://git.difonzo.net/andrea/aKod
|
||||
e>
|
||||
|
||||
|
||||
› 1. Set up default sandbox (requires
|
||||
|
||||
@@ -35,12 +35,12 @@ impl ChatWidget {
|
||||
header.push(*Box::new(
|
||||
crate::terminal_hyperlinks::HyperlinkText::new(if allow_unelevated {
|
||||
vec![
|
||||
line!["Set up the aKode agent sandbox to protect your files and control network access. Learn more <https://developers.openai.com/codex/windows>"],
|
||||
line!["Set up the aKode agent sandbox to protect your files and control network access. Learn more <https://git.difonzo.net/andrea/aKode>"],
|
||||
]
|
||||
} else {
|
||||
vec![
|
||||
line!["Your organization requires the default aKode agent sandbox to continue. Set it up to protect your files and control network access."],
|
||||
line!["Learn more <https://developers.openai.com/codex/windows>"],
|
||||
line!["Learn more <https://git.difonzo.net/andrea/aKode>"],
|
||||
]
|
||||
}),
|
||||
));
|
||||
@@ -164,9 +164,7 @@ impl ChatWidget {
|
||||
"Your organization requires the default sandbox before aKode can continue."
|
||||
]);
|
||||
}
|
||||
lines.push(line![
|
||||
"Learn more <https://developers.openai.com/codex/windows>"
|
||||
]);
|
||||
lines.push(line!["Learn more <https://git.difonzo.net/andrea/aKode>"]);
|
||||
|
||||
let mut header = ColumnRenderable::new();
|
||||
header.push(crate::terminal_hyperlinks::HyperlinkText::new(lines));
|
||||
|
||||
@@ -207,10 +207,12 @@ fn parse_setting(setting: Setting, text: &str) -> Result<Option<serde_json::Valu
|
||||
}
|
||||
let number = || text.replace(',', ".").parse::<f64>().ok();
|
||||
match setting {
|
||||
Setting::Context | Setting::MaxOutput => match text.replace(['.', '_', ' '], "").parse::<i64>() {
|
||||
Ok(value) if value > 0 => Ok(Some(serde_json::json!(value))),
|
||||
_ => Err("Inserisci un numero intero di token maggiore di zero.".to_string()),
|
||||
},
|
||||
Setting::Context | Setting::MaxOutput => {
|
||||
match text.replace(['.', '_', ' '], "").parse::<i64>() {
|
||||
Ok(value) if value > 0 => Ok(Some(serde_json::json!(value))),
|
||||
_ => Err("Inserisci un numero intero di token maggiore di zero.".to_string()),
|
||||
}
|
||||
}
|
||||
Setting::Temperature => match number() {
|
||||
Some(value) if (0.0..=2.0).contains(&value) => Ok(Some(serde_json::json!(value))),
|
||||
_ => Err("La temperatura va da 0 a 2.".to_string()),
|
||||
@@ -230,13 +232,19 @@ pub(crate) fn model_setting_path(provider_id: &str, model: &str, key: &str) -> S
|
||||
format!("model_providers.{provider_id}.models.\"{quoted}\".{key}")
|
||||
}
|
||||
|
||||
fn apply_setting(settings: &mut ProviderModelSettings, setting: Setting, value: &Option<serde_json::Value>) {
|
||||
fn apply_setting(
|
||||
settings: &mut ProviderModelSettings,
|
||||
setting: Setting,
|
||||
value: &Option<serde_json::Value>,
|
||||
) {
|
||||
let value = value.as_ref();
|
||||
match setting {
|
||||
Setting::Context => settings.context_window = value.and_then(serde_json::Value::as_i64),
|
||||
Setting::Temperature => settings.temperature = value.and_then(serde_json::Value::as_f64),
|
||||
Setting::TopP => settings.top_p = value.and_then(serde_json::Value::as_f64),
|
||||
Setting::MaxOutput => settings.max_output_tokens = value.and_then(serde_json::Value::as_u64),
|
||||
Setting::MaxOutput => {
|
||||
settings.max_output_tokens = value.and_then(serde_json::Value::as_u64)
|
||||
}
|
||||
Setting::Reasoning => {
|
||||
settings.reasoning_effort =
|
||||
value.and_then(|value| serde_json::from_value(value.clone()).ok());
|
||||
@@ -384,7 +392,12 @@ impl EndpointPanel {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn set_models_for_test(&mut self, provider_id: &str, list: setup_net::ModelList, props: Option<i64>) {
|
||||
fn set_models_for_test(
|
||||
&mut self,
|
||||
provider_id: &str,
|
||||
list: setup_net::ModelList,
|
||||
props: Option<i64>,
|
||||
) {
|
||||
self.tasks = FuturesUnordered::new();
|
||||
self.models.insert(
|
||||
provider_id.to_string(),
|
||||
@@ -540,9 +553,8 @@ impl EndpointPanel {
|
||||
}
|
||||
self.outcome.config_changed = true;
|
||||
if self.is_active(&provider_id, Some(&model)) && setting == Setting::Reasoning {
|
||||
self.outcome.active_effort = Some(
|
||||
value.and_then(|value| serde_json::from_value(value).ok()),
|
||||
);
|
||||
self.outcome.active_effort =
|
||||
Some(value.and_then(|value| serde_json::from_value(value).ok()));
|
||||
}
|
||||
self.notice = Some(Notice::Ok(format!("{} salvato.", setting.label())));
|
||||
}
|
||||
@@ -607,7 +619,10 @@ impl EndpointPanel {
|
||||
info,
|
||||
typed_key: None,
|
||||
});
|
||||
self.ctx.setup.existing_provider_ids.insert(provider_id.clone());
|
||||
self.ctx
|
||||
.setup
|
||||
.existing_provider_ids
|
||||
.insert(provider_id.clone());
|
||||
self.ctx.endpoints.len() - 1
|
||||
}
|
||||
};
|
||||
@@ -706,9 +721,10 @@ impl EndpointPanel {
|
||||
let Some(entry) = self.endpoint().cloned() else {
|
||||
return;
|
||||
};
|
||||
let model = self
|
||||
.selected_model()
|
||||
.or_else(|| self.loaded().and_then(|(list, _)| list.models.first().cloned()));
|
||||
let model = self.selected_model().or_else(|| {
|
||||
self.loaded()
|
||||
.and_then(|(list, _)| list.models.first().cloned())
|
||||
});
|
||||
let Some(model) = model else {
|
||||
self.notice = Some(Notice::Error(
|
||||
"Elenco dei modelli non disponibile: non so quale modello usare.".to_string(),
|
||||
@@ -757,10 +773,7 @@ impl EndpointPanel {
|
||||
.position(|effort| *effort == settings.reasoning_effort)
|
||||
.unwrap_or(0);
|
||||
let next = EFFORTS[(current + 1) % EFFORTS.len()].clone();
|
||||
self.save_setting(
|
||||
setting,
|
||||
next.map(|effort| serde_json::json!(effort)),
|
||||
);
|
||||
self.save_setting(setting, next.map(|effort| serde_json::json!(effort)));
|
||||
return;
|
||||
}
|
||||
let text = match setting {
|
||||
@@ -857,7 +870,10 @@ async fn delete_endpoint(
|
||||
)],
|
||||
)
|
||||
.await?;
|
||||
for mode in [AuthCredentialsStoreMode::File, AuthCredentialsStoreMode::Keyring] {
|
||||
for mode in [
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthCredentialsStoreMode::Keyring,
|
||||
] {
|
||||
let store = akode_login::configured_provider_api_key_store(&codex_home, mode);
|
||||
if let Err(error) = store.delete(&provider_id) {
|
||||
tracing::warn!("could not remove a provider API key: {error}");
|
||||
@@ -927,7 +943,11 @@ impl KeyboardHandler for EndpointPanel {
|
||||
}
|
||||
KeyCode::Tab | KeyCode::Right => self.move_column(true),
|
||||
KeyCode::BackTab | KeyCode::Left => self.move_column(false),
|
||||
KeyCode::Up | KeyCode::Down | KeyCode::PageUp | KeyCode::PageDown | KeyCode::Home
|
||||
KeyCode::Up
|
||||
| KeyCode::Down
|
||||
| KeyCode::PageUp
|
||||
| KeyCode::PageDown
|
||||
| KeyCode::Home
|
||||
| KeyCode::End => {
|
||||
self.move_row(key.code);
|
||||
}
|
||||
@@ -964,8 +984,7 @@ impl KeyboardHandler for EndpointPanel {
|
||||
Column::Settings => match key.code {
|
||||
KeyCode::Enter => self.start_edit(),
|
||||
KeyCode::Backspace | KeyCode::Delete => {
|
||||
if let Some(setting) = self.settings_rows().get(self.setting_idx).copied()
|
||||
{
|
||||
if let Some(setting) = self.settings_rows().get(self.setting_idx).copied() {
|
||||
self.save_setting(setting, None);
|
||||
}
|
||||
}
|
||||
@@ -1040,7 +1059,9 @@ impl EndpointPanel {
|
||||
Column::Endpoints => ("Endpoint".to_string(), String::new()),
|
||||
Column::Models => (
|
||||
"Modelli".to_string(),
|
||||
self.endpoint().map(|e| e.label().to_string()).unwrap_or_default(),
|
||||
self.endpoint()
|
||||
.map(|e| e.label().to_string())
|
||||
.unwrap_or_default(),
|
||||
),
|
||||
Column::Settings => (
|
||||
"Impostazioni".to_string(),
|
||||
@@ -1210,7 +1231,10 @@ impl EndpointPanel {
|
||||
.global_context_window
|
||||
.map(|window| format!("{window} (globale)"))
|
||||
.unwrap_or_else(|| "predefinito".to_string());
|
||||
let mut spans = vec![set(settings.context_window.map(|v| v.to_string()), fallback)];
|
||||
let mut spans = vec![set(
|
||||
settings.context_window.map(|v| v.to_string()),
|
||||
fallback,
|
||||
)];
|
||||
if let Some(window) = self.server_window(model) {
|
||||
spans.push(format!(" (server {window})").dim());
|
||||
}
|
||||
@@ -1232,10 +1256,9 @@ impl EndpointPanel {
|
||||
settings.reasoning_effort.as_ref().map(effort_label),
|
||||
"predefinito".to_string(),
|
||||
)],
|
||||
Setting::DisplayName => vec![set(
|
||||
settings.display_name.clone(),
|
||||
short_model_name(model),
|
||||
)],
|
||||
Setting::DisplayName => {
|
||||
vec![set(settings.display_name.clone(), short_model_name(model))]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1279,7 +1302,11 @@ impl EndpointPanel {
|
||||
|
||||
fn hints(&self) -> Vec<(&'static str, &'static str)> {
|
||||
if self.editing.is_some() {
|
||||
return vec![("invio", "salva"), ("vuoto", "predefinito"), ("esc", "annulla")];
|
||||
return vec![
|
||||
("invio", "salva"),
|
||||
("vuoto", "predefinito"),
|
||||
("esc", "annulla"),
|
||||
];
|
||||
}
|
||||
if self.confirm_delete {
|
||||
return vec![("invio", "elimina"), ("esc", "annulla")];
|
||||
@@ -1315,10 +1342,15 @@ impl EndpointPanel {
|
||||
|
||||
fn notice_line(&self, width: usize) -> Line<'static> {
|
||||
if self.confirm_delete {
|
||||
let name = self.endpoint().map(|e| e.label().to_string()).unwrap_or_default();
|
||||
let name = self
|
||||
.endpoint()
|
||||
.map(|e| e.label().to_string())
|
||||
.unwrap_or_default();
|
||||
return truncate_line(
|
||||
Line::from(Span::styled(
|
||||
format!("Eliminare l'endpoint «{name}» e la sua chiave? invio conferma · esc annulla"),
|
||||
format!(
|
||||
"Eliminare l'endpoint «{name}» e la sua chiave? invio conferma · esc annulla"
|
||||
),
|
||||
status_style(StatusTone::Attention),
|
||||
)),
|
||||
width,
|
||||
@@ -1374,7 +1406,9 @@ impl WidgetRef for &EndpointPanel {
|
||||
// Title row with the close hint on the right.
|
||||
let title = "Modelli ed endpoint";
|
||||
let close = "esc chiudi";
|
||||
let gap = w.saturating_sub(display_width(title) + display_width(close)).max(2);
|
||||
let gap = w
|
||||
.saturating_sub(display_width(title) + display_width(close))
|
||||
.max(2);
|
||||
put(
|
||||
truncate_line(
|
||||
Line::from(vec![
|
||||
|
||||
@@ -442,7 +442,7 @@ pub(crate) fn empty_mcp_output() -> WebHyperlinkHistoryCell {
|
||||
let mut docs_line = HyperlinkLine::new(Line::from(" See the "));
|
||||
docs_line.push_span(
|
||||
"MCP docs".underlined(),
|
||||
Some("https://developers.openai.com/codex/mcp"),
|
||||
Some("https://git.difonzo.net/andrea/aKode"),
|
||||
);
|
||||
docs_line.push_span(" to configure them.".into(), /*destination*/ None);
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
source: tui/src/history_cell/tests.rs
|
||||
assertion_line: 796
|
||||
expression: rendered
|
||||
---
|
||||
|
||||
▄▄████▄▄ aKode v0.1.0
|
||||
▄▄████▄▄ aKode v0.2.0
|
||||
██▀▀██▀▀██ gpt-5 · mock
|
||||
██▄▄██▄▄██ /tmp/project
|
||||
██▀████▀██
|
||||
|
||||
@@ -424,7 +424,7 @@ fn composite_cell_preserves_child_web_links() {
|
||||
|
||||
#[test]
|
||||
fn empty_mcp_output_preserves_docs_hyperlink() {
|
||||
let destination = "https://developers.openai.com/codex/mcp";
|
||||
let destination = "https://git.difonzo.net/andrea/aKode";
|
||||
let cell: Box<dyn HistoryCell> = Box::new(empty_mcp_output());
|
||||
|
||||
insta::assert_snapshot!(render_lines(&cell.display_lines(/*width*/ 80)).join("\n"), @r"
|
||||
|
||||
@@ -164,6 +164,7 @@ pub(crate) mod live_wrap;
|
||||
mod local_settings;
|
||||
mod rendered_selection;
|
||||
pub use live_wrap::RowBuilder;
|
||||
mod endpoint_panel;
|
||||
mod managed_new_thread_defaults;
|
||||
mod markdown;
|
||||
mod markdown_render;
|
||||
@@ -172,7 +173,6 @@ mod markdown_text_merge;
|
||||
mod mention_codec;
|
||||
mod model_catalog;
|
||||
mod model_display;
|
||||
mod endpoint_panel;
|
||||
mod model_migration;
|
||||
mod motion;
|
||||
mod multi_agents;
|
||||
|
||||
@@ -32,7 +32,9 @@ pub(crate) fn set_display_names_from_config(config: &Config) {
|
||||
}
|
||||
}
|
||||
}
|
||||
*DISPLAY_NAMES.write().unwrap_or_else(PoisonError::into_inner) = Some(names);
|
||||
*DISPLAY_NAMES
|
||||
.write()
|
||||
.unwrap_or_else(PoisonError::into_inner) = Some(names);
|
||||
}
|
||||
|
||||
/// Whether `model` is a local file path rather than a plain or `vendor/model` id.
|
||||
@@ -93,7 +95,10 @@ mod tests {
|
||||
);
|
||||
assert_eq!(short_model_name("C:\\models\\qwen3.gguf"), "qwen3");
|
||||
assert_eq!(short_model_name("flint.gguf"), "flint");
|
||||
assert_eq!(short_model_name("qwen/qwen3-coder:free"), "qwen/qwen3-coder:free");
|
||||
assert_eq!(
|
||||
short_model_name("qwen/qwen3-coder:free"),
|
||||
"qwen/qwen3-coder:free"
|
||||
);
|
||||
assert_eq!(short_model_name("qwen3.6-35b-a3b"), "qwen3.6-35b-a3b");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,11 @@ impl SetupWizard {
|
||||
} else {
|
||||
Page::Welcome
|
||||
};
|
||||
let searx_url = ctx.searx_url.as_deref().map(ProviderInput::from).unwrap_or_default();
|
||||
let searx_url = ctx
|
||||
.searx_url
|
||||
.as_deref()
|
||||
.map(ProviderInput::from)
|
||||
.unwrap_or_default();
|
||||
let searx_focus = usize::from(ctx.searx_url.is_some());
|
||||
Self {
|
||||
request_frame,
|
||||
@@ -513,9 +517,10 @@ impl SetupWizard {
|
||||
self.go(Page::Test);
|
||||
self.test = CheckState::Running;
|
||||
let base = self.base_url.clone();
|
||||
let key = self
|
||||
.api_key()
|
||||
.or_else(|| self.endpoint_edit().and_then(|edit| edit.stored_key.clone()));
|
||||
let key = self.api_key().or_else(|| {
|
||||
self.endpoint_edit()
|
||||
.and_then(|edit| edit.stored_key.clone())
|
||||
});
|
||||
self.pending = Some(Box::pin(async move {
|
||||
Outcome::Check(setup_net::fetch_models(base, key).await)
|
||||
}));
|
||||
@@ -532,7 +537,10 @@ impl SetupWizard {
|
||||
let prefix = format!("model_providers.{provider_id}");
|
||||
let mut edits = vec![
|
||||
replace_config_value(format!("{prefix}.name"), serde_json::json!(name)),
|
||||
replace_config_value(format!("{prefix}.base_url"), serde_json::json!(self.base_url)),
|
||||
replace_config_value(
|
||||
format!("{prefix}.base_url"),
|
||||
serde_json::json!(self.base_url),
|
||||
),
|
||||
];
|
||||
if self.endpoint_edit().is_none() {
|
||||
edits.push(replace_config_value(
|
||||
@@ -1328,7 +1336,14 @@ impl SetupWizard {
|
||||
Page::Endpoint => vec![
|
||||
("tab/↑/↓", "campo"),
|
||||
("invio", "avanti"),
|
||||
("esc", if self.endpoint_mode() { "annulla" } else { "indietro" }),
|
||||
(
|
||||
"esc",
|
||||
if self.endpoint_mode() {
|
||||
"annulla"
|
||||
} else {
|
||||
"indietro"
|
||||
},
|
||||
),
|
||||
],
|
||||
Page::Model if self.models == ModelsState::Loading => vec![("esc", "indietro")],
|
||||
Page::Model if self.model_input_active() => {
|
||||
@@ -1614,7 +1629,9 @@ impl SetupWizard {
|
||||
lines.push(Line::default());
|
||||
match &self.test {
|
||||
CheckState::Idle | CheckState::Running if self.endpoint_mode() => {
|
||||
lines.push(Line::from("Richiesta dell'elenco dei modelli (/models)…".dim()));
|
||||
lines.push(Line::from(
|
||||
"Richiesta dell'elenco dei modelli (/models)…".dim(),
|
||||
));
|
||||
}
|
||||
CheckState::Ok if self.endpoint_mode() => {
|
||||
lines.push(Line::from(vec![
|
||||
|
||||
@@ -487,8 +487,13 @@ fn endpoint_mode_edits_keep_the_key_out_of_config() {
|
||||
type_text(&mut wizard, SECRET);
|
||||
wizard.base_url = "https://mega-link.cloud/v1".to_string();
|
||||
let edits = wizard.endpoint_config_edits("giulio", "Giulio", true);
|
||||
let json = serde_json::to_string(&edits.iter().map(|e| (&e.key_path, &e.value)).collect::<Vec<_>>())
|
||||
.expect("serialize");
|
||||
let json = serde_json::to_string(
|
||||
&edits
|
||||
.iter()
|
||||
.map(|e| (&e.key_path, &e.value))
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.expect("serialize");
|
||||
assert!(!json.contains(SECRET));
|
||||
assert!(json.contains("model_providers.giulio.api_key"));
|
||||
assert!(!json.contains("model_providers.giulio.models"));
|
||||
@@ -509,5 +514,10 @@ fn configured_searxng_is_prefilled_and_kept() {
|
||||
let text = render(&wizard, 80, 14);
|
||||
assert!(text.contains("http://192.168.40.57:8080"));
|
||||
assert!(text.contains("› [ Mantieni ]"));
|
||||
assert!(wizard.config_edits("p", "P", false).iter().all(|e| e.key_path != "web_search"));
|
||||
assert!(
|
||||
wizard
|
||||
.config_edits("p", "P", false)
|
||||
.iter()
|
||||
.all(|e| e.key_path != "web_search")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ expression: rendered
|
||||
|
||||
Scegli i colori; potrai cambiarli con /theme.
|
||||
|
||||
1. Automatico │ ▄▄████▄▄ aKode v0.1.0
|
||||
1. Automatico │ ▄▄████▄▄ aKode v0.2.0
|
||||
2. Scuro │ ██▀▀██▀▀██ qwen3.6-35b-a3b
|
||||
3. Chiaro │ ██▄▄██▄▄██ ~/progetto
|
||||
4. Alto contrasto │ ██▀████▀██
|
||||
|
||||
@@ -7,7 +7,7 @@ expression: rendered
|
||||
|
||||
Scegli i colori; potrai cambiarli con /theme.
|
||||
|
||||
1. Automatico │ ▄▄████▄▄ aKode v0.1.0
|
||||
1. Automatico │ ▄▄████▄▄ aKode v0.2.0
|
||||
2. Scuro │ ██▀▀██▀▀██ qwen3.6-35b-a3b
|
||||
3. Chiaro │ ██▄▄██▄▄██ ~/progetto
|
||||
4. Alto contrasto │ ██▀████▀██
|
||||
|
||||
@@ -88,7 +88,10 @@ async fn configured_welcome_opt_out_disables_splash() -> anyhow::Result<()> {
|
||||
// aKode: the splash is opt-in (`[tui.effects] welcome = true`).
|
||||
("", false),
|
||||
("[tui.effects]\nwelcome = true\n", true),
|
||||
("[tui]\nanimations = false\n[tui.effects]\nwelcome = true\n", false),
|
||||
(
|
||||
"[tui]\nanimations = false\n[tui.effects]\nwelcome = true\n",
|
||||
false,
|
||||
),
|
||||
("[tui.effects]\nwelcome = false\n", false),
|
||||
(
|
||||
"[tui]\nanimations = false\n[tui.effects]\nwelcome = false\n",
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
---
|
||||
source: tui/src/status/tests.rs
|
||||
assertion_line: 1270
|
||||
expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning high, summaries detailed)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Server: Local background server
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Server: unix:///tmp/codex-home/app-server-control/app-server-
|
||||
control.sock (v0.133.0)
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
---
|
||||
source: tui/src/status/tests.rs
|
||||
assertion_line: 1079
|
||||
expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: ガパガパガパガ
|
||||
パ-model (reasoning
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning high, summaries
|
||||
detailed)
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning medium, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
@@ -4,7 +4,7 @@ expression: sanitized
|
||||
---
|
||||
/status
|
||||
|
||||
>_ aKode (v0.1.0)
|
||||
>_ aKode (v0.2.0)
|
||||
|
||||
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
|
||||
Directory: [[workspace]]
|
||||
|
||||
Reference in New Issue
Block a user