From 9f43dc70228339deda54218eca9ee277df683fdc Mon Sep 17 00:00:00 2001 From: kami Date: Fri, 12 Jun 2026 13:47:45 +0400 Subject: [PATCH] fix(config): config writer silently dropped router.narration.model_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every TUI config-editor save regenerates the TOML through CorrexConfigWriter, whose [router.narration] section never wrote model_id — one save and narration silently fell back to the main model, queueing every narration behind slow 9B inferences (live QA: approval narrations arrived minutes late, after the workflow had already failed). The writer now persists it and the field is editable in the TUI (blank clears it). --- .../main/kotlin/com/correx/core/config/CorrexConfigWriter.kt | 1 + .../src/main/kotlin/com/correx/core/config/EditableConfig.kt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/core/config/src/main/kotlin/com/correx/core/config/CorrexConfigWriter.kt b/core/config/src/main/kotlin/com/correx/core/config/CorrexConfigWriter.kt index b09b36c0..69b3da68 100644 --- a/core/config/src/main/kotlin/com/correx/core/config/CorrexConfigWriter.kt +++ b/core/config/src/main/kotlin/com/correx/core/config/CorrexConfigWriter.kt @@ -80,6 +80,7 @@ object CorrexConfigWriter { b.kv("top_p", cfg.router.narration.topP) b.kv("max_tokens", cfg.router.narration.maxTokens) b.kv("max_per_run", cfg.router.narration.maxPerRun) + cfg.router.narration.modelId?.let { b.kv("model_id", str(it)) } b.section("orchestration") b.kv("stage_timeout_ms", cfg.orchestration.stageTimeoutMs) diff --git a/core/config/src/main/kotlin/com/correx/core/config/EditableConfig.kt b/core/config/src/main/kotlin/com/correx/core/config/EditableConfig.kt index cd9b0676..979b3484 100644 --- a/core/config/src/main/kotlin/com/correx/core/config/EditableConfig.kt +++ b/core/config/src/main/kotlin/com/correx/core/config/EditableConfig.kt @@ -135,6 +135,11 @@ object EditableConfig { getString = { it.router.narration.maxPerRun.toString() }, withString = { c, v -> nar(c) { it.copy(maxPerRun = int("router.narration.max_per_run", v)) } }, ), + EditableField( + "router.narration.model_id", ConfigFieldType.STRING, + getString = { it.router.narration.modelId.orEmpty() }, + withString = { c, v -> nar(c) { it.copy(modelId = v.trim().ifBlank { null }) } }, + ), EditableField( "personalization.enabled", ConfigFieldType.BOOL, getString = { it.personalization.enabled.toString() },