Changelog¶
Note
Current latest version: 2.0.0-RC1. See the GitHub release notes for the full release-by-release change list.
AgentScope Java 2.0 aims to preserve compatibility with 1.x where possible so that most users can upgrade smoothly. That said, 2.0 does introduce API-level changes. This page splits those changes into two sections:
Migration Guide — what changes against 1.x, in two tiers:
Part A · Required — your code will fail to compile or throw at runtime if you don’t migrate
Part B · Recommended — still works but
@Deprecated(forRemoval = true); will be removed in the next minor
What’s New — net-new capabilities that don’t appear in the Migration Guide
Migration Guide¶
Part A — Required (compile errors or runtime exceptions if you don’t migrate)¶
Items in this section are removed, renamed, or have their semantics tightened. Code that worked on 1.x will not work as-is on 2.0.
A.1 Removed ReActAgent.Builder methods¶
Removed in 2.0 |
Replacement |
|---|---|
|
|
|
Same — |
Detail → Context
A.2 Removed packages and classes¶
Removed in 2.0 |
Replacement |
|---|---|
|
Configure |
|
Compose middleware + sub-agents + the event stream for multi-agent orchestration. See the subagent guide → Subagent |
|
Core no longer ships TTS. Integrate the upstream provider SDK directly if you need TTS |
|
Use |
|
Removed alongside the TTS module |
A.3 state package restructure (compile error)¶
v1 |
v2 |
|---|---|
|
|
|
removed — no longer a superclass for |
|
removed — replaced by the |
|
Moved to |
(new) |
|
Any code that imports AgentMetaState, StateModule, StatePersistence, or ToolkitState from io.agentscope.core.state will fail to compile. Detail → Context
A.4 Msg content validation is stricter (runtime exception)¶
Msg now validates content against role at construction time:
USER— onlyTextBlock/DataBlock/ImageBlock/AudioBlock/VideoBlockSYSTEM— onlyTextBlockASSISTANT— unrestricted
Combinations that v1 tolerated (for example, a USER message carrying a ToolUseBlock) now throw at construction. Use the role-pinned subclasses UserMessage / AssistantMessage / SystemMessage / ToolResultMessage to make role/content compatibility obvious at the call site. Detail → Message & Event
Part B — Recommended (@Deprecated(forRemoval = true), still callable today)¶
Items in this section compile and run on 2.0, but each has been marked for removal in the next minor. Migrate at your own pace; we recommend doing it sooner rather than later.
B.1 SkillBox → skill repositories¶
SkillBox(the class) andBuilder.skillBox(SkillBox)are both@Deprecated(forRemoval = true, since = "2.0.0").Recommended path: register one or more
AgentSkillRepositoryimplementations (built-ins:ClasspathSkillRepository,FileSystemSkillRepository) viaBuilder.skillRepository(...)/.skillRepositories(...). When at least one repository is registered,DynamicSkillMiddlewareis auto-installed and rebuilds the skill prompt on everycall().Fine-grained filtering:
Builder.skillFilter(SkillFilter). To disable the auto-installed middleware (so an external orchestrator likeHarnessAgentcan attach its own), useBuilder.dynamicSkillsEnabled(false).
Detail → Skill
B.2 Hook → Middleware¶
The entire io.agentscope.core.hook package — the Hook interface, HookEvent, HookEventType, and all *Event classes — is @Deprecated(forRemoval = true, since = "2.0.0"). Existing imports still compile, and Builder.hook(...) / .hooks(...) are kept callable via LegacyHookDispatcher so v1 code does not break overnight. The recommended extension surface is now io.agentscope.core.middleware:
MiddlewareBaseexposes five stages: the onion-shapedonAgent/onReasoning/onActing/onModelCall, and the pipeline-shapedonSystemPrompt.Builder methods:
.middleware(MiddlewareBase)and.middlewares(List<? extends MiddlewareBase>).Built-in:
TaskReminderMiddleware(pairs withTodoTools, re-injects the task list before each reasoning step).
Detail → Middleware
B.3 Memory → Session + AgentState¶
The
io.agentscope.core.memory.Memoryinterface and every implementation (InMemoryMemory,LongTermMemory, …) are@Deprecated(forRemoval = true, since = "2.0.0").Memoryno longer extendsStateModule. It gainssaveTo(Session, SessionKey)/loadFrom(Session, SessionKey)as a v1 bridge so existing implementations can still round-trip throughSession.Recommended model:
Conversation history lives on
AgentState.getContext().Persistence uses the
Sessionabstraction (built-in:InMemorySession,JsonSession), partitioned bySessionKey.Builder chain:
.session(Session).sessionKey(SessionKey)—AgentStateis saved/loaded automatically on everycall().
Detail → Context
B.4 Event subscription: hooks + chunk events → streamEvents()¶
Code that watched text or tool-call deltas via Hook + *ChunkEvent in v1 can migrate to agent.streamEvents(), which returns a Flux<AgentEvent> covering 28 typed events across the full agent lifecycle and the HITL flow (RequireUserConfirmEvent, RequireExternalExecutionEvent, UserConfirmResultEvent, ExternalExecutionResultEvent, …).
Alongside the new event stream, the Msg refactor adds:
DataBlock— unified multimodal block, accepts base64 or URL sourcesHintBlock— agent guidance / intermediate reasoningToolCallState/ToolResultStateonToolUseBlock/ToolResultBlock— tool-call lifecycleidfield on every block — stable references across the stream
Detail → Message & Event
stream() → streamEvents() (alignment with Python 2.0)¶
Python 2.0’s agent.reply_stream() exposes a single streaming signature (AsyncGenerator[AgentEvent, None]) that maps directly to Java’s fine-grained io.agentscope.core.event.AgentEvent hierarchy. To match it, the coarse-grained Flux<Event> stream(...) API on the Java side is @Deprecated as of 2.0.0:
Methods (
forRemoval = true, going away next minor)StreamableAgent.stream(...)— all 11stream(...)overloads on the interface (defaults + abstract)AgentBase.stream(...)— 3Flux<Event>implementationsReActAgent.stream(..., RuntimeContext)— 4RuntimeContext-suffixed overloadsHarnessAgent.stream(...)— 9 overloads (3 interface@Overrides + 6RuntimeContextvariants).HarnessAgentgains 4 newstreamEvents(Msg/List<Msg>[, RuntimeContext])methods that delegate toReActAgent.streamEvents(...)while reusing the sandbox lifecycleacquireForCall/releaseForCallReActAgent.streamEvents(..., RuntimeContext)added — mirrorscall(..., RuntimeContext)for context propagation
Types (soft deprecation, no
forRemovalyet)io.agentscope.core.agent.Event,EventType,EventSourceStill consumed internally by the harness (subagent event forwarding:
SubAgentTool/SubagentEventBus/DefaultAgentManager/AgentSpawnTool), AGUI, A2A, chat-completions-web, and Kotlin extension modules as the event-bus / adapter input. They will be flipped toforRemoval = trueonly after those modules migrate toAgentEvent, so the entire downstream is not warning-flooded in a single release.Current gap:
HarnessAgent.streamEvents(...)does not forward subagent events yet — theAgentEventhierarchy has no equivalentEventSourcechannel. Callers that need the child-agent stream must stay on the deprecatedstream(...)path until that channel lands.
New code should use:
agent.streamEvents(new UserMessage("Hello"))
.doOnNext(event -> {
if (event.getType() == AgentEventType.TEXT_BLOCK_DELTA) {
System.out.print(((TextBlockDeltaEvent) event).getDelta());
}
})
.blockLast();
B.5 RAG module — in progress¶
Knowledge,KnowledgeRetrievalTools,RAGMode,GenericRAGHookare all@Deprecated(forRemoval = true, since = "2.0.0").The builder methods
.knowledge(...)/.knowledges(...)/.ragMode(...)/.retrieveConfig(...)are deprecated in parallel.The v2 rewrite is underway. New knowledge base, document reader, and store APIs will land in subsequent minor releases. The v1 implementations remain callable in 2.0 for compatibility, but new code should not depend on them.
B.6 Long-term memory module — in progress¶
LongTermMemory,LongTermMemoryMode,LongTermMemoryToolsare all@Deprecated(forRemoval = true, since = "2.0.0").The builder methods
.longTermMemory(...)/.longTermMemoryMode(...)/.longTermMemoryAsyncRecord(...)are deprecated in parallel.Same status — being rewritten on the v2 architecture. New code should not depend on the current API.
B.7 Core shell / file tools — move to Harness¶
io.agentscope.core.tool.coding.*(ShellCommandTool,CommandValidator,UnixCommandValidator,WindowsCommandValidator) andio.agentscope.core.tool.file.*(ReadFileTool,WriteFileTool,FileToolUtils) are all@Deprecated(forRemoval = true, since = "2.0.0").These tools run commands and read/write files directly against the host process — no workspace or permission isolation — so they are being moved out of the core built-in toolset.
Recommended path: use the
agentscope-harnessmodule to run equivalent tools inside a workspace context. You get unified local / Docker / cloud-sandbox backends, file-IO permissions, a read/write cache, and HITL approval for free.
Detail → Harness filesystem
What’s New¶
The capabilities below are additive in 2.0 — none of them break 1.x code. The Migration Guide above already covers the event system, message refactor, and middleware mechanism, so they are not repeated here.
Toolkit & Permission¶
Tool execution is the main extension surface in 2.0, and the permission system sits directly on its execution path — so we present them together.
Toolkit upgrades:
Unified base classes:
ToolBase/AgentToolTool groups:
ToolGroup/ToolGroupScope/MetaToolFactory— activate on demand; the reservedbasicgroup is always onAnnotation-driven registration:
ReflectiveFunctionTool+@Tool/@ToolParam;Toolkit#registerTool(Object)reflectively registers any annotated methodsBuilt-in task tool:
io.agentscope.core.tool.builtin.TodoTools.todoWrite(pairs withTaskReminderMiddleware)
Permission system (new package
io.agentscope.core.permission):PermissionEngine,PermissionRule,PermissionMode(DEFAULT/ACCEPT_EDITS/EXPLORE/BYPASS/DONT_ASK),PermissionBehaviorEvery tool call goes through
PermissionEngine: allow / require user confirmation / deny. HITL decisions flow back asUserConfirmResultEvent.
Detail → Tool, Permission System
Model fault tolerance and credentials¶
New package
io.agentscope.core.credential— 8 provider credential classes +ModelCardModelRegistryresolves models from"provider:model"strings (e.g.dashscope:qwen-max,openai:gpt-5)Builder additions:
.model(String),.maxRetries(int),.fallbackModel(Model)/.fallbackModel(String),.stopOnReject(boolean)— primary-model failure auto-retries and falls back
Detail → Model
Workspace (Harness module)¶
Workspace abstraction unifies local filesystem, Docker, and E2B cloud sandbox execution behind a single interface
Warm-up pool — pre-initialize execution environments in batches; useful for parallel RL rollouts
Detail → Workspace
Other new Builder methods¶
.enableTaskList(...)/.enableTaskList(boolean)— enable the built-inTodoTools.permissionContext(PermissionContextState)— preload permission rulesReActAgent.Builder.fromAgent(ReActAgent)— derive a new builder from an existing agent’s observable configuration (name, description, system prompt, model, maxIters, generateOptions, toolkit)HarnessAgent.Builder.fromAgent(ReActAgent)— ReActAgent → HarnessAgent migration helper. Inherits the same 7 fields asReActAgent.Builder.fromAgentplus every other observable configuration on ReActAgent:session/sessionKey,ModelConfig(maxRetries/fallbackModel),ReactConfig.stopOnReject,modelExecutionConfig/toolExecutionConfig/toolExecutionContext,structuredOutputReminder,enablePendingToolRecovery,checkRunning,permissionContext,middlewares, andhooks. The only flags not copied areenableMetaTool/enableTaskList— these are builder-time toolkit-mutation flags, and the toolkit copy already carries the tools they registered. Harness-only config (workspace / filesystem / subagents / skills / plan mode /disable*toggles) still has to be set explicitly. See javadoc for the full table.6 new getters on ReActAgent / parents to support the above migration:
getModelExecutionConfig()/getToolExecutionConfig()/getToolExecutionContext()/isPendingToolRecoveryEnabled()/getPermissionContext()(onReActAgent);getStructuredOutputReminder()(onStructuredOutputCapableAgent);isCheckRunning()(onAgentBase).
Detail → Agent