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

@@ -1074,6 +1074,50 @@ async def test_skill_node_invokes_agent_with_restricted_skills() -> None:
assert "储能" in seen["prompt"]
@pytest.mark.asyncio
async def test_skill_node_rechecks_live_availability_before_invocation() -> None:
agent_called = False
async def run_agent(**_kwargs: Any) -> dict[str, Any]:
nonlocal agent_called
agent_called = True
return {"text": "must not run"}
async def resolve_enabled_skills() -> set[str]:
return {"some-other-skill"}
graph = _graph(
[
{"id": "start", "type": "start"},
{
"id": "skill",
"type": "skill",
"config": {
"agentId": "collector",
"skillNames": ["web_search"],
"promptTemplate": "查资料",
"mode": "agent_skill",
},
},
],
[{"id": "e1", "source": "start", "target": "skill"}],
)
with pytest.raises(WorkflowError) as exc:
await _run(
graph,
deps=WorkflowRuntimeDeps(
run_agent=run_agent,
resolve_enabled_skills=resolve_enabled_skills,
),
)
assert exc.value.code == "WORKFLOW_RESOURCE_MISSING"
assert exc.value.node_id == "skill"
assert exc.value.details == {"skillNames": ["web_search"]}
assert agent_called is False
@pytest.mark.asyncio
async def test_callable_skill_mode_is_rejected() -> None:
graph = _graph(