feat:可开启原生at功能

This commit is contained in:
SengokuCola
2026-04-23 15:56:27 +08:00
parent 2255592bd2
commit 35ff91d134
20 changed files with 258 additions and 404 deletions

View File

@@ -12,7 +12,7 @@ from src.plugin_runtime.host.component_registry import ComponentRegistry
@pytest.mark.asyncio
async def test_builtin_at_is_exposed_only_in_group_chats() -> None:
async def test_builtin_at_tool_is_not_exposed() -> None:
registry = ToolRegistry()
registry.register_provider(MaisakaBuiltinToolProvider())
@@ -20,9 +20,9 @@ async def test_builtin_at_is_exposed_only_in_group_chats() -> None:
private_specs = await registry.list_tools(ToolAvailabilityContext(session_id="private-1", is_group_chat=False))
default_specs = await registry.list_tools()
assert "at" in {tool_spec.name for tool_spec in group_specs}
assert "at" not in {tool_spec.name for tool_spec in group_specs}
assert "at" not in {tool_spec.name for tool_spec in private_specs}
assert "at" in {tool_spec.name for tool_spec in default_specs}
assert "at" not in {tool_spec.name for tool_spec in default_specs}
def test_plugin_tool_chat_scope_uses_component_field(monkeypatch: pytest.MonkeyPatch) -> None: