SessionEntry
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = SessionEntry.MessageEntry.class, name = "message"), @JsonSubTypes.Type(value = SessionEntry.ToolUseEntry.class, name = "tool_use"), @JsonSubTypes.Type(value = SessionEntry.ToolResultEntry.class, name = "tool_result"), @JsonSubTypes.Type(value = SessionEntry.CompactionEntry.class, name = "compaction"), @JsonSubTypes.Type(value = SessionEntry.SummaryEntry.class, name = "summary") }) @JsonInclude(JsonInclude.Include.NON_NULL) public abstract sealed class SessionEntry permits SessionEntry.MessageEntry, SessionEntry.ToolUseEntry, SessionEntry.ToolResultEntry, SessionEntry.CompactionEntry, SessionEntry.SummaryEntry
io/agentscope/harness/agent/memory/session/SessionEntry.java:43–313会话条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包。核心成员包括 getId、getParentId、getTimestamp、SessionEntry。
Base class for all session tree entries (pi-mono-inspired JSONL session model).
Each entry has a unique id and a parentId forming a tree structure.
Entries are appended to the session JSONL file in order; they are never deleted.
Entry types:
-
MessageEntry— conversation message (user/assistant/system) or placeholder -
ToolUseEntry— structured tool call (machine-readable process record) -
ToolResultEntry— structured tool result, paired viatoolCallId -
CompactionEntry— marks a compaction event (non-destructive) -
SummaryEntry— holds a compaction summary
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
MessageEntry | 类class | 消息条目,在多次调用之间保存和恢复会话与记忆数据。 A message entry wrapping a conversation turn (user/assistant/system), or a placeholder
when the message had no renderable text/tool blocks (e.g. |
ToolUseEntry | 类class | 工具使用条目,在多次调用之间保存和恢复会话与记忆数据。 Structured tool-call record. |
ToolResultEntry | 类class | 工具结果条目,在多次调用之间保存和恢复会话与记忆数据。 Structured tool-result record, paired with `ToolUseEntry` via `toolCallId`. |
CompactionEntry | 类class | 压缩条目,在多次调用之间保存和恢复会话与记忆数据。 Non-destructive compaction marker. |
SummaryEntry | 类class | 摘要条目,在多次调用之间保存和恢复会话与记忆数据。 Holds the text of a compaction summary (the condensed version of compacted messages). |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
protected SessionEntry(String id, String parentId, Instant timestamp) | 初始化 `SessionEntry` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getId() | 获取标识。 Returns the id. |
public String getParentId() | 获取父级标识。 Returns the parent id. |
public Instant getTimestamp() | 获取时间戳。 Returns the timestamp. |
构造器详情Constructor Detail
SessionEntry
protected SessionEntry(String id, String parentId, Instant timestamp)
初始化 SessionEntry 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
parentId | String | 父级标识(类型 `String`)。The parent id. |
timestamp | Instant | 时间戳(类型 `Instant`)。The timestamp. |
io/agentscope/harness/agent/memory/session/SessionEntry.java:63–67方法详情Method Detail
getId
public String getId()
获取标识。
Returns the id.
Stringio/agentscope/harness/agent/memory/session/SessionEntry.java:69–71getParentId
public String getParentId()
获取父级标识。
Returns the parent id.
Stringio/agentscope/harness/agent/memory/session/SessionEntry.java:73–75getTimestamp
public Instant getTimestamp()
获取时间戳。
Returns the timestamp.
Instantio/agentscope/harness/agent/memory/session/SessionEntry.java:77–79嵌套类详情Nested Class Detail
MessageEntry
public static final class MessageEntry extends SessionEntry消息条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getRole、getContent、getToolCallId、getBlockTypes、MessageEntry。
A message entry wrapping a conversation turn (user/assistant/system), or a placeholder when the message had no renderable text/tool blocks (e.g. image-only).
ToolUseEntry
public static final class ToolUseEntry extends SessionEntry工具使用条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getToolCallId、getName、getInput、isTruncated、getOriginalSize、ToolUseEntry。
Structured tool-call record. Process-complete and machine-readable; input may be
truncated with #truncated/#originalSize set.
ToolResultEntry
public static final class ToolResultEntry extends SessionEntry工具结果条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getToolCallId、getName、getOutput、getOutputBlockTypes、isTruncated、getOriginalSize。
Structured tool-result record, paired with ToolUseEntry via toolCallId.
output may be truncated with #truncated/#originalSize set.
CompactionEntry
public static final class CompactionEntry extends SessionEntry压缩条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getFirstKeptEntryId、getSummaryEntryId、CompactionEntry。
Non-destructive compaction marker. Records which entry is the first kept entry —
all entries before firstKeptEntryId are considered compacted (not visible
to the LLM) but remain in the file for full history replay.
SummaryEntry
public static final class SummaryEntry extends SessionEntry摘要条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getSummary、getFormat、SummaryEntry。
Holds the text of a compaction summary (the condensed version of compacted messages).