sessiontranscript

package
v0.1.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sessiontranscript reads the vendor session record for an agent session so a member can see their own work (ADR-036).

Each vendor writes a different record, so a format is detected and handed to its own adapter (ADR-039). Files are read locally and bounded from the tail; nothing here copies a transcript to a second durable store. Raw tool results, command output, attachments, and any vendor-encrypted reasoning are dropped during parsing and never become candidates for sharing.

Index

Constants

View Source
const (
	// MaxTailBytes bounds how much of a long-running session is read. Sessions
	// routinely reach tens of megabytes; only recent turns are useful.
	MaxTailBytes = 2 << 20

	// MaxMessages bounds how many parsed messages are retained.
	MaxMessages = 200
	// MaxMessageBytes bounds a single rendered message.
	MaxMessageBytes = 8000
)
View Source
const (
	KindUser      = "user"
	KindAssistant = "assistant"
	KindThinking  = "thinking"
	KindSystem    = "system"
	KindTool      = "tool"
)

Kinds a transcript can yield. "thinking" is reasoning the vendor itself surfaced; Overgent never reads encrypted reasoning or infers hidden chain of thought. "tool" carries a name only and is never shareable content.

Variables

This section is empty.

Functions

func LocateCodexRollout

func LocateCodexRollout(home, sessionID string) string

LocateCodexRollout finds the rollout file for a Codex session. Codex does not pass a transcript path to its hooks, but it names every rollout after the session id, so the file is discoverable from the id the hook already sends. The id is used locally for this lookup only and is never published.

func TranscriptAvailable

func TranscriptAvailable(vendor string) bool

TranscriptAvailable reports whether a vendor writes a session record this package can parse. Callers use it to skip a read that can only fail, so an absent transcript is a known vendor limitation rather than a read error that looks like a broken file.

Types

type Message

type Message struct {
	Kind string `json:"kind"`
	Text string `json:"text,omitempty"`
	Tool string `json:"tool,omitempty"`
	At   string `json:"at,omitempty"`
}

type Session

type Session struct {
	SessionID string    `json:"sessionId"`
	Vendor    string    `json:"vendor,omitempty"`
	Title     string    `json:"title,omitempty"`
	Branch    string    `json:"branch,omitempty"`
	Messages  []Message `json:"messages"`
}

func Read

func Read(path string, limit int) (Session, error)

Read parses the session record at path, keeping at most the last `limit` messages. A malformed record is skipped so one bad line never hides a session; an unreadable or unrecognized file is an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL