sync update from LAN repo (source ji @ 85078a31)

This commit is contained in:
gozeros committed 2026-10-21 15:09:16 +08:00
1 parent 5d6627af50
commit e602d88695
864 files changed
+99150 -6346

No files matched your search

@@ -267,6 +267,38 @@ async def test_strategy_skill_validation_rejects_unselectable_names(
assert detail_fragment in str(exc_info.value.detail)
@pytest.mark.asyncio
async def test_strategy_skill_validation_allows_retained_offline_but_not_new_offline(
monkeypatch: pytest.MonkeyPatch,
) -> None:
skill_store = MemorySkillStore()
storage = _SkillStorage(
[
_skill("retained-offline", category=SkillCategory.PUBLIC, enabled=False),
_skill("new-offline", category=SkillCategory.PUBLIC, enabled=False),
]
)
monkeypatch.setattr(agents_router, "get_or_new_skill_storage", lambda **_: storage)
monkeypatch.setattr(agents_router, "get_skill_usage_entries", lambda: {})
assert await agents_router._validate_strategy_agent_skills(
["retained-offline"],
app_config=object(), # type: ignore[arg-type]
skill_store=skill_store,
existing_skills=["retained-offline"],
) == ["retained-offline"]
with pytest.raises(HTTPException) as exc_info:
await agents_router._validate_strategy_agent_skills(
["retained-offline", "new-offline"],
app_config=object(), # type: ignore[arg-type]
skill_store=skill_store,
existing_skills=["retained-offline"],
)
assert exc_info.value.status_code == 422
assert "new-offline" in str(exc_info.value.detail)
def test_fixed_strategy_role_agents_cannot_be_deleted() -> None:
for agent_id in seed.required_agent_ids():
with pytest.raises(HTTPException) as exc_info: