diff --git a/engine/agents.py b/engine/agents.py index 01dfc65..0aa72c2 100644 --- a/engine/agents.py +++ b/engine/agents.py @@ -58,6 +58,17 @@ def bootstrap(): def all_agents(): + """Return live agents with their currently-assigned LLM model.""" + from . import llm as llm_mod + agents = _all_agents_raw() + for a in agents: + a["model"] = llm_mod.model_for_agent(a["id"]) + a["provider"] = llm_mod.provider_for_model(a["model"]) + return agents + + +def _all_agents_raw(): + import sqlite3 c = sqlite3.connect(db.DB_PATH, check_same_thread=False) c.row_factory = sqlite3.Row try: diff --git a/web/app.js b/web/app.js index 644d269..cb41cca 100644 --- a/web/app.js +++ b/web/app.js @@ -80,6 +80,21 @@ function draw() { } } +function shortModel(name) { + if (!name) return ''; + // Strip org/ prefix and :tag for compactness + const s = name.replace(/^.*\//, '').replace(/:latest$/, ''); + return s; +} + +function modelTag(m, provider) { + if (!m) return ''; + const isCloud = provider === 'openrouter' || (m || '').includes('/'); + const cls = isCloud ? 'cloud' : 'local'; + const label = isCloud ? '☁ ' + shortModel(m) : '💻 ' + shortModel(m); + return `${label}`; +} + function refreshAgentCards() { const wrap = document.getElementById('agentList'); wrap.innerHTML = ''; @@ -87,7 +102,8 @@ function refreshAgentCards() { const div = document.createElement('div'); div.className = 'agent-card'; div.innerHTML = ` -