Craft Anything: understand how any software works, and craft your own.
Rust
Type in a model the list doesn't offer in Settings → AI (#730)
BFlat085b7029a549
diff --git a/crates/ui-egui/src/fr.tsv b/crates/ui-egui/src/fr.tsvindex a87b641a..1372dddd 100644--- a/crates/ui-egui/src/fr.tsv+++ b/crates/ui-egui/src/fr.tsv@@ -851,3 +851,4 @@ Clear finished Effacer les terminéesProviders FournisseursHarnesses AgentsNothing of this kind was found. Rien de ce type n'a été trouvé.+Another model Autre modèlediff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsvindex 4959ae94..42244aed 100644--- a/crates/ui-egui/src/i18n/cs.tsv+++ b/crates/ui-egui/src/i18n/cs.tsv@@ -1416,3 +1416,4 @@ your files there are the app, edited in place vaše soubory ve složce jsou apliProviders PoskytovateléHarnesses AgentiNothing of this kind was found. Nic takového nebylo nalezeno.+Another model Jiný modeldiff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsvindex 0bde36d1..f63831fb 100644--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@ -1416,3 +1416,4 @@ your files there are the app, edited in place deine Dateien dort sind die App, dProviders AnbieterHarnesses AgentenNothing of this kind was found. Nichts dieser Art wurde gefunden.+Another model Anderes Modelldiff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsvindex 6db33edb..5ebc002e 100644--- a/crates/ui-egui/src/i18n/ko.tsv+++ b/crates/ui-egui/src/i18n/ko.tsv@@ -1416,3 +1416,4 @@ your files there are the app, edited in place 그 파일이 곧 앱이며 그Providers 제공자Harnesses 에이전트Nothing of this kind was found. 이런 종류는 찾지 못했습니다.+Another model 다른 모델diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsvindex d3b6d671..edc1ae3d 100644--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@ -1416,3 +1416,4 @@ your files there are the app, edited in place ваши файлы там — эProviders ПровайдерыHarnesses АгентыNothing of this kind was found. Ничего такого не найдено.+Another model Другая модельdiff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex daae9832..3eed9504 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -1416,3 +1416,4 @@ your files there are the app, edited in place 该位置的文件就是应用,Providers 提供商Harnesses 代理Nothing of this kind was found. 没有找到这类项目。+Another model 其他模型diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex a4e5b2cf..a408d01a 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -1416,3 +1416,4 @@ your files there are the app, edited in place 該位置的檔案就是應用程Providers 供應商Harnesses 代理Nothing of this kind was found. 沒有找到這類項目。+Another model 其他模型diff --git a/crates/ui-egui/src/ja.tsv b/crates/ui-egui/src/ja.tsvindex 77eb4193..79f63ae1 100644--- a/crates/ui-egui/src/ja.tsv+++ b/crates/ui-egui/src/ja.tsv@@ -853,3 +853,4 @@ your files there are the app, edited in place そこにあるファイルがアProviders プロバイダHarnesses ハーネスNothing of this kind was found. この種類のものは見つかりませんでした。+Another model 別のモデルdiff --git a/crates/ui-egui/src/settings_ui.rs b/crates/ui-egui/src/settings_ui.rsindex 856710e3..d752dca6 100644--- a/crates/ui-egui/src/settings_ui.rs+++ b/crates/ui-egui/src/settings_ui.rs@@ -478,6 +478,18 @@ fn ai(app: &mut CraftApp, ui: &mut Ui) {}}});+ // A model the list doesn't offer: a newer one, a variant such as+ // `opusplan`, or one another harness serves (#470).+ let id = egui::Id::new(("other-model", &b.name));+ let mut other = ui.data_mut(|d| d.get_temp::<String>(id)).unwrap_or_default();+ let label = ui.label(RichText::new(tr("Another model")).color(t.text_faint).size(theme::CAPTION));+ let r = ui.add(egui::TextEdit::singleline(&mut other).desired_width(140.0)).labelled_by(label.id);+ let entered = r.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter));+ if (widgets::link(ui, "Use").clicked() || entered) && !other.trim().is_empty() && other.trim() != current {+ chosen_model = Some((b.name.clone(), other.trim().to_string()));+ other.clear();+ }+ ui.data_mut(|d| d.insert_temp(id, other));if widgets::link(ui, "Cancel").clicked() {close_picker = true;}diff --git a/crates/ui-egui/tests/smoke.rs b/crates/ui-egui/tests/smoke.rsindex 056f264e..ed3d02f5 100644--- a/crates/ui-egui/tests/smoke.rs+++ b/crates/ui-egui/tests/smoke.rs@@ -1089,6 +1089,31 @@ fn an_ais_model_is_changed_in_settings() {assert!(h.state().model_picker.is_none(), "the picker closes once a model is chosen");}+/// #470: a model the list doesn't offer can be typed in.+#[test]+fn a_model_the_list_doesnt_offer_can_be_typed_in() {+ let url = model_server();+ let mut h = harness(move || {+ let mut a = demo::app(demo::engine(Mode::Experienced, true));+ a.hub.add_server("Box", &url, Some("nomic-embed-text"), None).unwrap();+ a.state.settings_open = true;+ a.state.settings_tab = craft_anything_ui_egui::state::SettingsTab::Ai;+ a+ });+ h.state_mut().refresh_backends();+ assert!(wait(&mut h, |a| a.backends.iter().any(|b| b.name == "Box")));+ h.run_steps(2);+ h.get_by_label("Change…").click();+ assert!(wait(&mut h, |a| a.model_picker.as_ref().is_some_and(|(_, m)| m.is_some())));+ h.run_steps(2);+ h.get_by_label("Another model").click();+ h.run_steps(1);+ h.get_by_label("Another model").type_text("my-own-model");+ h.run_steps(1);+ h.key_press(egui::Key::Enter);+ assert!(wait(&mut h, |a| a.backends.iter().any(|b| b.name == "Box" && b.model == "my-own-model")));+}+/// #54, #98: an AI server on another computer is added by its address in Settings → AI, with a/// model that can chat, and the form empties once it's added.#[test]diff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex 3167283f..c3327c31 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -611,9 +611,10 @@ Gaps found while using the app for real projects.bounded cleanup change has been checked with Linux stand-ins, not this Windows incident- [ ] Find why a site capture lost its browser ("the WebSocket is closed", 419 ms into`web_site_capture` for a second page, seen once; the same capture passed 41 s earlier)-- [ ] Claude Code's own extras: its Ultracode switch (a setting, not an effort level; the- effort environment variable we use can't turn it on) and its model names beyond the list- (`opusplan`, `[1m]` variants) offered in Settings → AI; `ai model` already takes any name+- [ ] Claude Code's Ultracode switch (a setting, not an effort level; the effort environment+ variable we use can't turn it on)+- [x] A model the list doesn't offer (`opusplan`, `[1m]` variants, one another harness serves) can+ be typed in beside the model list in Settings → AI, as `ai model` already allowed (#470)- [x] The preview server answers only requests addressed to this computer (a Host and Origincheck against DNS rebinding), streams large files instead of reading them into memory,sends no body for HEAD on a missing file, and caps open connections and the time a