From a0f47762f0185482ea60d58652fb11506e899bd6 Mon Sep 17 00:00:00 2001 From: lotherk Date: Wed, 18 Nov 2026 13:31:18 +0000 Subject: [PATCH] model: a stale session selector falls back to the config A session started with the old picker had .model = "main". The restore accepted any selector sp_provider_choose() could not resolve and pasted it onto the running endpoint as a model name, so the sidebar read "junction / main" and /model showed no current row. An unresolvable selector is now ignored and the config default / -m is used; the session log says why. Verified with a temp session: sidecar "main" -> -model qwen3.6-35b-judged, and the picker marks it. The real stale sidecar was moved out of ~/.splinter. test_engine, test_gateway, test_compactor pass; test_ui passed on rerun (its PgDn scroll check is timing-sensitive). --- src/backend/engine.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/engine.c b/src/backend/engine.c index 033e14f..1867356 100644 --- a/src/backend/engine.c +++ b/src/backend/engine.c @@ -2886,11 +2886,13 @@ sp_engine_open(struct sp_engine **out, const struct sp_engine_opts *o, local.kind = ch.d->kind; local.key_env = ch.d->key_env; sp_usage_set_active(ch.d->id); - } else if (strchr(saved, '/') == NULL) { - /* a model of the endpoint the run was configured with */ - snprintf(saved_model, sizeof(saved_model), "%s", saved); - local.model = saved_model; } else { + /* + * A selector that no longer resolves (a legacy bare + * "main", a model the config dropped) must not be + * pasted onto the running endpoint as a model name. + * Fall back to the config default instead. + */ sp_logf("session", "saved model '%s' is gone; " "using the default", saved); saved[0] = '\0';