subagentview

package
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package subagentview reconstructs immutable completed subagent presentation from the durable parent spawn_agent result and child session transcript.

Index

Constants

View Source
const (
	PreviewToolLimit      = 5
	PreviewTextLineLimit  = 4
	MaxPreviewLineBytes   = 4 * 1024
	MaxExpandedActivities = 256
	MaxArtifacts          = 256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	CallID  string
	Name    string
	Info    string
	Args    json.RawMessage
	Done    bool
	Success bool
}

Activity is one durable child tool invocation in transcript order.

type CompletedRun

type CompletedRun struct {
	ParentCallID   string
	ChildSessionID string
	AgentName      string
	Prompt         string
	Output         string
	Error          string
	ErrorType      string
	DurationMs     int64
	Partial        bool

	ChildAvailable bool
	Status         session.SessionStatus
	Provider       string
	Model          string
	StartedAt      time.Time
	CompletedAt    time.Time
	ToolCalls      int
	InputTokens    int
	OutputTokens   int

	Activities  []Activity
	TextPreview []string
	Diffs       []llm.DiffData
	Images      []string
	Fingerprint uint64
}

CompletedRun is the immutable render projection for one completed parent spawn_agent tool call. Parent result fields remain authoritative for semantic output; child fields supply internal activity and metrics.

func Build

func Build(call *llm.ToolCall, result *llm.ToolResult, parsed tools.SpawnAgentResult, child *session.Session, childMessages []session.Message) CompletedRun

Build reconstructs a completed run from already-loaded durable values. child and childMessages may be absent; the parent result still provides a useful fallback card in that case.

Jump to

Keyboard shortcuts

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