Harden Exact reconcile and soften post-Generate warm.

Overwrite foreign steps/cfg in sparse patches when the user did not ask for params, and skip the cold-load path when Ollama already has the chat model resident.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-23 06:58:53 +03:00
co-authored by Cursor
parent 5f33130381
commit 7aadb40a11
7 changed files with 117 additions and 35 deletions
+15 -4
View File
@@ -372,7 +372,7 @@ export function resolveExactProfileDefaults({ exact, profiles, profileName } = {
}
/**
* On generate, inject Exact profile steps/cfg/sigma when the patch omitted them.
* On generate, inject Exact profile steps/cfg/sigma when omitted, and overwrite foreign leftovers when the user did not ask for params.
* Client is authoritative so sparse LLM deltas are safe. Honors explicit patch values
* and sessionExact when the user asked for params this turn.
* Returns clearSessionKeys so the UI apply path is not blocked by stale sessionExact.
@@ -390,9 +390,20 @@ export function mergeExactParamsForGenerate(patch, {
const defaults = resolveExactProfileDefaults({ exact, profiles, profileName });
const out = { ...patch };
const clearSessionKeys = [];
for (const key of EXACT_GENERATE_PARAM_KEYS) {
if (out[key] != null) {
continue;
for (const key of EXACT_GENERATE_PARAM_KEYS) {
if (out[key] != null) {
// Sparse LLM may echo live leftovers (20/7). Without user intent, force Exact.
if (
!userParamIntent
&& defaults[key] != null
&& String(out[key]) !== String(defaults[key])
) {
out[key] = defaults[key];
if (sessionExact?.[key] != null && String(sessionExact[key]) !== String(defaults[key])) {
clearSessionKeys.push(key);
}
}
continue;
}
if (userParamIntent && sessionExact?.[key] != null) {
out[key] = sessionExact[key];