When an agent's models come from several providers (Hermes and OpenCode name each one "Provider · model" or say "Provider: ..." in its description), the chat header shows a provider drop-down before the model drop-down, and the model drop-down lists only that provider's models without the provider in front. It opens on the provider of the model in use; picking a provider alone changes nothing. ui.agent_chat takes provider and reports providers and provider.
This commit is contained in:
1 parent
b5af4a80fa
commit
92dc6bc987
8 files changed
+240
-12
No files matched your search
@@ -2325,6 +2325,7 @@
|
||||
"ui.agent_chat_changes": "Changes: {n}, one undo step",
|
||||
"ui.agent_chat_changes_n": "{n} changes",
|
||||
"ui.agent_chat_changes_of": "{n}/{limit} changes",
|
||||
"ui.agent_chat_choose_model": "Choose a model",
|
||||
"ui.agent_chat_close": "Close",
|
||||
"ui.agent_chat_command": "Agent command",
|
||||
"ui.agent_chat_connect": "Connect",
|
||||
@@ -2400,6 +2401,9 @@
|
||||
"ui.agent_chat_previous_picture": "Previous picture",
|
||||
"ui.agent_chat_privacy": "Nothing goes anywhere except to the agent you run, under your own account.",
|
||||
"ui.agent_chat_privacy_note": "SolidCraft sends nothing anywhere: the agent you run talks to its own service under your own account. SolidCraft never sees or stores a key or password.",
|
||||
"ui.agent_chat_provider_models": "{count} models",
|
||||
"ui.agent_chat_provider_other": "Other",
|
||||
"ui.agent_chat_provider_tip": "The provider whose models the next list shows.",
|
||||
"ui.agent_chat_queue": "Queue",
|
||||
"ui.agent_chat_queue_full": "Too many messages are waiting: remove one or wait for the agent.",
|
||||
"ui.agent_chat_queued": "Queued",
|
||||
|
||||
@@ -2325,6 +2325,7 @@
|
||||
"ui.agent_chat_changes": "{n} 件の変更(元に戻すは1回)",
|
||||
"ui.agent_chat_changes_n": "{n} 件の変更",
|
||||
"ui.agent_chat_changes_of": "変更 {n}/{limit}",
|
||||
"ui.agent_chat_choose_model": "モデルを選択",
|
||||
"ui.agent_chat_close": "閉じる",
|
||||
"ui.agent_chat_command": "エージェントのコマンド",
|
||||
"ui.agent_chat_connect": "接続",
|
||||
@@ -2400,6 +2401,9 @@
|
||||
"ui.agent_chat_previous_picture": "前の画像",
|
||||
"ui.agent_chat_privacy": "あなたのアカウントで実行するエージェント以外には、何も送信されません。",
|
||||
"ui.agent_chat_privacy_note": "SolidCraft はどこにも何も送信しません。あなたが実行するエージェントが、あなた自身のアカウントでそのサービスと通信します。SolidCraft がキーやパスワードを見たり保存したりすることはありません。",
|
||||
"ui.agent_chat_provider_models": "{count} 個のモデル",
|
||||
"ui.agent_chat_provider_other": "その他",
|
||||
"ui.agent_chat_provider_tip": "隣の一覧にモデルを表示するプロバイダー。",
|
||||
"ui.agent_chat_queue": "待機に追加",
|
||||
"ui.agent_chat_queue_full": "待機中のメッセージが多すぎます。削除するか、エージェントの完了をお待ちください。",
|
||||
"ui.agent_chat_queued": "待機中",
|
||||
|
||||
@@ -2325,6 +2325,7 @@
|
||||
"ui.agent_chat_changes": "{n} 项更改,一步撤销",
|
||||
"ui.agent_chat_changes_n": "{n} 项更改",
|
||||
"ui.agent_chat_changes_of": "更改 {n}/{limit}",
|
||||
"ui.agent_chat_choose_model": "选择模型",
|
||||
"ui.agent_chat_close": "关闭",
|
||||
"ui.agent_chat_command": "智能体命令",
|
||||
"ui.agent_chat_connect": "连接",
|
||||
@@ -2400,6 +2401,9 @@
|
||||
"ui.agent_chat_previous_picture": "上一张图片",
|
||||
"ui.agent_chat_privacy": "除了你以自己的账户运行的智能体之外,不会向任何地方发送任何内容。",
|
||||
"ui.agent_chat_privacy_note": "SolidCraft 不向任何地方发送任何内容:你运行的智能体以你自己的账户与它自己的服务通信。SolidCraft 从不查看或保存任何密钥或密码。",
|
||||
"ui.agent_chat_provider_models": "{count} 个模型",
|
||||
"ui.agent_chat_provider_other": "其他",
|
||||
"ui.agent_chat_provider_tip": "旁边的列表显示此提供商的模型。",
|
||||
"ui.agent_chat_queue": "加入队列",
|
||||
"ui.agent_chat_queue_full": "等待中的消息太多:请删除一条,或等待智能体完成。",
|
||||
"ui.agent_chat_queued": "已排队",
|
||||
|
||||
@@ -381,6 +381,9 @@ pub struct AgentChat {
|
||||
/// The models the agent offers (none: no picker), and the current one.
|
||||
pub models: Vec<acp::ModelInfo>,
|
||||
pub model: String,
|
||||
/// The provider picked in the header when the models come from several providers (`None`: the
|
||||
/// current model's). It only narrows the model list; the agent keeps its model until one is chosen.
|
||||
pub model_provider: Option<String>,
|
||||
/// An API endpoint's models, kept per endpoint (its base URL) for the next connection.
|
||||
models_cache: std::collections::HashMap<String, Vec<acp::ModelInfo>>,
|
||||
/// The running API agent's endpoint (empty for other agents).
|
||||
@@ -626,6 +629,9 @@ impl AgentChat {
|
||||
}
|
||||
self.models = available;
|
||||
}
|
||||
if current != self.model {
|
||||
self.model_provider = None;
|
||||
}
|
||||
self.model = current;
|
||||
}
|
||||
Event::AuthRequired { methods } => {
|
||||
@@ -1639,6 +1645,7 @@ pub fn set_model(app: &mut SolveApp, model: &str) {
|
||||
b.set_model(model);
|
||||
}
|
||||
app.agent_chat.model = model.to_string();
|
||||
app.agent_chat.model_provider = None;
|
||||
let agent = app.agent_chat.running_id.clone();
|
||||
if let Some(a) = app.preferences.agents.iter_mut().find(|a| a.id == agent && a.kind.is_api()) {
|
||||
a.model = model.to_string();
|
||||
@@ -1660,6 +1667,83 @@ pub fn models_shown(app: &SolveApp) -> bool {
|
||||
!app.agent_chat.models.is_empty() && app.agent_chat.state().running()
|
||||
}
|
||||
|
||||
/// Longest provider name kept from an agent's model list.
|
||||
const PROVIDER_NAME_CAP: usize = 128;
|
||||
|
||||
/// A model's provider and its name at that provider, when the agent says which provider serves it:
|
||||
/// a name `Provider · model` (Hermes, OpenCode) or a description `Provider: …` (up to a ` • `).
|
||||
/// `None`: the agent names no provider.
|
||||
pub fn model_provider(m: &acp::ModelInfo) -> Option<(String, String)> {
|
||||
let cap = |s: &str| s.trim().chars().take(PROVIDER_NAME_CAP).collect::<String>();
|
||||
if let Some((provider, name)) = m.name.split_once(" · ")
|
||||
&& !provider.trim().is_empty()
|
||||
&& !name.trim().is_empty()
|
||||
{
|
||||
return Some((cap(provider), name.trim().to_string()));
|
||||
}
|
||||
let rest = m.description.strip_prefix("Provider:")?;
|
||||
let provider = rest.lines().next().unwrap_or("").split(" • ").next().unwrap_or("");
|
||||
(!provider.trim().is_empty()).then(|| (cap(provider), m.name.clone()))
|
||||
}
|
||||
|
||||
/// The provider a model is listed under: its own, or "Other" when the agent names none.
|
||||
fn provider_of(m: &acp::ModelInfo) -> String {
|
||||
model_provider(m).map_or_else(|| tr("ui.agent_chat_provider_other").to_string(), |(p, _)| p)
|
||||
}
|
||||
|
||||
/// The providers of the agent's models in the order the agent lists them, each with how many
|
||||
/// models it serves. Empty when the models come from fewer than two providers: one list is enough.
|
||||
pub fn model_providers(app: &SolveApp) -> Vec<(String, usize)> {
|
||||
let mut out: Vec<(String, usize)> = Vec::new();
|
||||
for m in &app.agent_chat.models {
|
||||
let p = provider_of(m);
|
||||
match out.iter_mut().find(|(n, _)| *n == p) {
|
||||
Some(e) => e.1 += 1,
|
||||
None => out.push((p, 1)),
|
||||
}
|
||||
}
|
||||
if out.len() < 2 {
|
||||
out.clear();
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The provider whose models the header lists: the one picked while the agent still offers it,
|
||||
/// else the current model's, else the first. `None` when there is no provider picker.
|
||||
pub fn shown_provider(app: &SolveApp) -> Option<String> {
|
||||
let providers = model_providers(app);
|
||||
if let Some(p) = &app.agent_chat.model_provider
|
||||
&& providers.iter().any(|(n, _)| n == p)
|
||||
{
|
||||
return Some(p.clone());
|
||||
}
|
||||
let current = app.agent_chat.models.iter().find(|m| m.id == app.agent_chat.model).map(provider_of);
|
||||
current.filter(|p| providers.iter().any(|(n, _)| n == p)).or_else(|| providers.first().map(|(n, _)| n.clone()))
|
||||
}
|
||||
|
||||
/// The models the header's model picker lists, each with the name it shows: with a provider picker,
|
||||
/// the shown provider's models without the provider in front; otherwise every model as it is named.
|
||||
#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
|
||||
pub fn listed_models(app: &SolveApp) -> Vec<(acp::ModelInfo, String)> {
|
||||
let Some(provider) = shown_provider(app) else {
|
||||
return app.agent_chat.models.iter().map(|m| (m.clone(), m.name.clone())).collect();
|
||||
};
|
||||
app.agent_chat
|
||||
.models
|
||||
.iter()
|
||||
.filter(|m| provider_of(m) == provider)
|
||||
.map(|m| (m.clone(), model_provider(m).map_or_else(|| m.name.clone(), |(_, n)| n)))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Show one provider's models in the model picker (the header's provider picker). The agent keeps
|
||||
/// its model until one of them is chosen. A provider the agent does not offer is ignored.
|
||||
pub fn set_model_provider(app: &mut SolveApp, provider: &str) {
|
||||
if model_providers(app).iter().any(|(n, _)| n == provider) {
|
||||
app.agent_chat.model_provider = Some(provider.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
/// Switch the agent to one of its own modes (the header's mode picker).
|
||||
pub fn set_mode(app: &mut SolveApp, mode: &str) {
|
||||
if app.agent_chat.modes.iter().any(|(id, _)| id == mode)
|
||||
@@ -1744,6 +1828,9 @@ pub fn control(app: &mut SolveApp, ctx: &egui::Context, p: &Value) -> Result<Val
|
||||
if let Some(m) = p.get("mode").and_then(Value::as_str) {
|
||||
set_mode(app, m);
|
||||
}
|
||||
if let Some(m) = p.get("provider").and_then(Value::as_str) {
|
||||
set_model_provider(app, m);
|
||||
}
|
||||
if let Some(m) = p.get("model").and_then(Value::as_str) {
|
||||
set_model(app, m);
|
||||
}
|
||||
@@ -1875,6 +1962,8 @@ pub fn status(app: &SolveApp) -> Value {
|
||||
"currentAgent": agents::current(app).map(|e| e.id),
|
||||
"models": c.models.iter().map(|m| json!({"id": m.id, "name": m.name, "description": m.description})).collect::<Vec<_>>(),
|
||||
"model": c.model,
|
||||
"providers": model_providers(app).iter().map(|(name, count)| json!({"name": name, "count": count})).collect::<Vec<_>>(),
|
||||
"provider": shown_provider(app),
|
||||
"modes": c.modes.iter().map(|(id, name)| json!({"id": id, "name": name})).collect::<Vec<_>>(),
|
||||
"mode": c.mode,
|
||||
"open": c.open,
|
||||
|
||||
@@ -1039,8 +1039,12 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
|e| e.name.clone(),
|
||||
);
|
||||
let models = models_shown(app);
|
||||
let w =
|
||||
(ui.available_width() - if app.agent_chat.modes.is_empty() { 4.0 } else { 116.0 } - if models { 146.0 } else { 0.0 }).clamp(90.0, 260.0);
|
||||
let providers = if models { model_providers(app) } else { Vec::new() };
|
||||
let w = (ui.available_width()
|
||||
- if app.agent_chat.modes.is_empty() { 4.0 } else { 116.0 }
|
||||
- if models { 146.0 } else { 0.0 }
|
||||
- if providers.is_empty() { 0.0 } else { 146.0 })
|
||||
.clamp(90.0, 260.0);
|
||||
let mut picked: Option<String> = None;
|
||||
let mut add = false;
|
||||
let combo = ui
|
||||
@@ -1101,17 +1105,47 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
set_mode(app, &m);
|
||||
}
|
||||
}
|
||||
// Models from several providers: pick the provider first, then one of its models.
|
||||
if let Some(shown) = shown_provider(app).filter(|_| !providers.is_empty()) {
|
||||
let mut pick: Option<String> = None;
|
||||
let width = picker_width(ui, &shown);
|
||||
let r = ui
|
||||
.allocate_ui(vec2(width, t.control_height), |ui| {
|
||||
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Truncate);
|
||||
ui_kit::dropdown_menu(ui, "sc_agent_provider", &shown, |ui| {
|
||||
for (name, count) in &providers {
|
||||
let row = ui_kit::list_picker(ui, &format!("provider:{name}"), name, *name == shown)
|
||||
.on_hover_text(trf("ui.agent_chat_provider_models", &[("count", &count.to_string())]));
|
||||
crate::scenario::publish_handle(&format!("agent_chat:provider:{name}"), row.rect.center());
|
||||
if row.clicked() {
|
||||
pick = Some(name.clone());
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
.inner;
|
||||
crate::scenario::publish_rect("agent_chat:provider", r.rect);
|
||||
crate::scenario::publish_handle("agent_chat:provider", r.rect.center());
|
||||
r.on_hover_text(tr("ui.agent_chat_provider_tip"));
|
||||
if let Some(p) = pick {
|
||||
set_model_provider(app, &p);
|
||||
}
|
||||
}
|
||||
// The agent's models (ACP `models`, or an endpoint's list): shown only when it reports some.
|
||||
if models {
|
||||
let list = app.agent_chat.models.clone();
|
||||
let cur = list.iter().find(|m| m.id == app.agent_chat.model).map_or_else(|| app.agent_chat.model.clone(), |m| m.name.clone());
|
||||
let list = listed_models(app);
|
||||
let cur = list.iter().find(|(m, _)| m.id == app.agent_chat.model).map_or_else(
|
||||
|| if providers.is_empty() { app.agent_chat.model.clone() } else { tr("ui.agent_chat_choose_model").to_string() },
|
||||
|(_, name)| name.clone(),
|
||||
);
|
||||
let mut pick: Option<String> = None;
|
||||
let width = if providers.is_empty() { t.form_label_width } else { picker_width(ui, &cur) };
|
||||
let r = ui
|
||||
.allocate_ui(vec2(t.form_label_width, t.control_height), |ui| {
|
||||
.allocate_ui(vec2(width, t.control_height), |ui| {
|
||||
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Truncate);
|
||||
ui_kit::dropdown_menu(ui, "sc_agent_model", &cur, |ui| {
|
||||
for m in &list {
|
||||
let row = ui_kit::list_picker(ui, &m.id, &m.name, m.id == app.agent_chat.model);
|
||||
for (m, name) in &list {
|
||||
let row = ui_kit::list_picker(ui, &m.id, name, m.id == app.agent_chat.model);
|
||||
let row = if m.description.is_empty() { row } else { row.on_hover_text(&m.description) };
|
||||
crate::scenario::publish_handle(&format!("agent_chat:model:{}", m.id), row.rect.center());
|
||||
if row.clicked() {
|
||||
@@ -1173,6 +1207,17 @@ pub(super) fn no_agents(ui: &mut egui::Ui) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The width of a provider or model picker: its label's, from the usual picker width up to 200
|
||||
/// points and never wider than the panel, so a short name is read whole and a long one truncates.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn picker_width(ui: &egui::Ui, label: &str) -> f32 {
|
||||
let t = Tokens::get();
|
||||
let label: String = label.chars().take(64).collect();
|
||||
let text = ui.painter().layout_no_wrap(label, egui::FontId::proportional(t.font_label), t.text).size().x + 34.0;
|
||||
let most = ui.max_rect().width().clamp(t.form_label_width, 200.0);
|
||||
text.clamp(t.form_label_width, most)
|
||||
}
|
||||
|
||||
/// Before the first connection: what's installed, how to install the rest, and Add agent.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn picker(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
@@ -1996,8 +2041,14 @@ mod tests {
|
||||
});
|
||||
app.agent_chat.modes = vec![("edit".into(), "A provider mode with a long descriptive label".into())];
|
||||
app.agent_chat.mode = "edit".into();
|
||||
app.agent_chat.models =
|
||||
vec![acp::ModelInfo { id: "model".into(), name: "A model with a long descriptive label".into(), description: String::new() }];
|
||||
app.agent_chat.models = vec![
|
||||
acp::ModelInfo {
|
||||
id: "model".into(),
|
||||
name: "A provider with a long name · A model with a long descriptive label".into(),
|
||||
description: String::new(),
|
||||
},
|
||||
acp::ModelInfo { id: "other".into(), name: "Another provider · model".into(), description: String::new() },
|
||||
];
|
||||
app.agent_chat.model = "model".into();
|
||||
let input = egui::RawInput { screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, vec2(296.0, 720.0))), ..Default::default() };
|
||||
crate::scenario::clear_handles();
|
||||
@@ -2006,7 +2057,7 @@ mod tests {
|
||||
ui_kit::scope(ui, |ui| switcher(&mut app, ui));
|
||||
});
|
||||
output.textures_delta.clear();
|
||||
let rects: Vec<_> = ["switcher", "mode", "model"]
|
||||
let rects: Vec<_> = ["switcher", "mode", "provider", "model"]
|
||||
.into_iter()
|
||||
.map(|name| {
|
||||
let rect = crate::scenario::rect_of(&format!("agent_chat:{name}")).expect("picker retained");
|
||||
|
||||
@@ -1063,6 +1063,78 @@ fn the_remembered_model_is_set_on_the_next_session() {
|
||||
assert_eq!(script.calls().len(), 1);
|
||||
}
|
||||
|
||||
fn provider_models() -> Vec<acp::ModelInfo> {
|
||||
let m = |id: &str, name: &str, description: &str| acp::ModelInfo { id: id.into(), name: name.into(), description: description.into() };
|
||||
vec![
|
||||
m("nous:anthropic/opus", "Nous Portal · anthropic/opus", "Provider: Nous Portal"),
|
||||
m("nous:deepseek/v4", "Nous Portal · deepseek/v4", "Provider: Nous Portal"),
|
||||
m("custom:host:deepseek-v4.1-flash", "deepseek-v4.1-flash", "Provider: Host • current"),
|
||||
m("custom:host:haiku", "haiku", "Provider: Host"),
|
||||
m("plain", "plain", ""),
|
||||
]
|
||||
}
|
||||
|
||||
/// Models from several providers: the header picks a provider, then one of its models, listed
|
||||
/// without the provider in front. Picking a provider alone leaves the agent's model as it is.
|
||||
#[test]
|
||||
fn models_from_several_providers_are_picked_by_provider_first() {
|
||||
let (mut app, script, ctx) = app_with_script();
|
||||
app.agent_chat.running_id = "hermes".into();
|
||||
script.report(Event::Models { current: "custom:host:deepseek-v4.1-flash".into(), available: provider_models() });
|
||||
poll(&mut app, &ctx);
|
||||
let providers = model_providers(&app);
|
||||
assert_eq!(providers, [("Nous Portal".to_string(), 2), ("Host".to_string(), 2), ("Other".to_string(), 1)]);
|
||||
assert_eq!(shown_provider(&app).as_deref(), Some("Host"), "the current model's provider");
|
||||
let names = |app: &SolveApp| listed_models(app).into_iter().map(|(_, n)| n).collect::<Vec<_>>();
|
||||
assert_eq!(names(&app), ["deepseek-v4.1-flash", "haiku"]);
|
||||
set_model_provider(&mut app, "Nous Portal");
|
||||
set_model_provider(&mut app, "nonsense");
|
||||
assert_eq!(names(&app), ["anthropic/opus", "deepseek/v4"]);
|
||||
assert!(script.calls().is_empty(), "picking a provider sends nothing");
|
||||
assert_eq!(app.agent_chat.model, "custom:host:deepseek-v4.1-flash");
|
||||
let s = status(&app);
|
||||
assert_eq!(s["provider"], "Nous Portal");
|
||||
assert_eq!(s["providers"][0], json!({"name": "Nous Portal", "count": 2}));
|
||||
set_model(&mut app, "nous:deepseek/v4");
|
||||
assert_eq!(script.calls(), ["set_model: nous:deepseek/v4"]);
|
||||
assert_eq!(shown_provider(&app).as_deref(), Some("Nous Portal"));
|
||||
// The agent switching to another provider's model shows that provider.
|
||||
set_model_provider(&mut app, "Host");
|
||||
script.report(Event::Models { current: "plain".into(), available: vec![] });
|
||||
poll(&mut app, &ctx);
|
||||
assert_eq!(shown_provider(&app).as_deref(), Some("Other"));
|
||||
assert_eq!(names(&app), ["plain"]);
|
||||
}
|
||||
|
||||
/// Models from one provider, or with none named: one list, every model as the agent names it.
|
||||
#[test]
|
||||
fn models_from_one_provider_keep_one_list() {
|
||||
let (mut app, script, ctx) = app_with_script();
|
||||
script.report(models_reply("fast"));
|
||||
poll(&mut app, &ctx);
|
||||
assert!(model_providers(&app).is_empty());
|
||||
assert_eq!(shown_provider(&app), None);
|
||||
assert_eq!(listed_models(&app).into_iter().map(|(_, n)| n).collect::<Vec<_>>(), ["FAST", "SMART"]);
|
||||
assert_eq!(status(&app)["provider"], Value::Null);
|
||||
let one = |name: &str| acp::ModelInfo { id: name.into(), name: format!("Only · {name}"), description: String::new() };
|
||||
script.report(Event::Models { current: "a".into(), available: vec![one("a"), one("b")] });
|
||||
poll(&mut app, &ctx);
|
||||
assert!(model_providers(&app).is_empty(), "a single provider needs no provider picker");
|
||||
assert_eq!(listed_models(&app)[0].1, "Only · a");
|
||||
}
|
||||
|
||||
/// A provider name from the agent is bounded, and `·` or `Provider:` without a name is no provider.
|
||||
#[test]
|
||||
fn hostile_provider_names_are_bounded() {
|
||||
let m = |name: String, description: &str| acp::ModelInfo { id: "x".into(), name, description: description.into() };
|
||||
let long = "p".repeat(10_000);
|
||||
let (provider, name) = model_provider(&m(format!("{long} · model"), "")).unwrap();
|
||||
assert_eq!((provider.chars().count(), name.as_str()), (128, "model"));
|
||||
assert_eq!(model_provider(&m(" · model".into(), "")), None);
|
||||
assert_eq!(model_provider(&m("model".into(), "Provider: ")), None);
|
||||
assert_eq!(model_provider(&m("model".into(), "Provider: A\nsecond line • current")).map(|p| p.0), Some("A".into()));
|
||||
}
|
||||
|
||||
/// An agent that reports no models gets no picker; another agent's choice is not applied to it.
|
||||
#[test]
|
||||
fn an_agent_without_models_shows_no_picker() {
|
||||
|
||||
+5
-1
@@ -57,7 +57,11 @@ clicks and scrolling over the panel stay in the chat. The docked layout retains
|
||||
model list, or an endpoint's `/models`), a model drop-down shows the one in use and changes it;
|
||||
SolidCraft remembers the last choice for each agent and puts it back on the next session. An
|
||||
endpoint's agent also keeps it as its default model. An agent that reports no models shows no
|
||||
drop-down.
|
||||
drop-down. When the models come from more than one provider (Hermes and OpenCode name each
|
||||
model `Provider · model`, or say `Provider: …` in its description), a provider drop-down comes
|
||||
first and the model drop-down lists only that provider's models, without the provider in front.
|
||||
It opens on the provider of the model in use; picking another provider changes nothing until one
|
||||
of its models is chosen. Models with no provider named are listed under *Other*.
|
||||
|
||||
Messages use right-aligned user bubbles and plain assistant text. Consecutive tool calls share
|
||||
an activity group: click a row to inspect its output; failed calls have an error tint. Approval
|
||||
|
||||
@@ -253,7 +253,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
|
||||
| `engine.execute` → `browser.expand_all` | `path?`: occurrence ids; `component?`: id; omit both for the whole tree | Open every Browser row under that scope, including folders that start closed (Origin, Named Views, Features). Display only: not saved in the design, not an undo step. |
|
||||
| `engine.execute` → `browser.collapse_all` | same | Close those rows. The design row stays open when the whole tree is collapsed. |
|
||||
| `engine.execute` → `view.history_layout` | `width?`, `dock?`: `bottom`, `left`, `under_browser`, `collapsed?` | Resize/dock the history without opening a dialog or changing the design. Contents respond to measured width; browser-stacked history shares its width and splits height equally. One folded header gives the expanded card the rest; two folded headers stay at the top. |
|
||||
| `ui.agent_chat` | `features?`, `toolbar_button?`, `permissions?` (`ask`, `edits`, `all`), `add_agent?` ({`name`, `kind`: `acp`, `api` or `anthropic` (`api` is OpenAI-compatible, `anthropic` Anthropic-compatible), `command` or `base_url` + `model` + `request_timeout_s?` (seconds one model request may take, 300 by default, rounded and clamped to 30 to 3600)}; no keys), `add_dialog?` (`installed`, `custom`, `api`, `anthropic`, or `false` to close), `default_agent?`, `agent?` (the conversation's agent, by id), `mode?` (the agent's own mode), `model?` (one of its models), `open?`, `side?` (`left`, `right`), `minimized?`, `popped?` (in its own window), `width?`, `picker?`, `refresh?`, `connect?`, `stop?`, `attach?`: a file's path (a picture, a text file or a CAD file, for the next message; CAD files are imported at once), `remove_file?` (index of a file on the next message), `send?`: text (files alone make a message too), `attach_view?`, `attach_selection?`, `pick?` (true: open the context picker), `permission?`: an option id or `"cancel"` (the newest question of the agent's own), `approve?`: true, false or `"always"` (the oldest request held for Allow/Deny), `cancel?` (Stop: the queue stays), `send_now?` (stop the running step, then send the queued messages), `remove_pending?` (index), `new_chat?` (clear the chat, new session), `undo?` (the last message's changes) | the chat's state: `features`, `agents` (found and added), `currentAgent`, `state` (off, starting, ready, busy, auth, exited), `popped`, `window` (its place and size), `agent`, `modes`, `mode`, `models`, `model`, `authMethods`, `toolsPort`, `pid`, `waiting`, `turn`, `pending` (queued messages, with their `files`), `attachments` (the files on the next message, by name), `loading` (pictures still being read for it, by name), `stopped`, `detection` and the conversation (`items`). With `features` off only the settings apply. Desktop only; see [Agent chat](agent-chat.md) |
|
||||
| `ui.agent_chat` | `features?`, `toolbar_button?`, `permissions?` (`ask`, `edits`, `all`), `add_agent?` ({`name`, `kind`: `acp`, `api` or `anthropic` (`api` is OpenAI-compatible, `anthropic` Anthropic-compatible), `command` or `base_url` + `model` + `request_timeout_s?` (seconds one model request may take, 300 by default, rounded and clamped to 30 to 3600)}; no keys), `add_dialog?` (`installed`, `custom`, `api`, `anthropic`, or `false` to close), `default_agent?`, `agent?` (the conversation's agent, by id), `mode?` (the agent's own mode), `provider?` (which provider's models the model picker lists, when they come from several), `model?` (one of its models), `open?`, `side?` (`left`, `right`), `minimized?`, `popped?` (in its own window), `width?`, `picker?`, `refresh?`, `connect?`, `stop?`, `attach?`: a file's path (a picture, a text file or a CAD file, for the next message; CAD files are imported at once), `remove_file?` (index of a file on the next message), `send?`: text (files alone make a message too), `attach_view?`, `attach_selection?`, `pick?` (true: open the context picker), `permission?`: an option id or `"cancel"` (the newest question of the agent's own), `approve?`: true, false or `"always"` (the oldest request held for Allow/Deny), `cancel?` (Stop: the queue stays), `send_now?` (stop the running step, then send the queued messages), `remove_pending?` (index), `new_chat?` (clear the chat, new session), `undo?` (the last message's changes) | the chat's state: `features`, `agents` (found and added), `currentAgent`, `state` (off, starting, ready, busy, auth, exited), `popped`, `window` (its place and size), `agent`, `modes`, `mode`, `models`, `model`, `providers` (`name` and `count` of each, empty with one provider), `provider` (the one listed), `authMethods`, `toolsPort`, `pid`, `waiting`, `turn`, `pending` (queued messages, with their `files`), `attachments` (the files on the next message, by name), `loading` (pictures still being read for it, by name), `stopped`, `detection` and the conversation (`items`). With `features` off only the settings apply. Desktop only; see [Agent chat](agent-chat.md) |
|
||||
| `ui.resize` | `width`, `height` | |
|
||||
| `app.quit` | `force?` (quit without asking about unsaved designs) | `quitting` (the window closes), `asking` (a "save changes?" prompt is open) |
|
||||
|
||||
|
||||
Reference in new issue
Block a user