mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-01 00:31:51 +03:00
feat(webui): add lightweight session messaging via mentions
This commit is contained in:
@@ -23,6 +23,7 @@ from nanobot.bus.outbound_events import (
|
||||
from nanobot.bus.queue import MessageBus
|
||||
from nanobot.providers.base import LLMResponse, ToolCallRequest
|
||||
from nanobot.providers.factory import ProviderSnapshot
|
||||
from nanobot.runtime_context import RUNTIME_CONTEXT_MESSAGE_META, detach_runtime_context
|
||||
from nanobot.session.webui_turns import WebuiTurnCoordinator, WebuiTurnRoutePolicy
|
||||
from nanobot.utils.progress_events import (
|
||||
invoke_file_edit_progress,
|
||||
@@ -853,11 +854,16 @@ class TestToolEventProgress:
|
||||
assert len(requests) == 2
|
||||
assert requests[0][-1]["role"] == "user"
|
||||
assert requests[0][-1]["content"].endswith("Background research completed")
|
||||
assert any(
|
||||
message.get("role") == "user"
|
||||
and message.get("content") == "Can you include the key detail?"
|
||||
follow_up = next(
|
||||
message
|
||||
for message in requests[1]
|
||||
if message.get("role") == "user"
|
||||
and str(message.get("content", "")).startswith("Can you include the key detail?")
|
||||
)
|
||||
marker = follow_up["_meta"][RUNTIME_CONTEXT_MESSAGE_META]
|
||||
detached = detach_runtime_context(follow_up["content"], marker)
|
||||
assert detached is not None
|
||||
assert detached[0] == "Can you include the key detail?"
|
||||
assert len(request_contexts) == 1
|
||||
request_ctx = request_contexts[0]
|
||||
assert request_ctx is not None
|
||||
|
||||
Reference in New Issue
Block a user