mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-07 21:08:34 +03:00
fix(sdk): harden host integration contracts
This commit is contained in:
@@ -14,6 +14,23 @@ class RecordingHook(AgentHook):
|
||||
self._events.append(f"{self._label}:{context.iteration}")
|
||||
|
||||
|
||||
def test_turn_hook_context_preserves_legacy_positional_arguments(tmp_path) -> None:
|
||||
context = AgentTurnHookContext(
|
||||
None,
|
||||
tmp_path,
|
||||
"sdk",
|
||||
"chat-a",
|
||||
"message-1",
|
||||
"sdk:chat-a",
|
||||
{"trusted": True},
|
||||
True,
|
||||
)
|
||||
|
||||
assert context.metadata == {"trusted": True}
|
||||
assert context.ephemeral is True
|
||||
assert context.attributes == {}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_turn_hook_builder_runs_progress_hook_before_extra_hooks() -> None:
|
||||
events: list[str] = []
|
||||
|
||||
Reference in New Issue
Block a user