Skip to content

Fix jinja error on case-insensitive roles and 0-len messages result#2201

Open
Reithan wants to merge 2 commits into
LostRuins:concedofrom
Reithan:fix-case-sensitive-jinja-roles
Open

Fix jinja error on case-insensitive roles and 0-len messages result#2201
Reithan wants to merge 2 commits into
LostRuins:concedofrom
Reithan:fix-case-sensitive-jinja-roles

Conversation

@Reithan
Copy link
Copy Markdown

@Reithan Reithan commented May 11, 2026

Code is not detecting "Assistant" from ST.

When it is fixed, Jinja template errors consistently if there is only 1 assistant message, due to Jinja formatting failed: list object has no element 0

Both fixed

@Reithan Reithan marked this pull request as draft May 11, 2026 23:06
@Reithan Reithan marked this pull request as ready for review May 11, 2026 23:20
@Reithan Reithan marked this pull request as draft May 11, 2026 23:24
@Reithan Reithan marked this pull request as ready for review May 11, 2026 23:46
@LostRuins
Copy link
Copy Markdown
Owner

Why >1 and not >=1? Prefilling a single turn should be legal too.

@Reithan
Copy link
Copy Markdown
Author

Reithan commented May 12, 2026

If == 1, after you run the prefill, the turn array is empty and Jinja throws an error.

Jinja formatting failed: list object has no element 0

@Reithan
Copy link
Copy Markdown
Author

Reithan commented May 12, 2026

Possibly there's a better resolution for this, because the variability on what the jinja template you're using may or may not support is pretty big.

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.

2 participants