Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Gauthier Guinet <43207538+Gguinet@users.noreply.github.com>
Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Quentin <torroba.q@gmail.com>
Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>
Co-authored-by: Simon Van de Kerckhove <simon.vandekerckhove@mistral.ai>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: angelapopopo <angele.lenglemetz@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mathias Gesbert 2026-03-23 18:45:21 +01:00 committed by GitHub
parent 5103019b01
commit eb580209d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
180 changed files with 11136 additions and 1030 deletions

View file

@ -22,7 +22,6 @@ from vibe.core.middleware import (
MiddlewareResult,
ResetReason,
)
from vibe.core.tools.base import BaseToolConfig, ToolPermission
from vibe.core.tools.builtins.todo import TodoArgs
from vibe.core.types import (
ApprovalResponse,
@ -54,9 +53,7 @@ class InjectBeforeMiddleware:
def make_config(
*,
enabled_tools: list[str] | None = None,
tools: dict[str, BaseToolConfig] | None = None,
*, enabled_tools: list[str] | None = None, tools: dict[str, dict] | None = None
) -> VibeConfig:
return build_test_vibe_config(
system_prompt_id="tests",
@ -218,8 +215,7 @@ async def test_act_handles_streaming_with_tool_call_events_in_sequence() -> None
])
agent = build_test_agent_loop(
config=make_config(
enabled_tools=["todo"],
tools={"todo": BaseToolConfig(permission=ToolPermission.ALWAYS)},
enabled_tools=["todo"], tools={"todo": {"permission": "always"}}
),
backend=backend,
agent_name=BuiltinAgentName.AUTO_APPROVE,
@ -268,8 +264,7 @@ async def test_act_handles_tool_call_chunk_with_content() -> None:
])
agent = build_test_agent_loop(
config=make_config(
enabled_tools=["todo"],
tools={"todo": BaseToolConfig(permission=ToolPermission.ALWAYS)},
enabled_tools=["todo"], tools={"todo": {"permission": "always"}}
),
backend=backend,
agent_name=BuiltinAgentName.AUTO_APPROVE,
@ -324,8 +319,7 @@ async def test_act_merges_streamed_tool_call_arguments() -> None:
])
agent = build_test_agent_loop(
config=make_config(
enabled_tools=["todo"],
tools={"todo": BaseToolConfig(permission=ToolPermission.ALWAYS)},
enabled_tools=["todo"], tools={"todo": {"permission": "always"}}
),
backend=backend,
agent_name=BuiltinAgentName.AUTO_APPROVE,
@ -387,8 +381,7 @@ async def test_act_handles_user_cancellation_during_streaming() -> None:
])
agent = build_test_agent_loop(
config=make_config(
enabled_tools=["todo"],
tools={"todo": BaseToolConfig(permission=ToolPermission.ASK)},
enabled_tools=["todo"], tools={"todo": {"permission": "ask"}}
),
backend=backend,
agent_name=BuiltinAgentName.DEFAULT,
@ -398,7 +391,7 @@ async def test_act_handles_user_cancellation_during_streaming() -> None:
agent.middleware_pipeline.add(middleware)
async def _reject_callback(
_name: str, _args: BaseModel, _id: str
_name: str, _args: BaseModel, _id: str, _rp: list | None = None
) -> tuple[ApprovalResponse, str | None]:
return (
ApprovalResponse.NO,