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>
This commit is contained in:
parent
9809cfc831
commit
51fecc67d9
176 changed files with 8652 additions and 4451 deletions
|
|
@ -4,28 +4,25 @@ from rich.style import Style
|
|||
from textual.widgets.text_area import TextAreaTheme
|
||||
|
||||
from tests.cli.plan_offer.adapters.fake_whoami_gateway import FakeWhoAmIGateway
|
||||
from tests.conftest import build_test_agent_loop, build_test_vibe_config
|
||||
from tests.stubs.fake_backend import FakeBackend
|
||||
from vibe.cli.plan_offer.ports.whoami_gateway import WhoAmIResponse
|
||||
from vibe.cli.textual_ui.app import VibeApp
|
||||
from vibe.cli.textual_ui.widgets.chat_input import ChatTextArea
|
||||
from vibe.core.agent_loop import AgentLoop
|
||||
from vibe.core.agents.models import BuiltinAgentName
|
||||
from vibe.core.config import SessionLoggingConfig, VibeConfig
|
||||
from vibe.core.config import VibeConfig
|
||||
|
||||
|
||||
def default_config() -> VibeConfig:
|
||||
"""Default configuration for snapshot testing.
|
||||
Remove as much interference as possible from the snapshot comparison, in order to get a clean pixel-to-pixel comparison.
|
||||
- Injects a fake backend to prevent (or stub) LLM calls.
|
||||
- Disables the welcome banner animation.
|
||||
- Disables the banner animation.
|
||||
- Forces a value for the displayed workdir
|
||||
- Hides the chat input cursor (as the blinking animation is not deterministic).
|
||||
"""
|
||||
return VibeConfig(
|
||||
session_logging=SessionLoggingConfig(enabled=False),
|
||||
textual_theme="gruvbox",
|
||||
disable_welcome_banner_animation=True,
|
||||
displayed_workdir="/test/workdir",
|
||||
enable_update_checks=False,
|
||||
return build_test_vibe_config(
|
||||
disable_welcome_banner_animation=True, displayed_workdir="/test/workdir"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -39,16 +36,23 @@ class BaseSnapshotTestApp(VibeApp):
|
|||
backend: FakeBackend | None = None,
|
||||
**kwargs,
|
||||
):
|
||||
config = config or default_config()
|
||||
|
||||
agent_loop = AgentLoop(
|
||||
config,
|
||||
agent_loop = build_test_agent_loop(
|
||||
config=config or default_config(),
|
||||
agent_name=self._current_agent_name,
|
||||
enable_streaming=kwargs.get("enable_streaming", False),
|
||||
enable_streaming=bool(kwargs.get("enable_streaming", False)),
|
||||
backend=backend or FakeBackend(),
|
||||
)
|
||||
|
||||
plan_offer_gateway = kwargs.pop("plan_offer_gateway", FakeWhoAmIGateway())
|
||||
plan_offer_gateway = kwargs.pop(
|
||||
"plan_offer_gateway",
|
||||
FakeWhoAmIGateway(
|
||||
WhoAmIResponse(
|
||||
is_pro_plan=True,
|
||||
advertise_pro_plan=False,
|
||||
prompt_switching_to_pro_plan=False,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
super().__init__(
|
||||
agent_loop=agent_loop, plan_offer_gateway=plan_offer_gateway, **kwargs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue