mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 21:39:54 +02:00
Remaining blocker on #4638: in duplicate mode the dialog initialized `thinkingLevel` from the template even when the template runtime was locked/missing and it fell back to a different-provider runtime. The provider-change effect skips the initial establishment (to preserve genuine pre-fill) and the catalog-based clear can't run when the fallback runtime is offline / its catalog hasn't resolved, so the stale per-provider token could be submitted and 400 (e.g. a Claude `max` on an offline Codex fallback). Fix: only clone the template's `thinking_level` when the clone actually lands on the template's own runtime — the same usability condition that governs the runtime pre-fill, now factored into a shared `landsOnTemplateRuntime` helper. On fallback to any other runtime the level starts blank, so it can never be carried over regardless of provider, online state, or catalog timing. Tests: locked template runtime → offline different-provider fallback drops the level and omits it from the payload; landing on the template runtime (offline, same provider) still preserves it. Co-authored-by: multica-agent <github@multica.ai>