[Bugfix][Parser] Emit REASONING_END for Inkling tool calls that follow no thinking block (#50528)

Signed-off-by: Jason Yao <wsyjh8@gmail.com>
This commit is contained in:
Jason
2026-08-09 21:04:53 -04:00
committed by GitHub
parent 751f2ccdd3
commit 0820125ae9
4 changed files with 160 additions and 12 deletions
+4 -2
View File
@@ -202,9 +202,11 @@ def inkling_config() -> ParserEngineConfig:
ParserState.REASONING,
(EventType.REASONING_START,),
),
# A tool block confirms the same boundary, and is the one opener that
# can start a turn with no visible block ahead of it.
(ParserState.CONTENT, "TOOL_START"): Transition(
ParserState.TOOL_ARGS,
(EventType.TOOL_CALL_START,),
(EventType.REASONING_END, EventType.TOOL_CALL_START),
),
# Raw / error tool blocks render as visible text.
(ParserState.CONTENT, "TOOL_TEXT"): Transition(
@@ -231,7 +233,7 @@ def inkling_config() -> ParserEngineConfig:
),
(ParserState.MESSAGE_HEADER, "TOOL_START"): Transition(
ParserState.TOOL_ARGS,
(EventType.TOOL_CALL_START,),
(EventType.REASONING_END, EventType.TOOL_CALL_START),
),
(ParserState.MESSAGE_HEADER, "TOOL_TEXT"): Transition(
ParserState.CONTENT,