Class SessionTranscriptWriter
java.lang.Object
io.agentscope.harness.agent.memory.session.SessionTranscriptWriter
Independent writer for the session transcript JSONL (
.jsonl / .log.jsonl).
Decoupled from MemoryFlushManager: transcript
completeness must not depend on memory-flush triggers or prompts. Callers should invoke this
at turn boundaries (see TranscriptMiddleware).
Tool calls and results are recorded as structured SessionEntry.ToolUseEntry /
SessionEntry.ToolResultEntry rows so the call/result process is machine-readable.
Content may still be truncated; truncated fields carry truncated + originalSize.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSoft cap for tool input JSON in the transcript (process-complete; content may truncate).static final intSoft cap for tool output text in the transcript. -
Constructor Summary
ConstructorsConstructorDescriptionSessionTranscriptWriter(WorkspaceManager workspaceManager) SessionTranscriptWriter(WorkspaceManager workspaceManager, TranscriptStore transcriptStore, String tenant) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendMessages(io.agentscope.core.agent.RuntimeContext rc, List<io.agentscope.core.message.Msg> messages, String agentId, String sessionId) Appends new messages to the session tree idempotently (dedup by stable entry ids).resolveContextPath(io.agentscope.core.agent.RuntimeContext rc, String agentId, String sessionId) Resolves the workspace-relative path of the session context JSONL (for compaction summary references).
-
Field Details
-
INPUT_TRUNCATE_CHARS
public static final int INPUT_TRUNCATE_CHARSSoft cap for tool input JSON in the transcript (process-complete; content may truncate).- See Also:
-
OUTPUT_TRUNCATE_CHARS
public static final int OUTPUT_TRUNCATE_CHARSSoft cap for tool output text in the transcript.- See Also:
-
-
Constructor Details
-
SessionTranscriptWriter
-
SessionTranscriptWriter
public SessionTranscriptWriter(WorkspaceManager workspaceManager, TranscriptStore transcriptStore, String tenant)
-
-
Method Details
-
appendMessages
public void appendMessages(io.agentscope.core.agent.RuntimeContext rc, List<io.agentscope.core.message.Msg> messages, String agentId, String sessionId) Appends new messages to the session tree idempotently (dedup by stable entry ids). Updatessessions.jsonindex on success. -
resolveContextPath
public String resolveContextPath(io.agentscope.core.agent.RuntimeContext rc, String agentId, String sessionId) Resolves the workspace-relative path of the session context JSONL (for compaction summary references).
-