Co-authored-by: Antoine <33425718+anth2o@users.noreply.github.com>
Co-authored-by: Bastien <bastien.baret@gmail.com>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@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: Robin Gullo <robin.gullo@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Clément Drouin 2026-04-28 17:44:07 +02:00 committed by GitHub
parent a83c81ecf5
commit 632ea8c032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
253 changed files with 13965 additions and 2525 deletions

View file

@ -99,7 +99,7 @@ class TestLoadSession:
}
assert response.config_options is not None
assert len(response.config_options) == 2
assert len(response.config_options) == 3
assert response.config_options[0].id == "mode"
assert response.config_options[0].category == "mode"
assert response.config_options[0].current_value == BuiltinAgentName.DEFAULT
@ -118,6 +118,9 @@ class TestLoadSession:
assert len(response.config_options[1].options) == 2
model_option_values = {opt.value for opt in response.config_options[1].options}
assert model_option_values == {"devstral-latest", "devstral-small"}
assert response.config_options[2].id == "thinking"
assert response.config_options[2].category == "thinking"
assert response.config_options[2].current_value == "off"
@pytest.mark.asyncio
async def test_load_session_registers_session_with_original_id(
@ -136,6 +139,7 @@ class TestLoadSession:
assert session_id in acp_agent.sessions
assert acp_agent.sessions[session_id].id == session_id
assert acp_agent.sessions[session_id].agent_loop.session_id == session_id
@pytest.mark.asyncio
async def test_load_session_injects_messages_into_agent_loop(
@ -375,6 +379,36 @@ class TestLoadSession:
assert agent_updates[0].update.content.text == "First response"
assert agent_updates[1].update.content.text == "Second response"
@pytest.mark.asyncio
async def test_load_session_restores_agent_loop_session_identity(
self,
acp_agent_with_session_config: tuple[VibeAcpAgentLoop, FakeClient],
temp_session_dir: Path,
create_test_session,
) -> None:
acp_agent, _client = acp_agent_with_session_config
session_id = "restore-id-12345678"
parent_session_id = "parent-id-87654321"
cwd = str(Path.cwd())
session_dir = create_test_session(
temp_session_dir, session_id, cwd, parent_session_id=parent_session_id
)
await acp_agent.load_session(cwd=cwd, mcp_servers=[], session_id=session_id)
agent_loop = acp_agent.sessions[session_id].agent_loop
assert agent_loop.session_id == session_id
assert agent_loop.parent_session_id == parent_session_id
assert agent_loop.session_logger.session_id == session_id
assert agent_loop.session_logger.session_dir == session_dir
assert agent_loop.session_logger.session_metadata is not None
assert (
agent_loop.session_logger.session_metadata.parent_session_id
== parent_session_id
)
@pytest.mark.asyncio
async def test_replay_user_message_has_message_id(
self,