v2.11.1 (#721)
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Mert Unsal <mertunsal1905@gmail.com> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Quentin <quentin.torroba@mistral.ai> Co-authored-by: Val <102326092+vdeva@users.noreply.github.com> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: maximevoisin-pm <maxime.voisin@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
adb1ca74ce
commit
cf3f4ca58f
143 changed files with 3457 additions and 1351 deletions
|
|
@ -32,20 +32,18 @@ def test_defaults_to_default_when_unset_in_config_and_args() -> None:
|
|||
assert get_initial_agent_name(args, config) == BuiltinAgentName.DEFAULT
|
||||
|
||||
|
||||
def test_programmatic_mode_promotes_default_to_auto_approve() -> None:
|
||||
def test_programmatic_mode_falls_back_to_default_agent() -> None:
|
||||
config = VibeConfig.model_construct(default_agent=BuiltinAgentName.DEFAULT)
|
||||
args = _make_args(agent=None, prompt="hello")
|
||||
|
||||
assert get_initial_agent_name(args, config) == BuiltinAgentName.AUTO_APPROVE
|
||||
assert get_initial_agent_name(args, config) == BuiltinAgentName.DEFAULT
|
||||
|
||||
|
||||
def test_programmatic_mode_ignores_config_default_agent_when_args_agent_is_none() -> (
|
||||
None
|
||||
):
|
||||
def test_programmatic_mode_uses_config_default_agent_when_args_agent_is_none() -> None:
|
||||
config = VibeConfig.model_construct(default_agent=BuiltinAgentName.PLAN)
|
||||
args = _make_args(agent=None, prompt="hello")
|
||||
|
||||
assert get_initial_agent_name(args, config) == BuiltinAgentName.AUTO_APPROVE
|
||||
assert get_initial_agent_name(args, config) == BuiltinAgentName.PLAN
|
||||
|
||||
|
||||
def test_programmatic_mode_keeps_explicit_agent_arg() -> None:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from tests.conftest import build_test_vibe_config
|
||||
from vibe.cli import cli as cli_mod, entrypoint as entrypoint_mod
|
||||
from vibe.core.config import MissingAPIKeyError
|
||||
from vibe.core.trusted_folders import trusted_folders_manager
|
||||
|
|
@ -16,6 +17,7 @@ def _make_args(**overrides: object) -> argparse.Namespace:
|
|||
"prompt": "hello",
|
||||
"max_turns": None,
|
||||
"max_price": None,
|
||||
"max_tokens": None,
|
||||
"enabled_tools": None,
|
||||
"output": "text",
|
||||
"agent": "default",
|
||||
|
|
@ -193,3 +195,32 @@ def test_session_trust_does_not_write_to_disk(
|
|||
|
||||
assert trusted_folders_manager.is_trusted(project) is True
|
||||
assert not trust_file.exists()
|
||||
|
||||
|
||||
def test_run_cli_passes_max_tokens_to_run_programmatic(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
args = _make_args(max_tokens=123)
|
||||
call: dict[str, object] = {}
|
||||
config = build_test_vibe_config()
|
||||
|
||||
monkeypatch.setattr(cli_mod, "bootstrap_config_files", lambda: None)
|
||||
monkeypatch.setattr(cli_mod, "load_config_or_exit", lambda interactive: config)
|
||||
monkeypatch.setattr(cli_mod, "load_hooks_from_fs", lambda _config: None)
|
||||
monkeypatch.setattr(cli_mod, "setup_tracing", lambda _config: None)
|
||||
monkeypatch.setattr(cli_mod, "load_session", lambda _args, _config: None)
|
||||
monkeypatch.setattr(cli_mod, "get_prompt_from_stdin", lambda: None)
|
||||
monkeypatch.setattr(cli_mod, "warn_if_workdir_trust_is_unset", lambda: None)
|
||||
monkeypatch.setattr(cli_mod, "get_initial_agent_name", lambda _args, _config: "x")
|
||||
|
||||
def fake_run_programmatic(**kwargs: object) -> str:
|
||||
call.update(kwargs)
|
||||
return "done"
|
||||
|
||||
monkeypatch.setattr(cli_mod, "run_programmatic", fake_run_programmatic)
|
||||
|
||||
with pytest.raises(SystemExit) as exc_info:
|
||||
cli_mod.run_cli(args)
|
||||
|
||||
assert exc_info.value.code == 0
|
||||
assert call["max_session_tokens"] == 123
|
||||
|
|
|
|||
|
|
@ -166,7 +166,15 @@ async def test_ui_session_incremental_loader_keeps_top_alignment_when_not_scroll
|
|||
|
||||
app = VibeApp(agent_loop=agent_loop, plan_offer_gateway=_pro_plan_gateway())
|
||||
|
||||
async with app.run_test(size=(120, 80)) as pilot:
|
||||
# Each UserMessage renders as ~3 rows (top margin + content + separator);
|
||||
# add chrome (input box, banner, status) so all messages fit without scrolling.
|
||||
user_message_rows = 3
|
||||
chrome_rows = 40
|
||||
viewport_height = (
|
||||
HISTORY_RESUME_TAIL_MESSAGES + 1
|
||||
) * user_message_rows + chrome_rows
|
||||
|
||||
async with app.run_test(size=(120, viewport_height)) as pilot:
|
||||
await _wait_for_load_more(app, pilot.pause)
|
||||
chat = app.query_one("#chat", ChatScroll)
|
||||
assert chat.max_scroll_y == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue