@@ -105,7 +105,7 @@ def _terminal_supports_unicode() -> bool:
105105from event_store import stable_hash , utc_now
106106from interaction import (
107107 InteractionController , InteractionError , is_plan_acceptance , mode_capabilities ,
108- parse_control_block , render_plan , render_question , validate_plan_proposal ,
108+ normalize_provider_control , parse_control_block , render_plan , render_question , validate_plan_proposal ,
109109 validate_question_request ,
110110)
111111from learning_engine import LearningEngine
@@ -4337,14 +4337,17 @@ class DeepSeekDSMLFilter:
43374337 r"(?i)(?<![\w])(?P<kind>Action|Thought|Plan|TaskList|TaskDone|DefineTool)\s*:"
43384338 )
43394339 _GENERIC_OPEN_RE = re .compile (
4340- r"<\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls)\b[^>]*>" ,
4340+ r"<\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls|tool_use|notes|thought|reasoning )\b[^>]*>" ,
43414341 re .IGNORECASE ,
43424342 )
43434343 _GENERIC_CLOSE_RE = re .compile (
4344- r"</\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls)\s*>" ,
4344+ r"</\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls|tool_use|notes|thought|reasoning )\s*>" ,
43454345 re .IGNORECASE ,
43464346 )
4347- _GENERIC_KINDS = ("invoke" , "parameter" , "calls" , "tool_calls" , "function_calls" )
4347+ _GENERIC_KINDS = (
4348+ "invoke" , "parameter" , "calls" , "tool_calls" , "function_calls" ,
4349+ "tool_use" , "notes" , "thought" , "reasoning" ,
4350+ )
43484351 _ACTION_MARKER_RE = _ACTION_MARKER_RE
43494352 _CONTROL_PREFIXES = tuple (
43504353 item [:length ].lower ()
@@ -4474,7 +4477,10 @@ def _action_end(cls, value: str, start: int, *, final: bool) -> int | None:
44744477 @classmethod
44754478 def _generic_block_end (cls , value : str , match : re .Match [str ]) -> int | None :
44764479 kind = match .group ("kind" ).lower ()
4477- close_kinds = "parameter" if kind == "parameter" else "invoke|calls|tool_calls|function_calls"
4480+ close_kinds = (
4481+ "parameter" if kind == "parameter" else
4482+ "invoke|calls|tool_calls|function_calls|tool_use|notes|thought|reasoning"
4483+ )
44784484 close = re .compile (rf"</\s*(?:{ close_kinds } )\s*>" , re .IGNORECASE ).search (value , match .end ())
44794485 return close .end () if close else None
44804486
@@ -4740,6 +4746,12 @@ def _parse_model_response(text: str) -> dict[str, Any]:
47404746 try :
47414747 question_value = parse_control_block (raw , "AskUser" )
47424748 plan_value = parse_control_block (raw , "PlanProposal" )
4749+ if question_value is None and plan_value is None :
4750+ normalized = normalize_provider_control (raw )
4751+ if normalized is not None :
4752+ name , value = normalized
4753+ question_value = value if name == "AskUser" else None
4754+ plan_value = value if name == "PlanProposal" else None
47434755 if question_value is not None :
47444756 question = validate_question_request (question_value )
47454757 if plan_value is not None :
0 commit comments