Skip to content

Commit 3bf064d

Browse files
ochafikclaude
andcommitted
Rename respects_enable_reasoning → supports_enable_thinking
More consistent with the flag name (enable_thinking) and the naming pattern of other capability flags (supports_*). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0d8d3f0 commit 3bf064d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

docs/CAPABILITIES_AND_POLYFILLS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ When a `chat_template` is constructed, minja probes the template with test messa
4343
| `supports_clear_thinking` | Template respects `clear_thinking` flag for visibility control |
4444
| `supports_reasoning_without_content` | Can emit reasoning with empty content |
4545
| `supports_reasoning_with_content` | Can emit both reasoning and content together |
46-
| `respects_enable_reasoning` | Template honors `enable_thinking=false` |
46+
| `supports_enable_thinking` | Template honors `enable_thinking=false` |
4747

4848
## Reasoning Formats
4949

include/minja/chat-template.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct chat_template_caps {
6363
// Reasoning behavior flags (computed via detection probes)
6464
bool supports_reasoning_without_content = false; // Can emit reasoning with empty/null content
6565
bool supports_reasoning_with_content = false; // Can emit both reasoning and content together
66-
bool respects_enable_reasoning = false; // Template responds to enable_thinking=false
66+
bool supports_enable_thinking = false; // Template responds to enable_thinking=false
6767

6868
// Whether template supports reasoning visibility control (GLM-4.7's clear_thinking flag)
6969
// When clear_thinking=false, all reasoning is shown; when true/default, position-based visibility
@@ -486,7 +486,7 @@ class chat_template {
486486
caps_.supports_reasoning_with_content = contains(out, reasoning_test) && contains(out, content_test);
487487
}
488488

489-
// Test respects_enable_reasoning: does template honor enable_thinking=false?
489+
// Test supports_enable_thinking: does template honor enable_thinking=false?
490490
// Only test for REASONING_CONTENT_FIELD format where this flag is commonly used (Qwen3)
491491
if (caps_.reasoning_format == ReasoningFormat::REASONING_CONTENT_FIELD) {
492492
json disable_ctx = {{"enable_thinking", false}};
@@ -495,7 +495,7 @@ class chat_template {
495495
make_reasoning_msg(reasoning_test, content_test),
496496
}), {}, false, disable_ctx);
497497
// If reasoning disappears but content remains when enable_thinking=false, template respects it
498-
caps_.respects_enable_reasoning = !contains(out, reasoning_test) && contains(out, content_test);
498+
caps_.supports_enable_thinking = !contains(out, reasoning_test) && contains(out, content_test);
499499
}
500500
}
501501

scripts/fetch_templates_and_goldens.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class TemplateCaps:
103103
# Reasoning behavior flags
104104
supports_reasoning_without_content: bool = False
105105
supports_reasoning_with_content: bool = False
106-
respects_enable_reasoning: bool = False
106+
supports_enable_thinking: bool = False
107107
supports_clear_thinking: bool = False
108108

109109
def to_json(self):
@@ -462,15 +462,15 @@ def make_reasoning_msg(reasoning: str, content: str) -> dict:
462462
out = self.try_raw_render([dummy_user_msg, make_reasoning_msg(reasoning_test, content_test)])
463463
caps.supports_reasoning_with_content = reasoning_test in out and content_test in out
464464

465-
# Test respects_enable_reasoning: does template honor enable_thinking=false?
465+
# Test supports_enable_thinking: does template honor enable_thinking=false?
466466
# Only test for REASONING_CONTENT format where this flag is commonly used (Qwen3)
467467
if caps.reasoning_format == ReasoningFormat.REASONING_CONTENT:
468468
out = self.try_raw_render(
469469
[dummy_user_msg, make_reasoning_msg(reasoning_test, content_test)],
470470
extra_context={"enable_thinking": False}
471471
)
472472
# If reasoning disappears but content remains when enable_thinking=false, template respects it
473-
caps.respects_enable_reasoning = reasoning_test not in out and content_test in out
473+
caps.supports_enable_thinking = reasoning_test not in out and content_test in out
474474

475475
self.original_caps = caps
476476

tests/test-capabilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static minja::chat_template_caps get_caps(const std::string &path)
7777
print("reasoning_requires_tools", caps.reasoning_requires_tools);
7878
print("supports_reasoning_without_content", caps.supports_reasoning_without_content);
7979
print("supports_reasoning_with_content", caps.supports_reasoning_with_content);
80-
print("respects_enable_reasoning", caps.respects_enable_reasoning);
80+
print("supports_enable_thinking", caps.supports_enable_thinking);
8181
print("supports_clear_thinking", caps.supports_clear_thinking);
8282
std::cout << " EXPECT_EQ(caps.reasoning_format, minja::ReasoningFormat::" << reasoning_format_to_string(caps.reasoning_format) << ");" << std::endl;
8383
std::cout << "}\n" << std::endl;

0 commit comments

Comments
 (0)