AS AgentScopeAPI 手册 / API Reference

WorkspaceMode

public enum WorkspaceMode
源码Source io/agentscope/harness/agent/subagent/WorkspaceMode.java:42–70

定义工作区模式相关取值的枚举。位于 io.agentscope.harness.agent.subagent 包。核心成员包括 ISOLATED、SHARED。

Controls how a declared subagent's runtime workspace root is determined.

The five-row decision table:


workspacePath mode runtime-workspace-root
─────────────────────────────────────────────────────────────────────────────
set ISOLATED workspacePath (definition dir is also the runtime root)
set SHARED mainWorkspace (definition skills/knowledge ignored)
null ISOLATED mainWorkspace/agents/<name>/workspace/ (auto-created)
null SHARED mainWorkspace
(general-purpose, always SHARED) mainWorkspace (fully mirrors main agent)

Phase B-0 — persisted session bucketing: ISOLATED-mode subagents bucket their persisted state by parent (userId, parentSessionId) when the spawn-time io.agentscope.core.agent.RuntimeContext carries those fields. The composed key has form {declarationName}[@{parentSessionId}][#{userId}] and is applied uniformly across io.agentscope.core.state.AgentStateStore stores (Workspace, Redis, InMemory, custom), because all of them already partition state by (userId, sessionId). SHARED-mode is unchanged — those subagents intentionally use the parent's bucket and do not multi-tenant.

枚举常量摘要Enum Constant Summary

常量Constant说明Description
ISOLATED
判断是否OLATED。
The subagent gets its own isolated workspace.
SHARED
执行共享相关操作。
The subagent shares the main agent's workspace.

枚举常量详情Enum Constant Detail

ISOLATED

ISOLATED
staticfinal

判断是否OLATED。

The subagent gets its own isolated workspace.

源码Source io/agentscope/harness/agent/subagent/WorkspaceMode.java:55

SHARED

SHARED
staticfinal

执行共享相关操作。

The subagent shares the main agent's workspace.

源码Source io/agentscope/harness/agent/subagent/WorkspaceMode.java:69
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.