Skip to content

Conversation

@ankrgyl
Copy link
Contributor

@ankrgyl ankrgyl commented Jan 18, 2026

No description provided.

@github-actions
Copy link

github-actions bot commented Jan 18, 2026

Braintrust eval report

Autoevals (threads-1768759658)

Score Average Improvements Regressions
NumericDiff 73.7% (+0pp) - -
Time_to_first_token 1.45tok (-0.01tok) 81 🟢 33 🔴
Llm_calls 1.55 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 279.25tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 19.3tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 298.54tok (+0tok) - -
Estimated_cost 0$ (+0$) - -
Duration 1.49s (0s) 119 🟢 98 🔴
Llm_duration 3.03s (+0.01s) 57 🟢 61 🔴

@ankrgyl ankrgyl changed the title Thread injection in trace scorers Thread injection in trace scorers (js) Jan 18, 2026
Comment on lines +35 to +46
// Pattern to match thread variables in template syntax: {{thread, {{ thread, {%...thread, etc.
export const THREAD_VARIABLE_PATTERN = new RegExp(
`\\{[\\{%]\\s*(${THREAD_VARIABLE_NAMES.join("|")})`,
);

/**
* Check if a template string might use thread-related template variables.
* This is a heuristic - looks for variable names after {{ or {% syntax.
*/
export function templateUsesThreadVariables(template: string): boolean {
return THREAD_VARIABLE_PATTERN.test(template);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edge case but if users set custom delimiters for whatever reason, this will fail:
https://github.com/mustache/spec/blob/master/specs/delimiters.yml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function shouldn't live in this repo long-term but it's fine for now.

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.

4 participants