vibe/tests/test_system_prompt.py
Mathias Gesbert 51fecc67d9
2.1.0 (#317)
Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai>
Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai>
Co-authored-by: Clément Siriex <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
Co-authored-by: Nicolas Karolak <nicolas@karolak.fr>
2026-02-11 18:17:30 +01:00

44 lines
1.5 KiB
Python

from __future__ import annotations
import sys
import pytest
from tests.conftest import build_test_vibe_config
from vibe.core.agents import AgentManager
from vibe.core.skills.manager import SkillManager
from vibe.core.system_prompt import get_universal_system_prompt
from vibe.core.tools.manager import ToolManager
def test_get_universal_system_prompt_includes_windows_prompt_on_windows(
monkeypatch: pytest.MonkeyPatch,
) -> None:
monkeypatch.setattr(sys, "platform", "win32")
monkeypatch.setenv("COMSPEC", "C:\\Windows\\System32\\cmd.exe")
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 "You are Vibe, a super useful programming assistant." in prompt
assert (
"The operating system is Windows with shell `C:\\Windows\\System32\\cmd.exe`"
in prompt
)
assert "DO NOT use Unix commands like `ls`, `grep`, `cat`" in prompt
assert "Use: `dir` (Windows) for directory listings" in prompt
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