Archived
jinja2 reads `obj.0` as `obj[0]`; the engine threw "Static member property must be an identifier". GLM-5's template tests a tool result with `m.content.0.type`, and the capability probe swallows the throw, so the template came back as tools=0 tool_calls=0 and every request with `tools` was refused. The fix is llama.cpp's ae9afff8, which landed after the lifted commit, taken as it is so the next refresh drops it. vendor/patches/0021, vendor/UPSTREAM; chat_test (a_dotted_integer_is_an_index_as_in_jinja2) fails without it on both counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
724 B
Diff
18 lines
724 B
Diff
diff --git a/common/jinja/runtime.cpp b/common/jinja/runtime.cpp
|
|
index f81d98d..5a089d3 100644
|
|
--- a/common/jinja/runtime.cpp
|
|
+++ b/common/jinja/runtime.cpp
|
|
@@ -779,6 +779,12 @@ value member_expression::execute_impl(context & ctx) {
|
|
} else {
|
|
property = this->property->execute(ctx);
|
|
}
|
|
+ } else if (is_stmt<integer_literal>(this->property)) {
|
|
+ // syntax: obj.index
|
|
+ property = mk_val<value_int>(cast_stmt<integer_literal>(this->property)->val);
|
|
+ if (property->as_int() < 0) {
|
|
+ throw std::runtime_error("Static member property cannot be negative");
|
|
+ }
|
|
} else {
|
|
// syntax: obj.prop
|
|
if (!is_stmt<identifier>(this->property)) {
|