fix(config): config writer silently dropped router.narration.model_id

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).
This commit is contained in:
2026-06-12 13:47:45 +04:00
parent 1a7eb05945
commit 9f43dc7022
2 changed files with 6 additions and 0 deletions
@@ -80,6 +80,7 @@ object CorrexConfigWriter {
b.kv("top_p", cfg.router.narration.topP) b.kv("top_p", cfg.router.narration.topP)
b.kv("max_tokens", cfg.router.narration.maxTokens) b.kv("max_tokens", cfg.router.narration.maxTokens)
b.kv("max_per_run", cfg.router.narration.maxPerRun) b.kv("max_per_run", cfg.router.narration.maxPerRun)
cfg.router.narration.modelId?.let { b.kv("model_id", str(it)) }
b.section("orchestration") b.section("orchestration")
b.kv("stage_timeout_ms", cfg.orchestration.stageTimeoutMs) b.kv("stage_timeout_ms", cfg.orchestration.stageTimeoutMs)
@@ -135,6 +135,11 @@ object EditableConfig {
getString = { it.router.narration.maxPerRun.toString() }, getString = { it.router.narration.maxPerRun.toString() },
withString = { c, v -> nar(c) { it.copy(maxPerRun = int("router.narration.max_per_run", v)) } }, 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( EditableField(
"personalization.enabled", ConfigFieldType.BOOL, "personalization.enabled", ConfigFieldType.BOOL,
getString = { it.personalization.enabled.toString() }, getString = { it.personalization.enabled.toString() },