sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)

This commit is contained in:
gozeros committed 2026-10-21 14:51:31 +08:00
1 parent 4f7f07504a
commit 8bc8b0e082
1651 files changed
+278599 -11416

No files matched your search

@@ -68,6 +68,13 @@ def test_skill_discovery_and_python_creation_do_not_satisfy_collection_gate():
)
assert policy._turn_collection_state(messages) == (False, 1)
messages = _tool_turn(
"begin_write_file",
{"path": "/mnt/user-data/workspace/retrieve.py", "description": "准备检索脚本"},
'{"status":"ready"}',
)
assert policy._turn_collection_state(messages) == (False, 1)
def test_real_search_or_python_skill_execution_satisfies_collection_gate():
messages = _tool_turn("web_search", {"query": "测试检索"}, "真实搜索结果")
@@ -85,6 +92,7 @@ def test_real_search_or_python_skill_execution_satisfies_collection_gate():
("name", "args"),
[
("write_file", {"path": "/mnt/user-data/workspace/query.py"}),
("begin_write_file", {"path": "/mnt/user-data/workspace/query.py"}),
("str_replace", {"path": "/mnt/user-data/workspace/query.py"}),
("bash", {"command": "cd /mnt/skills/demo && python3 scripts/query.py 关键词"}),
("web_search", {"query": "关键词"}),
@@ -98,6 +106,7 @@ def test_policy_allows_retrieval_and_temporary_python(name, args):
("name", "args"),
[
("write_file", {"path": "/mnt/user-data/outputs/report.md"}),
("begin_write_file", {"path": "/mnt/user-data/outputs/report.md"}),
("write_file", {"path": "/mnt/user-data/workspace/report.md"}),
("str_replace", {"path": "/mnt/user-data/workspace/result.json"}),
("present_files", {"paths": ["/mnt/user-data/outputs/report.md"]}),
@@ -113,13 +122,14 @@ def test_forced_research_tool_filter_removes_unrelated_write_surfaces():
tools = [
SimpleNamespace(name="web_search"),
SimpleNamespace(name="write_file"),
SimpleNamespace(name="begin_write_file"),
SimpleNamespace(name="bash"),
SimpleNamespace(name="present_files"),
SimpleNamespace(name="skill_manage"),
SimpleNamespace(name="skill_view"),
]
names = [tool.name for tool in policy.filter_forced_research_tools(tools)]
assert names == ["web_search", "write_file", "bash", "skill_view"]
assert names == ["web_search", "write_file", "begin_write_file", "bash", "skill_view"]
def test_provider_plain_answer_is_sent_back_to_model_before_collection():