mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-07-26 07:57:57 +00:00
fix browser extra detection for indentless YAML (#4367)
This commit is contained in:
parent
b5cc3a81c3
commit
183280ebfc
@ -157,6 +157,14 @@ def test_detect_from_config_browser_via_browser_navigate_tool(tmp_path):
|
||||
assert detect.detect_from_config(cfg) == ["browser"]
|
||||
|
||||
|
||||
def test_detect_from_config_browser_via_indentless_tools_list(tmp_path):
|
||||
cfg = tmp_path / "config.yaml"
|
||||
cfg.write_text(
|
||||
"tools:\n- name: web_fetch\n group: web\n- name: browser_navigate\n group: browser\n",
|
||||
)
|
||||
assert detect.detect_from_config(cfg) == ["browser"]
|
||||
|
||||
|
||||
def test_detect_from_config_ignores_commented_browser_tool(tmp_path):
|
||||
cfg = tmp_path / "config.yaml"
|
||||
cfg.write_text(
|
||||
|
||||
@ -237,14 +237,16 @@ def tools_include_name(lines: list[str], tool_name: str) -> bool:
|
||||
continue
|
||||
if not inside:
|
||||
continue
|
||||
name_match = _LIST_ITEM_NAME_RE.match(line)
|
||||
if name_match:
|
||||
if _unquote(name_match.group(1).strip()) == tool_name:
|
||||
return True
|
||||
continue
|
||||
stripped = line.lstrip()
|
||||
indent = len(line) - len(stripped)
|
||||
if indent == 0:
|
||||
inside = False
|
||||
continue
|
||||
name_match = _LIST_ITEM_NAME_RE.match(line)
|
||||
if name_match and _unquote(name_match.group(1).strip()) == tool_name:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user