From 9d03d35eadbc1c5bdd8a1cde8397e7ed61791a33 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 10 Aug 2026 18:41:03 +0200 Subject: feat: list and route models through every configured provider Metadata now resolves models.ini over provider defaults over presets.ini, so a local model keeps getting its context and vision from the preset while remaining overridable. A model whose vision support is unknown no longer blocks an attachment: unknown is not the same as no, and the API will reject an image if it really cannot take one. Key resolution moves to the worker thread so a pass: key's pinentry never freezes the GUI. KeyResolver gains a lock since StreamWorker and TitleWorker can now overlap. Skipped providers surface in the status bar rather than only on stderr. model_info uses dataclasses.replace to avoid mutating the ModelInfo that resolve() may return from the store. Co-Authored-By: Claude Opus 5 --- test_llamachat.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test_llamachat.py') diff --git a/test_llamachat.py b/test_llamachat.py index 18b6f0a..98776b8 100755 --- a/test_llamachat.py +++ b/test_llamachat.py @@ -646,6 +646,7 @@ def test_sidebar_toggle(): from llamachat import backend as _backend from llamachat import config as _config + from llamachat import models as _models from llamachat.ui import ChatWindow app = QApplication.instance() or QApplication([]) @@ -660,10 +661,11 @@ def test_sidebar_toggle(): assert cfg.state_path.parent == Path(tmp), cfg.state_path history = db.History(cfg.db_path) - client = _backend.Client(cfg.base_url) + client = _backend.MultiClient(cfg.providers, cfg.request_timeout) presets = _config.parse_presets(cfg.presets_path) + store = _models.ModelStore(cfg.models_path) - window = ChatWindow(cfg, history, client, presets) + window = ChatWindow(cfg, history, client, presets, store) window.resize(1000, 700) # The shortcut must be registered on the window itself. @@ -704,7 +706,7 @@ def test_sidebar_toggle(): # Hidden state and width must come back on the next start. window.sidebar_button.setChecked(False) window._save_layout() - restored = ChatWindow(cfg, history, client, presets) + restored = ChatWindow(cfg, history, client, presets, store) assert not restored.sidebar_button.isChecked() assert restored.sidebar_width == 333, restored.sidebar_width @@ -723,6 +725,7 @@ def test_shortcuts(): from llamachat import backend as _backend from llamachat import config as _config + from llamachat import models as _models from llamachat.ui import ChatWindow app = QApplication.instance() or QApplication([]) @@ -735,8 +738,9 @@ def test_shortcuts(): window = ChatWindow( cfg, history, - _backend.Client(cfg.base_url), + _backend.MultiClient(cfg.providers, cfg.request_timeout), _config.parse_presets(cfg.presets_path), + _models.ModelStore(cfg.models_path), ) window.resize(1000, 700) window.show() -- cgit v1.2.3