Class HarnessAgent
- All Implemented Interfaces:
io.agentscope.core.agent.Agent,io.agentscope.core.agent.CallableAgent,io.agentscope.core.agent.ObservableAgent,io.agentscope.core.agent.StreamableAgent,AutoCloseable
ReActAgent with workspace /
filesystem / sandbox / subagent / skill / plan-mode / MCP orchestration.
Use builder() to configure. For plain ReAct usage without any of the above, use
ReActAgent.builder() directly.
Capabilities added on top of the inner ReActAgent:
- Workspace-based context loading (AGENTS.md, MEMORY.md, KNOWLEDGE.md)
- Pluggable file-system backend (local, sandbox, remote/composite)
- Subagent orchestration via
task/task_outputtools (sync + background) - Skill loading via
AgentSkillRepository, including the self-learning loop - Memory flush + message offload before context compression
- Workspace-managed
tools.json(MCP servers + allow/deny filter) - Plan mode (read-only design phase) with
plan_enter/plan_write/plan_exittools - Context-overflow emergency compaction via
CompactionMiddleware
Thread Safety: HarnessAgent is stateless between calls and safe to use as a
singleton serving multiple users/sessions concurrently. Each call() uses the
RuntimeContext's (userId, sessionId) to isolate state.
Calls targeting the same session are serialized automatically; different sessions run in parallel.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic HarnessAgent.Builderbuilder()reactor.core.publisher.Mono<io.agentscope.core.message.Msg>call(io.agentscope.core.message.Msg msg, io.agentscope.core.agent.RuntimeContext ctx) reactor.core.publisher.Mono<io.agentscope.core.message.Msg>Calls the agent with a plain text input and per-callRuntimeContext.reactor.core.publisher.Mono<io.agentscope.core.message.Msg>Deprecated.reactor.core.publisher.Mono<io.agentscope.core.message.Msg>Deprecated.Usecall(List, JsonNode, RuntimeContext)with explicit runtime context.reactor.core.publisher.Mono<io.agentscope.core.message.Msg>call(List<io.agentscope.core.message.Msg> msgs, com.fasterxml.jackson.databind.JsonNode schema, io.agentscope.core.agent.RuntimeContext ctx) reactor.core.publisher.Mono<io.agentscope.core.message.Msg>reactor.core.publisher.Mono<io.agentscope.core.message.Msg>Deprecated.Usecall(List, Class, RuntimeContext)with explicit runtime context.reactor.core.publisher.Mono<io.agentscope.core.message.Msg>call(List<io.agentscope.core.message.Msg> msgs, Class<?> structuredModel, io.agentscope.core.agent.RuntimeContext ctx) <T extends Channel>
Tchannel(T channel) Returns a channel bound to this agent's internal gateway.voidclearContext(io.agentscope.core.agent.RuntimeContext ctx) Clears the model-visible conversation context for the session identified byctx.voidclearContext(String userId, String sessionId) Clears the model-visible conversation context for one(userId, sessionId)session.voidClears all locally cached per-session state and permission engines held by the wrappedReActAgent.voidclearStateCache(io.agentscope.core.agent.RuntimeContext ctx) Clears the locally cached state and permission engine for the session identified byctx.voidclearStateCache(String userId, String sessionId) Clears the locally cached state and permission engine for one(userId, sessionId)slot.voidclose()voidenterPlanMode(io.agentscope.core.agent.RuntimeContext ctx) Enters plan mode for the session identified by the givenRuntimeContext.voidenterPlanMode(String userId, String sessionId) Enters plan mode for the given(userId, sessionId)session, independent of which slot is currently active.voidexitPlanMode(io.agentscope.core.agent.RuntimeContext ctx) Exits plan mode for the session identified by the givenRuntimeContext.voidexitPlanMode(String userId, String sessionId) Exits plan mode for the given(userId, sessionId)session and persists the change.gateway()Returns the internal gateway backingchannel(T).io.agentscope.core.state.AgentStateDeprecated.UsegetDelegate().getAgentState(RuntimeContext)or.getAgentState(String, String)with explicit session identity.Returns theCompactionMiddlewareinstance if compaction was configured, ornull.io.agentscope.core.ReActAgentReturns the wrappedReActAgent.The distributed store configured on this agent, ornullfor local deployments.intio.agentscope.core.model.ModelgetModel()getName()io.agentscope.core.permission.PermissionModegetPermissionMode(String userId, String sessionId) List<io.agentscope.core.skill.repository.AgentSkillRepository>Returns the ordered list ofAgentSkillRepositoryinstances bound to this agent (low to high priority).Access to the sidecar telemetry store.io.agentscope.core.state.AgentStateStoreThe internalDefaultAgentManagerable to re-materialize this agent's subagents, ornullwhen none is owned (e.g. session-mode external subagent tool).Background subagentTaskRepositoryowned by the subagent middleware, ornullwhen subagents are not configured.io.agentscope.core.tool.ToolkitReturns the workspace manager bound to this agent, ornullif not configured.voidvoidinterrupt(io.agentscope.core.agent.RuntimeContext ctx) Interrupts the in-flight call for the session identified byctx.voidinterrupt(io.agentscope.core.agent.RuntimeContext ctx, io.agentscope.core.message.Msg msg) Interrupts the in-flight call for the session identified byctxwith an associated user message.voidinterrupt(io.agentscope.core.message.Msg msg) voidInterrupts the in-flight call for a specific(userId, sessionId)session.voidInterrupts the in-flight call for a specific(userId, sessionId)session with an associated user message.booleanisPlanModeActive(io.agentscope.core.agent.RuntimeContext ctx) booleanisPlanModeActive(String userId, String sessionId) reactor.core.publisher.Mono<Void>observe(io.agentscope.core.message.Msg msg) reactor.core.publisher.Mono<Void>io.agentscope.core.agent.AgentRun<io.agentscope.core.message.Msg>prepareCall(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Prepare a cancellable reply execution covering the complete harness/sandbox lifecycle.io.agentscope.core.agent.AgentRun<io.agentscope.core.event.AgentEvent>prepareRun(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Prepare a cancellable execution covering the complete harness/sandbox lifecycle.reactor.core.publisher.Mono<SkillPromoter.PromotionResult>promoteSkill(String name, String reviewerId, io.agentscope.core.agent.RuntimeContext ctx) Promote a draft skill for the explicitly supplied request context.queryAudit(String dayUtc, Predicate<SkillAuditLog.Entry> filter) Query the audit log for a given UTC day.reactor.core.publisher.Mono<SkillCurator.CuratorRunReport>Force-run the skill curator immediately, bypassing the idle-and-interval gate.voidsetPermissionMode(io.agentscope.core.agent.RuntimeContext ctx, io.agentscope.core.permission.PermissionMode mode) Switches thePermissionModefor the session identified by the givenRuntimeContextat runtime.voidsetPermissionMode(String userId, String sessionId, io.agentscope.core.permission.PermissionMode mode) Switches thePermissionModefor the given(userId, sessionId)session at runtime, preserving configured rules and rebuilding the cached permission engine.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>stream(io.agentscope.core.message.Msg msg, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, Class<?> structuredModel) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.agent.Event>stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, Class<?> structuredModel, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(io.agentscope.core.message.Msg msg) Deprecated.UsestreamEvents(Msg, RuntimeContext)with explicit runtime context.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(io.agentscope.core.message.Msg msg, io.agentscope.core.agent.RuntimeContext ctx) Stream fine-grainedAgentEvents for a single message with a caller-suppliedRuntimeContext.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(String text) Deprecated.UsestreamEvents(String, RuntimeContext)with explicit runtime context.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(String text, io.agentscope.core.agent.RuntimeContext ctx) Stream fine-grainedAgentEvents for a plain text input with a caller-suppliedRuntimeContext.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(List<io.agentscope.core.message.Msg> msgs) Deprecated.UsestreamEvents(List, RuntimeContext)with explicit runtime context.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Stream fine-grainedAgentEvents for a list of messages with a caller-suppliedRuntimeContext.workspaceFor(String userId, String sessionId) Returns aWorkspaceManagerview whose filesystem and namespace are bound to the given(userId, sessionId)for the duration of the returned view's IO.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.agentscope.core.agent.CallableAgent
call, call, call, call, call, call, call, call, call, callMethods inherited from interface io.agentscope.core.agent.StreamableAgent
stream, stream, stream, stream, stream, stream, stream, stream
-
Method Details
-
getWorkspaceManager
Returns the workspace manager bound to this agent, ornullif not configured. -
workspaceFor
Returns aWorkspaceManagerview whose filesystem and namespace are bound to the given(userId, sessionId)for the duration of the returned view's IO. UnlikegetWorkspaceManager(), this does not mutate any shared state on this agent — so it is safe to call concurrently from per-request controllers without racing with active chats. -
getCompactionHook
Returns theCompactionMiddlewareinstance if compaction was configured, ornull. -
getSkillRepositories
Returns the ordered list ofAgentSkillRepositoryinstances bound to this agent (low to high priority). -
getSkillUsageStore
Access to the sidecar telemetry store. Null whenenableSkillManageToolwas not configured. -
queryAudit
Query the audit log for a given UTC day. Passnullfor "today". Returns an empty list when the audit log is not configured (noenableSkillManageToolcall). -
runCuratorOnce
Force-run the skill curator immediately, bypassing the idle-and-interval gate. Returns aMonothat emitsnullwhen the curator is not configured. -
promoteSkill
public reactor.core.publisher.Mono<SkillPromoter.PromotionResult> promoteSkill(String name, String reviewerId, io.agentscope.core.agent.RuntimeContext ctx) Promote a draft skill for the explicitly supplied request context.Callers promoting skills outside an active
call(...)must use this overload when the workspace is user- or session-scoped so the draft is resolved and moved within the correct namespace. -
enterPlanMode
public void enterPlanMode(io.agentscope.core.agent.RuntimeContext ctx) Enters plan mode for the session identified by the givenRuntimeContext. The change is persisted so the nextcallon that session sees it. -
exitPlanMode
public void exitPlanMode(io.agentscope.core.agent.RuntimeContext ctx) Exits plan mode for the session identified by the givenRuntimeContext. -
isPlanModeActive
public boolean isPlanModeActive(io.agentscope.core.agent.RuntimeContext ctx) - Returns:
- whether plan mode is active for the session identified by the given
RuntimeContext.
-
clearContext
public void clearContext(io.agentscope.core.agent.RuntimeContext ctx) Clears the model-visible conversation context for the session identified byctx.The session identity and non-conversation state are preserved. The next call starts with an empty conversation context. This method does not cancel an in-flight call.
- Parameters:
ctx- runtime context identifying the session
-
clearContext
Clears the model-visible conversation context for one(userId, sessionId)session.The session identity and non-conversation state are preserved. The next call starts with an empty conversation context. This method does not cancel an in-flight call.
- Parameters:
userId- user identity for the slot (null= anonymous / single-tenant)sessionId- session identity;nullor blank uses the default session id
-
clearStateCache
public void clearStateCache()Clears all locally cached per-session state and permission engines held by the wrappedReActAgent. Persisted state in the configuredAgentStateStoreis preserved. -
clearStateCache
public void clearStateCache(io.agentscope.core.agent.RuntimeContext ctx) Clears the locally cached state and permission engine for the session identified byctx. Persisted state in the configuredAgentStateStoreis preserved.- Parameters:
ctx- runtime context identifying the session
-
clearStateCache
Clears the locally cached state and permission engine for one(userId, sessionId)slot. Persisted state in the configuredAgentStateStoreis preserved.- Parameters:
userId- user identity for the slot (null= anonymous / single-tenant)sessionId- session identity;nullor blank uses the default session id
-
enterPlanMode
Enters plan mode for the given(userId, sessionId)session, independent of which slot is currently active. The change is persisted so the nextcallon that session sees it. -
exitPlanMode
Exits plan mode for the given(userId, sessionId)session and persists the change. -
isPlanModeActive
- Returns:
- whether plan mode is active for the given
(userId, sessionId)session.
-
setPermissionMode
public void setPermissionMode(io.agentscope.core.agent.RuntimeContext ctx, io.agentscope.core.permission.PermissionMode mode) Switches thePermissionModefor the session identified by the givenRuntimeContextat runtime. SeeReActAgent.setPermissionMode(String, String, io.agentscope.core.permission.PermissionMode). -
setPermissionMode
public void setPermissionMode(String userId, String sessionId, io.agentscope.core.permission.PermissionMode mode) Switches thePermissionModefor the given(userId, sessionId)session at runtime, preserving configured rules and rebuilding the cached permission engine. -
getPermissionMode
public io.agentscope.core.permission.PermissionMode getPermissionMode(String userId, String sessionId) - Returns:
- the current permission mode for the given
(userId, sessionId)session.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getDelegate
public io.agentscope.core.ReActAgent getDelegate()Returns the wrappedReActAgent. -
getModel
public io.agentscope.core.model.Model getModel() -
getMaxIters
public int getMaxIters() -
getStateStore
public io.agentscope.core.state.AgentStateStore getStateStore() -
getDistributedStore
The distributed store configured on this agent, ornullfor local deployments. Exposed soGatewayBootstrapcan build a durableSubagentRegistryfor exposed-subagent recovery. -
getSubagentAgentManager
The internalDefaultAgentManagerable to re-materialize this agent's subagents, ornullwhen none is owned (e.g. session-mode external subagent tool). Used to wire a gateway materializer for cross-node recovery. -
getTaskRepository
Background subagentTaskRepositoryowned by the subagent middleware, ornullwhen subagents are not configured. -
getDefaultSessionId
- See Also:
-
ReActAgent.getDefaultSessionId()
-
getAgentState
Deprecated.UsegetDelegate().getAgentState(RuntimeContext)or.getAgentState(String, String)with explicit session identity.- Specified by:
getAgentStatein interfaceio.agentscope.core.agent.Agent
-
getName
- Specified by:
getNamein interfaceio.agentscope.core.agent.Agent
-
getAgentId
- Specified by:
getAgentIdin interfaceio.agentscope.core.agent.Agent
-
getDescription
- Specified by:
getDescriptionin interfaceio.agentscope.core.agent.Agent
-
interrupt
public void interrupt()- Specified by:
interruptin interfaceio.agentscope.core.agent.Agent
-
interrupt
public void interrupt(io.agentscope.core.message.Msg msg) - Specified by:
interruptin interfaceio.agentscope.core.agent.Agent
-
interrupt
public void interrupt(io.agentscope.core.agent.RuntimeContext ctx) Interrupts the in-flight call for the session identified byctx.- Parameters:
ctx- runtime context identifying the session to interrupt
-
interrupt
public void interrupt(io.agentscope.core.agent.RuntimeContext ctx, io.agentscope.core.message.Msg msg) Interrupts the in-flight call for the session identified byctxwith an associated user message.- Parameters:
ctx- runtime context identifying the session to interruptmsg- optional user message to attach to the interrupt signal
-
interrupt
Interrupts the in-flight call for a specific(userId, sessionId)session.- Parameters:
userId- user identity for the slot (null= anonymous / single-tenant)sessionId- session identity;nullor blank uses the default session id
-
interrupt
Interrupts the in-flight call for a specific(userId, sessionId)session with an associated user message. -
channel
Returns a channel bound to this agent's internal gateway. The gateway is created lazily on the first call and this agent is registered as the sole (main) agent.Typical usage in a Spring controller:
HarnessAgent agent = HarnessAgent.builder()...build(); ChatUiChannel chat = agent.channel(ChatUiChannel.perPeer()); // in controller chat.send("user-123", "hello");- Type Parameters:
T- the channel type- Parameters:
channel- the channel instance to bind (e.g.ChatUiChannel.perPeer())- Returns:
- the same channel instance, now wired to this agent's gateway
-
gateway
Returns the internal gateway backingchannel(T). Creates it lazily if not yet initialized. Exposed for advanced usage (e.g. directrunSubagentcalls). -
call
@Deprecated(since="2.2.0") public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(List<io.agentscope.core.message.Msg> msgs) Deprecated.Usecall(List, RuntimeContext)with explicit runtime context.- Specified by:
callin interfaceio.agentscope.core.agent.CallableAgent
-
call
@Deprecated(since="2.2.0") public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(List<io.agentscope.core.message.Msg> msgs, Class<?> structuredModel) Deprecated.Usecall(List, Class, RuntimeContext)with explicit runtime context.- Specified by:
callin interfaceio.agentscope.core.agent.CallableAgent
-
call
@Deprecated(since="2.2.0") public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(List<io.agentscope.core.message.Msg> msgs, com.fasterxml.jackson.databind.JsonNode schema) Deprecated.Usecall(List, JsonNode, RuntimeContext)with explicit runtime context.- Specified by:
callin interfaceio.agentscope.core.agent.CallableAgent
-
call
public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(io.agentscope.core.message.Msg msg, io.agentscope.core.agent.RuntimeContext ctx) -
call
public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(String text, io.agentscope.core.agent.RuntimeContext ctx) Calls the agent with a plain text input and per-callRuntimeContext.- Parameters:
text- input text (wrapped into aUserMessage)ctx- per-call runtime context- Returns:
- response message
-
call
public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) -
call
-
call
public reactor.core.publisher.Mono<io.agentscope.core.message.Msg> call(List<io.agentscope.core.message.Msg> msgs, com.fasterxml.jackson.databind.JsonNode schema, io.agentscope.core.agent.RuntimeContext ctx) -
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List)for the fine-grainedAgentEventstream that aligns with Python 2.0'sagent.reply_stream().- Specified by:
streamin interfaceio.agentscope.core.agent.StreamableAgent
-
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, Class<?> structuredModel) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List)for the fine-grainedAgentEventstream.- Specified by:
streamin interfaceio.agentscope.core.agent.StreamableAgent
-
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List)for the fine-grainedAgentEventstream.- Specified by:
streamin interfaceio.agentscope.core.agent.StreamableAgent
-
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(io.agentscope.core.message.Msg msg, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(Msg, RuntimeContext). -
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List, RuntimeContext). -
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List, RuntimeContext).- Specified by:
streamin interfaceio.agentscope.core.agent.StreamableAgent
-
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, Class<?> structuredModel, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List, RuntimeContext). -
stream
@Deprecated(since="2.0.0", forRemoval=true) public reactor.core.publisher.Flux<io.agentscope.core.agent.Event> stream(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema, io.agentscope.core.agent.RuntimeContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.0, for removal. UsestreamEvents(List, RuntimeContext). -
prepareRun
public io.agentscope.core.agent.AgentRun<io.agentscope.core.event.AgentEvent> prepareRun(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Prepare a cancellable execution covering the complete harness/sandbox lifecycle. -
prepareCall
public io.agentscope.core.agent.AgentRun<io.agentscope.core.message.Msg> prepareCall(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Prepare a cancellable reply execution covering the complete harness/sandbox lifecycle. -
streamEvents
@Deprecated(since="2.2.0") public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(io.agentscope.core.message.Msg msg) Deprecated.UsestreamEvents(Msg, RuntimeContext)with explicit runtime context. -
streamEvents
@Deprecated(since="2.2.0") public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(List<io.agentscope.core.message.Msg> msgs) Deprecated.UsestreamEvents(List, RuntimeContext)with explicit runtime context. -
streamEvents
public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(io.agentscope.core.message.Msg msg, io.agentscope.core.agent.RuntimeContext ctx) Stream fine-grainedAgentEvents for a single message with a caller-suppliedRuntimeContext.- Parameters:
msg- input messagectx- runtime context to propagate into the call- Returns:
- event stream covering the full agent invocation lifecycle
-
streamEvents
@Deprecated(since="2.2.0") public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(String text) Deprecated.UsestreamEvents(String, RuntimeContext)with explicit runtime context. -
streamEvents
public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(String text, io.agentscope.core.agent.RuntimeContext ctx) Stream fine-grainedAgentEvents for a plain text input with a caller-suppliedRuntimeContext.- Parameters:
text- input text (wrapped into aUserMessage)ctx- runtime context to propagate into the call- Returns:
- event stream covering the full agent invocation lifecycle
-
streamEvents
public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(List<io.agentscope.core.message.Msg> msgs, io.agentscope.core.agent.RuntimeContext ctx) Stream fine-grainedAgentEvents for a list of messages with a caller-suppliedRuntimeContext. The harness wraps the delegate'sReActAgent#streamEvents(List, RuntimeContext)with the same sandbox-lifecycle acquire/release semantics that thecall(...)family uses, so streaming and blocking callers behave consistently with respect to sandbox warm-up.Synchronous subagent events spawned via
agent_spawn/agent_sendare forwarded into this stream in real time with asourcetag identifying the originating child agent.- Parameters:
msgs- input messagesctx- runtime context to propagate into the call- Returns:
- event stream covering the full agent invocation lifecycle
-
observe
- Specified by:
observein interfaceio.agentscope.core.agent.ObservableAgent
-
observe
- Specified by:
observein interfaceio.agentscope.core.agent.ObservableAgent
-
getToolkit
public io.agentscope.core.tool.Toolkit getToolkit()- Specified by:
getToolkitin interfaceio.agentscope.core.agent.Agent
-
builder
-
call(List, RuntimeContext)with explicit runtime context.