fix: tool_use regex negative lookahead to prevent cross-tag matching; tgapp relative path resolve

This commit is contained in:
Jiaqing Liang
2026-03-23 11:46:10 +08:00
parent 6f6d9f6570
commit 4b4dc51336
2 changed files with 3 additions and 1 deletions

View File

@@ -717,7 +717,7 @@ class ToolClient:
remaining_text = re.sub(think_pattern, "", remaining_text, flags=re.DOTALL)
tool_calls = []; json_strs = []; errors = []
tool_pattern = r"<tool_use>(.{15,}?)</tool_use>"
tool_pattern = r"<tool_use>((?:(?!<tool_use>).){15,}?)</tool_use>"
tool_all = re.findall(tool_pattern, remaining_text, re.DOTALL)
if tool_all: