Class ContextSnapshot
java.lang.Object
io.agentscope.extensions.aistio.model.ContextSnapshot
Level-4 effective-context snapshot: what the agent's next model call will actually see.
Carries both encodings — toProto() for the ASDP ContextReport upstream push,
and toJsonMap() for GET /agentscope/sessions/{id}/context.
computeHash() produces the same digest as the Go control plane and the Python SDK:
SHA-256 over recursively key-sorted, separator-free JSON of the effective content, truncated to
HASH_LEN hex characters. The control plane compares hashes to detect context drift
without fetching the body.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder forContextSnapshot.static final recordOne message in the effective context.static final recordOne tool currently exposed to the agent. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNumber of leading hex characters of the SHA-256 digest kept as the context hash. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextSnapshot.Builderlonglongbyte[]intgetModel()intgetTools()intbooleanRecomputes and storesgetContextHash(), returning the new value.Response body forGET /agentscope/sessions/{id}/context.toProto()
-
Field Details
-
HASH_LEN
public static final int HASH_LENNumber of leading hex characters of the SHA-256 digest kept as the context hash.- See Also:
-
-
Method Details
-
builder
-
getSessionId
-
getSystemPrompt
-
getMessages
-
getTools
-
isCompacted
public boolean isCompacted() -
getCompactionSummary
-
getOriginalMessageCount
public int getOriginalMessageCount() -
getCompactedAt
public long getCompactedAt() -
getFramework
-
getModel
-
getFrameworkState
public byte[] getFrameworkState() -
getCapturedAt
public long getCapturedAt() -
getTotalTokens
public int getTotalTokens() -
getMaxTokens
public int getMaxTokens() -
getContextHash
-
refreshHash
Recomputes and storesgetContextHash(), returning the new value. -
computeHash
-
toProto
-
toJsonMap
Response body forGET /agentscope/sessions/{id}/context.
-