v2.9.0 (#641)
Co-authored-by: Antoine <33425718+anth2o@users.noreply.github.com> Co-authored-by: Bastien <bastien.baret@gmail.com> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Quentin <quentin.torroba@mistral.ai> Co-authored-by: Robin Gullo <robin.gullo@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
a83c81ecf5
commit
632ea8c032
253 changed files with 13965 additions and 2525 deletions
|
|
@ -6,6 +6,7 @@ import pytest
|
|||
|
||||
from tests.conftest import build_test_vibe_config
|
||||
from vibe.core.agents import AgentManager
|
||||
from vibe.core.scratchpad import init_scratchpad
|
||||
from vibe.core.skills.manager import SkillManager
|
||||
from vibe.core.system_prompt import get_universal_system_prompt
|
||||
from vibe.core.tools.manager import ToolManager
|
||||
|
|
@ -42,3 +43,83 @@ def test_get_universal_system_prompt_includes_windows_prompt_on_windows(
|
|||
assert "Use: backslashes (\\\\) for paths" in prompt
|
||||
assert "Check command availability with: `where command` (Windows)" in prompt
|
||||
assert "Script shebang: Not applicable on Windows" in prompt
|
||||
|
||||
|
||||
def test_scratchpad_section_included_when_passed() -> None:
|
||||
sp = init_scratchpad("test-session")
|
||||
config = build_test_vibe_config(
|
||||
system_prompt_id="tests",
|
||||
include_project_context=False,
|
||||
include_prompt_detail=True,
|
||||
include_model_info=False,
|
||||
include_commit_signature=False,
|
||||
)
|
||||
tool_manager = ToolManager(lambda: config)
|
||||
skill_manager = SkillManager(lambda: config)
|
||||
agent_manager = AgentManager(lambda: config)
|
||||
|
||||
prompt = get_universal_system_prompt(
|
||||
tool_manager, config, skill_manager, agent_manager, scratchpad_dir=sp
|
||||
)
|
||||
|
||||
assert "# Scratchpad Directory" in prompt
|
||||
assert sp is not None
|
||||
assert str(sp) in prompt
|
||||
|
||||
|
||||
def test_scratchpad_section_absent_when_not_passed() -> None:
|
||||
config = build_test_vibe_config(
|
||||
system_prompt_id="tests",
|
||||
include_project_context=False,
|
||||
include_prompt_detail=True,
|
||||
include_model_info=False,
|
||||
include_commit_signature=False,
|
||||
)
|
||||
tool_manager = ToolManager(lambda: config)
|
||||
skill_manager = SkillManager(lambda: config)
|
||||
agent_manager = AgentManager(lambda: config)
|
||||
|
||||
prompt = get_universal_system_prompt(
|
||||
tool_manager, config, skill_manager, agent_manager
|
||||
)
|
||||
|
||||
assert "Scratchpad Directory" not in prompt
|
||||
|
||||
|
||||
def test_headless_section_included_when_enabled() -> None:
|
||||
config = build_test_vibe_config(
|
||||
system_prompt_id="tests",
|
||||
include_project_context=False,
|
||||
include_prompt_detail=False,
|
||||
include_model_info=False,
|
||||
include_commit_signature=False,
|
||||
)
|
||||
tool_manager = ToolManager(lambda: config)
|
||||
skill_manager = SkillManager(lambda: config)
|
||||
agent_manager = AgentManager(lambda: config)
|
||||
|
||||
prompt = get_universal_system_prompt(
|
||||
tool_manager, config, skill_manager, agent_manager, headless=True
|
||||
)
|
||||
|
||||
assert "# Headless Mode" in prompt
|
||||
assert "no human is available to respond" in prompt
|
||||
|
||||
|
||||
def test_headless_section_absent_by_default() -> None:
|
||||
config = build_test_vibe_config(
|
||||
system_prompt_id="tests",
|
||||
include_project_context=False,
|
||||
include_prompt_detail=False,
|
||||
include_model_info=False,
|
||||
include_commit_signature=False,
|
||||
)
|
||||
tool_manager = ToolManager(lambda: config)
|
||||
skill_manager = SkillManager(lambda: config)
|
||||
agent_manager = AgentManager(lambda: config)
|
||||
|
||||
prompt = get_universal_system_prompt(
|
||||
tool_manager, config, skill_manager, agent_manager
|
||||
)
|
||||
|
||||
assert "Headless Mode" not in prompt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue