feat(agent): 建立严格工具身份与调用契约 (#6280)

This commit is contained in:
InfinityPacer
2026-08-13 04:07:59 +08:00
committed by GitHub
parent 36297572fb
commit 4ee7ee2589
21 changed files with 1866 additions and 64 deletions
+3
View File
@@ -11,6 +11,7 @@ from app.agent.policy import (
ToolPolicyContext,
call_policy_hook,
)
from app.agent.tools.catalog import ToolCatalogSnapshot
class AgentPolicyMiddleware(AgentMiddleware):
@@ -25,10 +26,12 @@ class AgentPolicyMiddleware(AgentMiddleware):
*,
context: ToolPolicyContext,
orchestrator: AgentToolPolicyOrchestrator = DEFAULT_TOOL_POLICY_ORCHESTRATOR,
catalog: ToolCatalogSnapshot | None = None,
) -> None:
"""绑定宿主可信上下文和共享策略编排器。"""
self.context = context
self.orchestrator = orchestrator
self.catalog = catalog
async def awrap_tool_call(
self,