Class AgentProtocolTaskStore
java.lang.Object
io.agentscope.extensions.agentprotocol.AgentProtocolTaskStore
In-memory execution handles with control-plane
TaskRecord persistence.
Each run resolves its HarnessAgent through the AgentFactory, which receives
the submission context and can therefore route per task. For concurrent task execution, return a
new instance per call (e.g. a Spring prototype-scoped bean); a shared instance requires the agent
to be configured with checkRunning(false).
Task metadata is stored via ProtocolTaskRepository (a dedicated control-plane path),
not via any execution agent's workspace. Caller-supplied context.attributes reach the
run through its RuntimeContext; see RuntimeContextCustomizer for controlling how.
-
Constructor Summary
ConstructorsConstructorDescriptionAgentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository) AgentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository, AgentProtocolEventBus eventBus, AgentProtocolProperties properties) AgentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository, AgentProtocolEventBus eventBus, AgentProtocolProperties properties, List<RuntimeContextCustomizer> runtimeContextCustomizers) AgentProtocolTaskStore(io.agentscope.harness.agent.HarnessAgent harnessAgent, ProtocolTaskRepository taskRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoideventBus()voidresume(String taskId, List<io.agentscope.harness.agent.subagent.protocol.RemoteConfirmDecision> decisions) Resumes a task paused for HITL confirmation with the given decisions.voidStarts a background task.voidBlocks until the task reaches a terminal state or the timeout elapses.
-
Constructor Details
-
AgentProtocolTaskStore
public AgentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository, AgentProtocolEventBus eventBus, AgentProtocolProperties properties) -
AgentProtocolTaskStore
public AgentProtocolTaskStore(AgentFactory agentFactory, ProtocolTaskRepository taskRepository, AgentProtocolEventBus eventBus, AgentProtocolProperties properties, List<RuntimeContextCustomizer> runtimeContextCustomizers) -
AgentProtocolTaskStore
-
AgentProtocolTaskStore
public AgentProtocolTaskStore(io.agentscope.harness.agent.HarnessAgent harnessAgent, ProtocolTaskRepository taskRepository)
-
-
Method Details
-
eventBus
-
submit
Starts a background task. Idempotent while running: if a non-terminal task with the same id already exists, returns without starting a duplicate run.- Throws:
IllegalStateException- if the task id already completed (HTTP 409)
-
submit
-
resume
public void resume(String taskId, List<io.agentscope.harness.agent.subagent.protocol.RemoteConfirmDecision> decisions) Resumes a task paused for HITL confirmation with the given decisions.- Throws:
IllegalStateException- if the task is not awaiting confirmation
-
snapshot
-
waitFor
Blocks until the task reaches a terminal state or the timeout elapses. Does not complete while awaiting confirmation — returnsawaiting_confirmso the client can resume.- Throws:
Exception
-
cancel
-