Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Load-replacement contract: read the rollback guard, not its one-line spelling (#11817)

Daniel Handf946e0864d2
diff --git a/studio/frontend/tests/chat-model-load-replacement.test.ts b/studio/frontend/tests/chat-model-load-replacement.test.ts
index 793acdaf154..0060c122aea 100644
--- a/studio/frontend/tests/chat-model-load-replacement.test.ts
+++ b/studio/frontend/tests/chat-model-load-replacement.test.ts
@@ -135,7 +135,9 @@ const contracts: Contract[] = [
match: [["runtime", /residentUnloaded\?: boolean;/],
["inherit", /residentUnloaded: cancelledRun\.residentModelUnloaded,/], ["registration", /residentModelUnloaded: inheritedPendingRollback\?\.residentUnloaded === true,/],
["loadGate", /let previousWasUnloaded =\n\s*inheritedPendingRollback\?\.residentUnloaded === true;/],
- ["runtime", /if \(previousWasUnloaded && previousCheckpoint\) \{/]] },
+ // The rollback is gated on the inherited unloaded state; further guards (#11729's
+ // answered-failure check) may follow, and the formatter may wrap the condition.
+ ["runtime", /if \(\s*previousWasUnloaded &&\s*previousCheckpoint\s*(?:&&|\))/]] },
{ name: "a failed cancellation clears the rollback the replacement would inherit",
match: [["loop", /pendingReplacementRollback = null;/], ["loop", /if \(throwOnError\) throw new Error\(message\);/]],
order: [["loop", "pendingReplacementRollback = null;", "if (throwOnError) throw new Error(message);"]] },