fix(sdk): harden host integration contracts

This commit is contained in:
chengyongru
2026-07-28 15:30:28 +08:00
committed by Xubin Ren
parent c050955ae3
commit fd17c1352a
7 changed files with 119 additions and 22 deletions
+1 -1
View File
@@ -58,8 +58,8 @@ class AgentTurnHookContext:
message_id: str | None = None
session_key: str | None = None
metadata: dict[str, Any] = field(default_factory=dict)
attributes: dict[str, Any] = field(default_factory=dict)
ephemeral: bool = False
attributes: dict[str, Any] = field(default_factory=dict)
class AgentHook:
+1 -1
View File
@@ -26,10 +26,10 @@ class RequestContext:
original_user_text: str | None = None
runtime: LLMRuntime | None = None
metadata: dict[str, Any] = field(default_factory=dict)
attributes: dict[str, Any] = field(default_factory=dict)
sender_id: str | None = None
turn_id: str | None = None
workspace: Path | None = None
attributes: dict[str, Any] = field(default_factory=dict)
@runtime_checkable
+1 -1
View File
@@ -29,7 +29,6 @@ class AgentTurnHookSpec:
chat_id: str = "direct"
message_id: str | None = None
metadata: dict[str, Any] | None = None
attributes: dict[str, Any] | None = None
session_key: str | None = None
workspace: Path | None = None
tool_hint_max_length: int = 40
@@ -40,6 +39,7 @@ class AgentTurnHookSpec:
turn_hooks: list[AgentHook] = field(default_factory=list)
ephemeral: bool = False
run_extra_hooks_for_ephemeral: bool = False
attributes: dict[str, Any] | None = None
def build_agent_turn_hook(spec: AgentTurnHookSpec) -> AgentHook: