llm: drop model/agent scope matching; add instance-wide compaction model picker
Nightly Build / build (push) Successful in 6m50s

Remove the scope system end-to-end (llm_models.scope column, agent meta
scope field, scope-based tier in model selection, UI checkboxes/pills):
it was only a soft ranking hint, had drifted (6 UI scopes vs 3 used by
agents, 'general' not even selectable) and duplicated what strength
already decides. Strength stays the single AUTO-selection axis.

Compaction: the summary model is now pickable from the Settings page
via a new PropertyType::LlmModel config property (registry key
compaction_model), instance-wide and live (no restart). Fallback chain:
explicit pick -> compaction.strength from config.yml -> priority order;
a deleted configured model degrades to AUTO. ContextCompactor reads the
key at compact time through GlobalConfigManager.
This commit is contained in:
2026-07-25 10:48:09 +01:00
parent 9dafc4bfaa
commit 5081ec2afe
39 changed files with 174 additions and 160 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ pub async fn get(
meta.localize(&locale);
let prompt = skald_core::agents::load_prompt(&id)?;
let all = skald.llm_manager().list_models_info().await;
let models = sort_models_for_agent(all, meta.scope.as_deref(), meta.strength);
let models = sort_models_for_agent(all, meta.strength);
Ok(Json(AgentDetail { meta, prompt, models }))
}
+10
View File
@@ -65,6 +65,15 @@ pub async fn list_properties(
name: skald_core::i18n::native_language_name(code),
})
.collect::<Vec<_>>();
// Configured LLM models, keyed by `name` (the resolution key LlmManager
// uses), labelled with the provider for disambiguation.
let llm_models = skald.llm_manager().list_models_info().await
.into_iter()
.map(|m| SelectOption {
id: m.name.clone(),
name: format!("{} ({})", m.name, m.provider_name),
})
.collect::<Vec<_>>();
let mut sets = Vec::with_capacity(skald.config_properties().len());
for set in skald.config_properties() {
@@ -78,6 +87,7 @@ pub async fn list_properties(
PropertyType::String => ("string", None),
PropertyType::SecurityGroup => ("security_group", Some(security_groups.clone())),
PropertyType::Locale => ("locale", Some(locales.clone())),
PropertyType::LlmModel => ("llm_model", Some(llm_models.clone())),
};
props.push(PropertyView {
key: prop.key.clone(),
-2
View File
@@ -162,7 +162,6 @@ pub struct ModelPayload {
pub model_id: String,
pub name: String,
pub strength: Option<String>,
pub scope: Option<Vec<String>>,
pub is_default: Option<bool>,
pub priority: Option<i32>,
pub extra_params: Option<serde_json::Value>,
@@ -184,7 +183,6 @@ impl TryFrom<ModelPayload> for LlmModelRecord {
model_id: p.model_id.clone(),
name: if p.name.is_empty() { p.model_id } else { p.name },
strength: p.strength.as_deref().map(parse_strength).transpose()?,
scope: p.scope.unwrap_or_default(),
is_default: p.is_default.unwrap_or(false),
priority: p.priority.unwrap_or(100),
extra_params: p.extra_params,