feat: enhance expert invitation handling with case-insensitive matching and session management

This commit is contained in:
X-iZhang
2026-08-07 16:42:40 +01:00
committed by Xi Zhang
parent ab1a6b0062
commit aff63ccd65
10 changed files with 159 additions and 23 deletions
+21
View File
@@ -85,3 +85,24 @@ class TestNewCommand:
ctx = CommandContext(agent=None, thread_id="tid", ui=ui, channel_runtime=None)
await NewCommand().execute(ctx, [])
ui.append_system.assert_not_called()
async def test_failed_session_start_keeps_invitations(self):
"""A raising start_new_session leaves the current session's invites."""
import pytest
from EvoScientist.commands.base import ChannelRuntime, CommandContext
from EvoScientist.commands.implementation.session import NewCommand
ui = MagicMock()
ui.start_new_session = AsyncMock(side_effect=RuntimeError("gateway down"))
runtime = ChannelRuntime()
runtime.active_teams = ["idea-brainstorm"]
ctx = CommandContext(
agent=None,
thread_id="tid",
ui=ui,
channel_runtime=runtime,
)
with pytest.raises(RuntimeError):
await NewCommand().execute(ctx, [])
assert runtime.active_teams == ["idea-brainstorm"]