feat(agent): integrate structured runner interactions

This commit is contained in:
fdc310
2026-07-22 11:12:26 +08:00
parent e3df35e7f7
commit 6b13c37c3b
58 changed files with 6153 additions and 319 deletions
@@ -30,16 +30,10 @@ class AgentBindingResolver:
Agent and does not carry enough scope metadata to make that decision
safely here.
"""
matches = [
agent
for agent in agents
if agent.enabled and event.event_type in agent.event_types
]
matches = [agent for agent in agents if agent.enabled and event.event_type in agent.event_types]
if not matches:
raise AgentBindingResolutionError(
f'No Agent binding matches event_type={event.event_type}'
)
raise AgentBindingResolutionError(f'No Agent binding matches event_type={event.event_type}')
if len(matches) > 1:
agent_ids = ', '.join(agent.agent_id or '<anonymous>' for agent in matches)
@@ -57,7 +51,7 @@ class AgentBindingResolver:
)
return AgentBinding(
binding_id=f"agent_{agent.agent_id or 'default'}_{agent.runner_id}",
binding_id=f'agent_{agent.agent_id or "default"}_{agent.runner_id}',
scope=scope,
event_types=list(agent.event_types),
runner_id=agent.runner_id,
@@ -67,4 +61,6 @@ class AgentBindingResolver:
delivery_policy=agent.delivery_policy,
enabled=agent.enabled,
agent_id=agent.agent_id,
processor_type=agent.processor_type,
processor_id=agent.processor_id or agent.agent_id,
)