You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: parse Gemma 4 <thought> reasoning tags alongside <think>
Gemma 4 streams reasoning inside <thought>...</thought> instead of
<think>...</think>. Without this the content leaks into chat text and
the agent triggers a retry on the first turn.
- TagMatcher: support multiple tag names - string[], track activeTagName so
<think> is never closed by </thought> (and vice-versa).
- base-openai-compatible-provider and openai handler: match both tags.
- Tests: <thought> parsing, cross-tag isolation, and invariants.
* fix: support nested reasoning tags in TagMatcher and add comprehensive streaming tests
* test(tag-matcher): add tests for unmatched closing tags
Add two regression tests that verify depth never goes negative:
1. stray closer with no opener
"final</think>text" → stays text
2. duplicate closer after a proper close
"<think>thinking</think>final</think>text" → second </think> stays text
Both cases ensure we only decrement depth and pop activeTagNames
when depth > 0, preventing underflow and treating the extra tag
as plain text.
* Apply suggestion from @edelauna
Co-authored-by: edelauna <54631123+edelauna@users.noreply.github.com>
* refactor(providers): updating tag matcher
* test(TagMatcher): adding tests for new logic
* test(tag-matcher): consolidate reasoning tag tests into tag-matcher.spec.ts
---------
Co-authored-by: Sagid Magomedov <sagidsmagomedov@gmail.com>
Co-authored-by: edelauna <54631123+edelauna@users.noreply.github.com>
Co-authored-by: Elliott de Launay <edelauna@gmail.com>
0 commit comments