Skip to content

Explain unclosed Mustache tag errors in scorer templates#203

Open
paultancre-bt wants to merge 1 commit into
mainfrom
fix/mustache-unclosed-tag-scorer
Open

Explain unclosed Mustache tag errors in scorer templates#203
paultancre-bt wants to merge 1 commit into
mainfrom
fix/mustache-unclosed-tag-scorer

Conversation

@paultancre-bt

Copy link
Copy Markdown

LLM-judge scorer templates render through renderMessages, which calls raw mustache.render. When a scorer template has an unclosed tag, users get the bare Unclosed tag at 216 — where the number is a character offset that reads as a line number. This is the error that surfaces in playground eval traces (the scorer step fails after the task prompt already succeeded).

This mirrors the enrichment we added to the api-ts proxy renderer: convert the offset to line/column and append the nearby template text, e.g.:

Unclosed tag at 57 (line 3, column 21, near "…{output}}\nExpected: {{expected…"). Check for an unclosed {{ }} tag or {{#section}} block in the template.

Non-string message content is still rendered exactly as before; only the error path changed. Test added in render-messages.test.ts.

Note: the Python side uses chevron (different error format) and is unaffected.

renderMessages surfaced the raw mustache error ("Unclosed tag at 216"),
whose number is a character offset users read as a line number. Convert
it to line/column plus a nearby snippet, matching the proxy renderer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Braintrust eval report

Autoevals (HEAD-1783000888)

Score Average Improvements Regressions
NumericDiff 78.5% (+0pp) 9 🟢 11 🔴
Time_to_first_token 10.03tok (-0.38tok) 143 🟢 76 🔴
Llm_calls 1.55 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 528.42tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 470.35tok (+3.93tok) 97 🟢 107 🔴
Completion_reasoning_tokens 358.69tok (+4.36tok) 84 🟢 89 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 998.77tok (+3.93tok) 97 🟢 107 🔴
Estimated_cost 0$ (+0$) 88 🟢 92 🔴
Duration 10.05s (-0.35s) 143 🟢 76 🔴
Llm_duration 12.11s (+0.79s) 106 🟢 113 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant