Enum Class WorkspaceMode
- All Implemented Interfaces:
Serializable,Comparable<WorkspaceMode>,Constable
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 RuntimeContext
carries those fields. The composed key has form
{declarationName}[@{parentSessionId}][#{userId}] and is applied uniformly across
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkspaceModeReturns the enum constant of this class with the specified name.static WorkspaceMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ISOLATED
The subagent gets its own isolated workspace.- If
SubagentDeclaration.getWorkspacePath()is set, that path is the runtime root and also the source for the sysPrompt (AGENTS.md). - Otherwise the runtime root is auto-created at
mainWorkspace/agents/<name>/workspace/and the inline body is used as sysPrompt.
- If
-
SHARED
The subagent shares the main agent's workspace.- The runtime root is always
mainWorkspace, regardless ofSubagentDeclaration.getWorkspacePath(). - If
workspacePathis set, itsAGENTS.mdis used as the sysPrompt body; but the definition'sskills/,knowledge/, andMEMORY.mdare ignored. - If
workspacePathis absent, the inline body is used as sysPrompt.
- The runtime root is always
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-