fix(webui): reconcile threads after browser resume

This commit is contained in:
chengyongru
2026-07-28 16:25:08 +08:00
committed by chengyongru
parent 78cf68c291
commit ae089aa3ae
39 changed files with 6151 additions and 243 deletions
+18 -1
View File
@@ -6,7 +6,10 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
from nanobot.command.builtin import register_builtin_commands
from nanobot.command.builtin import (
builtin_command_starts_agent_turn,
register_builtin_commands,
)
from nanobot.command.router import CommandContext, CommandRouter
@@ -64,6 +67,20 @@ class TestIsDispatchableCommand:
assert not router.is_dispatchable_command("/foo bar")
@pytest.mark.parametrize(
("content", "expected"),
[
("/status", False),
("/history 5", False),
("/goal", False),
("/goal migrate the database", True),
("regular prompt", True),
],
)
def test_builtin_command_agent_turn_lifecycle(content: str, expected: bool) -> None:
assert builtin_command_starts_agent_turn(content) is expected
class TestMidTurnCommandDispatchedDirectly:
"""Verify that commands matching is_dispatchable_command() are dispatched
correctly when session=None (the mid-turn path)."""