[Frontend] Parse tool calls and reasoning from checkpoint response templates (#58604)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yoni Gozlan <yonigozlan@users.noreply.github.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
Yoni Gozlan
2026-10-02 02:33:00 +00:00
committed by GitHub
co-authored by Cursor Bugen Zhao Claude Opus 5.5
parent 5a661487e2
commit 9bd993564f
18 changed files with 2298 additions and 21 deletions
+5
View File
@@ -115,6 +115,7 @@ class Parser:
tool_parser_cls: type[ToolParser] | None = None
# Server-side floor for tool-call structural tags (--tool-strict-level).
tool_strict_level: ToolStrictLevel = ToolStrictLevel.AUTO
always_adjust_request: bool = False
def __init__(
self,
@@ -206,6 +207,10 @@ class Parser:
"""
return request
def set_prompt_token_ids(self, prompt_token_ids: Sequence[int]) -> None:
"""Provide the exact rendered prompt to parsers that need prefix state."""
return
@abstractmethod
def is_reasoning_end(self, input_ids: list[int]) -> bool:
"""Check if the reasoning content ends in the input_ids.