From 1e7acb7ec2dc07bbdd409090dfd1e869aa2f12b3 Mon Sep 17 00:00:00 2001 From: veguAI <152010387+vegu-ai-tools@users.noreply.github.com> Date: Sun, 7 Jun 2026 16:09:36 +0300 Subject: [PATCH] Indicate template-applied reasoning specs with chips in client UX (#38) (#39) * feature: indicate template-applied reasoning specs with chips in client UX (#38) * fix: sync reasoning from_template flags on in-modal template switch; move chips above inputs (#38) * style: reasoning template chips use text variant and small size (#38) --- CHANGELOG.yaml | 1 + src/talemate/client/base.py | 6 ++++++ src/talemate/server/config.py | 6 ++++++ .../src/components/ClientModal.vue | 20 +++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/CHANGELOG.yaml b/CHANGELOG.yaml index 93f33e3e..6a209c39 100644 --- a/CHANGELOG.yaml +++ b/CHANGELOG.yaml @@ -37,6 +37,7 @@ - "More Autocomplete Fields: The character actor's Add Dialogue Example field and the world editor's World information field now support autocomplete (Ctrl+Enter), with the same hint and Redo/Undo affordances as other generated fields." - "Response Length Enforcement: Added an Adaptive option to the client's response-length setting, now the default. When reasoning is enabled it relies on length instructions alone, which reasoning models follow well, and drops the token cap that could otherwise cut a response off while the model is still thinking. With reasoning off it falls back to capping tokens and sending instructions." - "Reasoning Validation Pattern: Clients can now define a pattern marking the start of a model's reasoning, alongside the existing strip pattern. When a model doesn't actually reason (as can happen with abliterated variants), its response is accepted as-is instead of erroring out. Built-in templates for Qwen, Gemma, GPT-OSS, and Seed set it automatically." + - "Reasoning Template Defaults Indicator: When a model's prompt template supplies a default strip or validation pattern (as the built-in Qwen, Gemma, GPT-OSS, and Seed templates do), the client's Reasoning tab now shows a 'Template default' chip beneath the field — with a tooltip naming the template — so it's clear the value is template-provided rather than only hinted at by the field placeholder. The chip disappears once you enter a custom value." changes: - "World State Snapshot Cadence: The snapshot now refreshes per individual character turn rather than per full scene round. The default interval was raised from 5 to 10 to keep the effective cadence comparable." fixes: diff --git a/src/talemate/client/base.py b/src/talemate/client/base.py index 872d5e1e..602a8a28 100644 --- a/src/talemate/client/base.py +++ b/src/talemate/client/base.py @@ -992,9 +992,15 @@ class ClientBase: "reason_response_pattern_default": ( prompt_template_spec.reasoning_pattern or DEFAULT_REASONING_PATTERN ), + "reason_response_pattern_from_template": bool( + prompt_template_spec.reasoning_pattern + ), "reason_validation_pattern_default": ( prompt_template_spec.reasoning_validation_pattern ), + "reason_validation_pattern_from_template": bool( + prompt_template_spec.reasoning_validation_pattern + ), "meta": self.Meta().model_dump(), "error_action": None, "double_coercion": self.double_coercion, diff --git a/src/talemate/server/config.py b/src/talemate/server/config.py index fa4590a8..86dee04a 100644 --- a/src/talemate/server/config.py +++ b/src/talemate/server/config.py @@ -271,9 +271,15 @@ class ConfigPlugin(Plugin): "reason_response_pattern_default": ( spec.reasoning_pattern or DEFAULT_REASONING_PATTERN ), + "reason_response_pattern_from_template": bool( + spec.reasoning_pattern + ), "reason_validation_pattern_default": ( spec.reasoning_validation_pattern ), + "reason_validation_pattern_from_template": bool( + spec.reasoning_validation_pattern + ), }, } ) diff --git a/talemate_frontend/src/components/ClientModal.vue b/talemate_frontend/src/components/ClientModal.vue index 146232ad..bda6d869 100644 --- a/talemate_frontend/src/components/ClientModal.vue +++ b/talemate_frontend/src/components/ClientModal.vue @@ -211,9 +211,23 @@ + + Template default: {{ client.data.reason_response_pattern_default }} + + This strip pattern is provided by the model's prompt template{{ client.data.template_file ? ' (' + client.data.template_file + ')' : '' }} and is currently in effect because you haven't set a custom value. Enter a pattern below to override it. + + + + Template default: {{ client.data.reason_validation_pattern_default }} + + This validation pattern is provided by the model's prompt template{{ client.data.template_file ? ' (' + client.data.template_file + ')' : '' }} and is currently in effect because you haven't set a custom value. Enter a pattern below to override it. + + @@ -729,6 +743,12 @@ export default { if (data.data.reason_validation_pattern_default !== undefined) { this.client.data.reason_validation_pattern_default = data.data.reason_validation_pattern_default; } + if (data.data.reason_response_pattern_from_template !== undefined) { + this.client.data.reason_response_pattern_from_template = data.data.reason_response_pattern_from_template; + } + if (data.data.reason_validation_pattern_from_template !== undefined) { + this.client.data.reason_validation_pattern_from_template = data.data.reason_validation_pattern_from_template; + } this.waitingForTemplateSelection = false; } else if (data.type === 'config' && data.action === 'std_llm_templates') { console.log("Got std templates", data.data.templates);