v2.18.4 (#866)
Co-authored-by: Albert Jiang <aj@mistral.ai> Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Laure Hugo <201583486+laure0303@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Mert Unsal <mert.unsal@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@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: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
4e495f658d
commit
ac8f1a09fd
83 changed files with 1979 additions and 572 deletions
|
|
@ -22,6 +22,7 @@ def _make_args(**overrides: object) -> argparse.Namespace:
|
|||
"enabled_tools": None,
|
||||
"output": "text",
|
||||
"agent": "default",
|
||||
"auto_approve": False,
|
||||
"check_upgrade": False,
|
||||
"setup": False,
|
||||
"workdir": None,
|
||||
|
|
@ -301,6 +302,35 @@ def test_run_cli_passes_max_tokens_to_run_programmatic(
|
|||
assert call["max_session_tokens"] == 123
|
||||
|
||||
|
||||
def test_run_cli_auto_approve_sets_config_without_changing_agent(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
args = _make_args(agent="lean", auto_approve=True)
|
||||
call: dict[str, object] = {}
|
||||
config = build_test_vibe_config(default_agent="plan")
|
||||
|
||||
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)
|
||||
|
||||
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["agent_name"] == "lean"
|
||||
assert config.bypass_tool_permissions is True
|
||||
|
||||
|
||||
def test_run_cli_runs_update_prompt_before_trust_resolver(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue