Class AgentProtocolAutoConfiguration
ConditionalOnBean is applied at the @Bean method level (not class level) to
avoid Spring Boot auto-configuration ordering issues: class-level @ConditionalOnBean on
@AutoConfiguration classes may evaluate before user-defined beans are registered.
Agent selection goes through AgentFactory. Without a user-defined bean, the default
factory resolves the single HarnessAgent bean for every task; define an
AgentFactory bean to route per agent_id or submission context.
Protocol task metadata is persisted through ProtocolTaskRepository,
rooted at AgentProtocolProperties.getTaskStorePath() by default — not through any
execution agent's workspace.
All RuntimeContextCustomizer beans are applied, in @Order, to the runtime
context of every task run.
For concurrent task execution, register the HarnessAgent bean as
@Scope("prototype") so that each task obtains its own instance. Alternatively, configure
the singleton with checkRunning(false) if concurrent access is otherwise safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionagentProtocolAgentFactory(org.springframework.beans.factory.ObjectProvider<io.agentscope.harness.agent.HarnessAgent> agentProvider) agentProtocolController(AgentProtocolTaskStore store, AgentProtocolProperties properties) agentProtocolEventBus(AgentProtocolProperties properties) agentProtocolTaskRepository(AgentProtocolProperties properties) agentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository, AgentProtocolEventBus eventBus, AgentProtocolProperties properties, org.springframework.beans.factory.ObjectProvider<RuntimeContextCustomizer> runtimeContextCustomizers)
-
Constructor Details
-
AgentProtocolAutoConfiguration
public AgentProtocolAutoConfiguration()
-
-
Method Details
-
agentProtocolEventBus
@Bean @ConditionalOnMissingBean(AgentProtocolEventBus.class) public AgentProtocolEventBus agentProtocolEventBus(AgentProtocolProperties properties) -
agentProtocolAgentFactory
@Bean @ConditionalOnBean(io.agentscope.harness.agent.HarnessAgent.class) @ConditionalOnMissingBean(AgentFactory.class) public AgentFactory agentProtocolAgentFactory(org.springframework.beans.factory.ObjectProvider<io.agentscope.harness.agent.HarnessAgent> agentProvider) -
agentProtocolTaskRepository
@Bean @ConditionalOnMissingBean(ProtocolTaskRepository.class) public ProtocolTaskRepository agentProtocolTaskRepository(AgentProtocolProperties properties) -
agentProtocolTaskStore
@Bean @ConditionalOnBean({AgentFactory.class,ProtocolTaskRepository.class}) public AgentProtocolTaskStore agentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository, AgentProtocolEventBus eventBus, AgentProtocolProperties properties, org.springframework.beans.factory.ObjectProvider<RuntimeContextCustomizer> runtimeContextCustomizers) -
agentProtocolController
@Bean @ConditionalOnBean(AgentProtocolTaskStore.class) public AgentProtocolController agentProtocolController(AgentProtocolTaskStore store, AgentProtocolProperties properties)
-