Enum Class IsolationScope
- All Implemented Interfaces:
Serializable,Comparable<IsolationScope>,Constable
This enum is the canonical isolation-scope definition used by both the sandbox filesystem
backend (SandboxContext) and the remote filesystem
backend (RemoteFilesystemSpec).
Sandbox semantics: the scope determines which key is used when persisting and loading
_sandbox.json state. Calls that resolve to the same scope key will
sequentially reuse the same sandbox (each call resumes the persisted state from the previous
one).
Store namespace semantics: the scope determines the namespace prefix used by
RemoteFilesystem when routing files to the shared
key-value store. Different scopes produce different namespace prefixes, controlling which calls
share the same view of stored files.
Scope selection:
USER– shared across all sessions of the same user; the default. WhenuserIdis absent, falls back toSESSION.SESSION– isolated per session.AGENT– shared across all users and sessions of the same agent.GLOBAL– globally shared within the same workspace/store instance.
Concurrency note: for sandbox mode this is sequential-reuse sharing, not live-instance sharing. Concurrent calls at the same scope each get their own running container; they converge on the last persisted snapshot at the end of the call.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionShare across all users and sessions of the same agent (identified by agent name).One shared state / namespace globally within the same workspace store instance.Isolate by session identifier.Share across all sessions belonging to the sameuserId. -
Method Summary
Modifier and TypeMethodDescriptionCreates aNamespaceFactorythat derives the filesystem namespace prefix from theRuntimeContextaccording to this scope.static IsolationScopeReturns the enum constant of this class with the specified name.static IsolationScope[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SESSION
Isolate by session identifier.Each distinct session gets its own sandbox state / store namespace. If no session key is present in the
RuntimeContext, state lookup is skipped and a fresh sandbox is created (or a default store namespace is used). -
USER
Share across all sessions belonging to the sameuserId.This is the default scope. If
userIdis absent, resolution falls back toSESSIONusing the session identifier instead. -
AGENT
Share across all users and sessions of the same agent (identified by agent name).The agent name is fixed at build time and is always available; this scope never degrades due to a missing context field.
-
GLOBAL
One shared state / namespace globally within the same workspace store instance.Use with care: all agents and users that share the same store will compete to write the global slot.
-
-
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
-
toNamespaceFactory
Creates aNamespaceFactorythat derives the filesystem namespace prefix from theRuntimeContextaccording to this scope.- Returns:
- a namespace factory consistent with this scope
-