Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mathias Gesbert 2026-05-11 11:44:53 +02:00 committed by GitHub
parent b23f49e5f4
commit 626f905186
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 702 additions and 183 deletions

View file

@ -11,6 +11,7 @@ from tests.stubs.fake_backend import FakeBackend
from vibe.core.agents.manager import AgentManager
from vibe.core.agents.models import (
BUILTIN_AGENTS,
CHAT,
AgentProfile,
AgentSafety,
AgentType,
@ -188,6 +189,49 @@ class TestAgentApplyToConfig:
"exit_plan_mode",
}
def test_base_disabled_tools_are_filtered_from_profile_enabled_tools(self) -> None:
base = VibeConfig(
include_project_context=False,
include_prompt_detail=False,
disabled_tools=["ask_user_question"],
)
result = CHAT.apply_to_config(base)
assert "ask_user_question" not in result.enabled_tools
assert "grep" in result.enabled_tools
assert "read_file" in result.enabled_tools
assert "task" in result.enabled_tools
def test_base_disabled_tools_filter_supports_glob_patterns(self) -> None:
base = VibeConfig(
include_project_context=False,
include_prompt_detail=False,
disabled_tools=["ask_*"],
)
agent = AgentProfile(
name="custom",
display_name="Custom",
description="",
safety=AgentSafety.NEUTRAL,
overrides={"enabled_tools": ["grep", "ask_user_question", "ask_extra"]},
)
result = agent.apply_to_config(base)
assert result.enabled_tools == ["grep"]
def test_empty_base_disabled_tools_leaves_enabled_tools_untouched(self) -> None:
base = VibeConfig(
include_project_context=False,
include_prompt_detail=False,
disabled_tools=[],
)
result = CHAT.apply_to_config(base)
assert "ask_user_question" in result.enabled_tools
def test_custom_prompt_found_in_global_when_missing_from_project(
self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None: