sync update from LAN repo (source dhk-1 @ 3e87be55)

This commit is contained in:
gozeros committed 2026-10-21 15:06:08 +08:00
1 parent ab6068a7c1
commit 42f2a26fa8
1482 files changed
+227759 -9584

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(