Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9d53b00
Quote-aware Gemma strip, symmetric unstarted cleanup, ReDoS anchor
danielhanchen Jun 23, 2026
f2c578f
Tighten comments on the tool-strip and streaming paths
danielhanchen Jun 23, 2026
3215482
Harden Gemma parse/strip: span-aware XML fallback and quote-aware str…
danielhanchen Jun 24, 2026
a06bbd5
Avoid remainder copy in _strip_gemma_native_spans
danielhanchen Jun 25, 2026
d096419
Merge remote-tracking branch 'origin/main' into gemma4-stream-review-…
danielhanchen Jun 25, 2026
75ce5bb
Exclude unclosed Gemma/JSON starts from the XML tool-call fallback
danielhanchen Jun 25, 2026
75a5258
Skip doomed tool-strip passes to avoid quadratic rescans
danielhanchen Jun 27, 2026
939614e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2026
2bd13b9
Use full tool-call envelopes to close nested-XML escape variants
danielhanchen Jun 27, 2026
9cca79b
Fix non-final Gemma strip and missing-close recovery for PR #6611
danielhanchen Jun 27, 2026
beff0f3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2026
8332c58
Merge branch 'main' into gemma4-stream-review-followups
danielhanchen Jul 1, 2026
3a55738
Block gap-nested tool markers and fix XML strip order for PR #6611
danielhanchen Jul 1, 2026
4502c4e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 1, 2026
b3b1723
Strip closed tool blocks before the Gemma final sweep for PR #6611
danielhanchen Jul 1, 2026
bddc1af
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 1, 2026
5166947
Recover XML/JSON siblings after a close-less tool marker for PR #6611
danielhanchen Jul 1, 2026
b87e247
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 1, 2026
99a0303
Merge remote-tracking branch 'origin/main' into pr6611-main-update
danielhanchen Jul 3, 2026
c4bc02c
Merge origin/main (tool-call healing passthrough) into gemma4-stream-…
danielhanchen Jul 4, 2026
7f448a4
Make the closed-block strip pre-pass Gemma-span-aware
danielhanchen Jul 4, 2026
52a935e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 4, 2026
7162480
Trim comments in the Gemma streaming and strip pipeline to essentials
danielhanchen Jul 5, 2026
4507884
Tighten comments in the Gemma strip and streaming disconnect paths
danielhanchen Jul 6, 2026
a740531
Fold marker-collection comment to two lines
danielhanchen Jul 6, 2026
7c25799
Merge main into gemma4-stream-review-followups
danielhanchen Jul 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions studio/backend/core/inference/tool_call_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,23 @@ def parse_tool_calls_from_text(

# Formats tool_healing does not cover: ``<function name="...">`` (MiniCPM-5 / MiniMax-M2),
# Llama-3 and Mistral. Run only after tool_healing found nothing, so a strict-rejected
# call is never re-healed here.
# call is never re-healed here. Blank any JSON/Gemma marker coverage first: markup inside
# a marker's span (even one that failed to parse) is that call's data, not a sibling, so
# a nested ``<function=...>`` / ``<|python_tag|>`` / ``[TOOL_CALLS]`` must not be promoted.
fallback_content = content
coverage = _tool_healing.marker_coverage(content)
if coverage:
chars = list(content)
for cov_start, cov_end in coverage:
for i in range(cov_start, min(cov_end, len(chars))):
chars[i] = " "
fallback_content = "".join(chars)
for parser in (
_parse_function_xml, # <function name="..."> attribute form
_parse_llama3_python_tag, # Llama-3 <|python_tag|>
_parse_mistral_tool_calls, # Mistral [TOOL_CALLS]
):
calls = parser(content, id_offset = id_offset, allow_incomplete = allow_incomplete)
calls = parser(fallback_content, id_offset = id_offset, allow_incomplete = allow_incomplete)
if calls:
return calls

Expand Down
Loading
Loading