v2.9.6 (#682)
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:
parent
b23f49e5f4
commit
626f905186
59 changed files with 702 additions and 183 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue