From cb6780e1705cd276ae9ade28bdd2b064ab5e7aae Mon Sep 17 00:00:00 2001 From: hermes-agent Date: Sun, 24 May 2026 19:21:43 +0000 Subject: [PATCH] =?UTF-8?q?Stage=20406:=20fix=20conflict-resolution=20bug?= =?UTF-8?q?=20=E2=80=94=20restore=20sessionModelState=20definition=20in=20?= =?UTF-8?q?=5FhydrateBootModelDropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My earlier conflict resolution between #2716 master and #2726 PR dropped the 'const sessionModelState=...' assignment that the .then() callback body uses on 6 different lines (1596, 1600, 1601, 1607, 1608, 1610). Without it boot.js would ReferenceError on every boot. Caught by tests/test_new_chat_default_model_frontend.py::test_boot_model_hydration_prefers_active_session_over_persisted_model which I'd missed in the initial touched-tests gate. Adds the assignment back at the top of the .then() callback — semantically matches the original #2716 master shape (S.session.model → wrap in {model,model_provider} object, else null). --- static/boot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/boot.js b/static/boot.js index a405118c..5a7a21de 100644 --- a/static/boot.js +++ b/static/boot.js @@ -1587,6 +1587,9 @@ function applyBotName(){ // options are enough for first paint; the dynamic provider list can settle // after the saved session is visible. const _hydrateBootModelDropdown=()=>populateModelDropdown({preferProfileDefaultOnFreshBoot:true}).then(()=>{ + const sessionModelState=S.session&&S.session.model + ? {model:S.session.model,model_provider:S.session.model_provider||null} + : null; const savedState=(typeof _readPersistedModelState==='function') ? _readPersistedModelState() : (localStorage.getItem('hermes-webui-model')?{model:localStorage.getItem('hermes-webui-model'),model_provider:null}:null);