@@ -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
@@ -4357,14 +4357,17 @@ class DeepSeekDSMLFilter:
43574357 r"(?i)(?<![\w])(?P<kind>Action|Thought|Plan|TaskList|TaskDone|DefineTool)\s*:"
43584358 )
43594359 _GENERIC_OPEN_RE = re .compile (
4360- r"<\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls)\b[^>]*>" ,
4360+ r"<\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls|tool_use|notes|thought|reasoning )\b[^>]*>" ,
43614361 re .IGNORECASE ,
43624362 )
43634363 _GENERIC_CLOSE_RE = re .compile (
4364- r"</\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls)\s*>" ,
4364+ r"</\s*(?P<kind>invoke|parameter|calls|tool_calls|function_calls|tool_use|notes|thought|reasoning )\s*>" ,
43654365 re .IGNORECASE ,
43664366 )
4367- _GENERIC_KINDS = ("invoke" , "parameter" , "calls" , "tool_calls" , "function_calls" )
4367+ _GENERIC_KINDS = (
4368+ "invoke" , "parameter" , "calls" , "tool_calls" , "function_calls" ,
4369+ "tool_use" , "notes" , "thought" , "reasoning" ,
4370+ )
43684371 _ACTION_MARKER_RE = _ACTION_MARKER_RE
43694372 _CONTROL_PREFIXES = tuple (
43704373 item [:length ].lower ()
@@ -4494,7 +4497,10 @@ def _action_end(cls, value: str, start: int, *, final: bool) -> int | None:
44944497 @classmethod
44954498 def _generic_block_end (cls , value : str , match : re .Match [str ]) -> int | None :
44964499 kind = match .group ("kind" ).lower ()
4497- close_kinds = "parameter" if kind == "parameter" else "invoke|calls|tool_calls|function_calls"
4500+ close_kinds = (
4501+ "parameter" if kind == "parameter" else
4502+ "invoke|calls|tool_calls|function_calls|tool_use|notes|thought|reasoning"
4503+ )
44984504 close = re .compile (rf"</\s*(?:{ close_kinds } )\s*>" , re .IGNORECASE ).search (value , match .end ())
44994505 return close .end () if close else None
45004506
@@ -4760,6 +4766,12 @@ def _parse_model_response(text: str) -> dict[str, Any]:
47604766 try :
47614767 question_value = parse_control_block (raw , "AskUser" )
47624768 plan_value = parse_control_block (raw , "PlanProposal" )
4769+ if question_value is None and plan_value is None :
4770+ normalized = normalize_provider_control (raw )
4771+ if normalized is not None :
4772+ name , value = normalized
4773+ question_value = value if name == "AskUser" else None
4774+ plan_value = value if name == "PlanProposal" else None
47634775 if question_value is not None :
47644776 question = validate_question_request (question_value )
47654777 if plan_value is not None :
0 commit comments