From 2a72d94f399e721c3bd673a830373b1682c406a1 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Thu, 23 Jul 2026 15:29:15 +1000 Subject: [PATCH] fix(desktop): resync Share model field when served model changes The card mirrored the running node's modelId into the field only when the field was empty, so switching models (node restarts on the new one) left the field showing the stale model. Sync whenever the served model differs from the field; safe from clobbering a mid-edit because the field is disabled while the slot is occupied. --- .../mesh-compute/ui/MeshComputeSettingsCard.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx b/desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx index 1ca81c43b0..30c543e245 100644 --- a/desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx +++ b/desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx @@ -125,9 +125,17 @@ export function MeshComputeSettingsCard() { }, []); // Mirror the running node's modelId back into the field so the card shows - // what's actually being served, even after a fresh app load. + // what's ACTUALLY being served — not just on a fresh load (empty field) but + // whenever the served model differs from the field (e.g. the member switched + // models and the node restarted on the new one). This is safe from clobbering + // a mid-edit because the field is disabled whenever the slot is occupied + // (`controlsDisabled`), so the user can't be typing while a node is running. React.useEffect(() => { - if (status?.state === "running" && status.modelId && modelInput === "") { + if ( + status?.state === "running" && + status.modelId && + status.modelId !== modelInput + ) { setModelInput(status.modelId); writeDraft(MODEL_DRAFT_STORAGE_KEY, status.modelId); }