handoffs

package
v0.1.55 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package handoffs transfers reviewed context into a fresh agent session. It never copies a native session ID, credentials, permissions or bot instructions.

Index

Constants

View Source
const MaxContextBytes = agent.MaxHandoffContextBytes

Variables

View Source
var ErrPreviewChanged = errors.New("source context changed; refresh and review the handoff before starting")

Functions

This section is empty.

Types

type Preview

type Preview struct {
	Source        registry.HandoffOrigin `json:"source"`
	Context       string                 `json:"context"`
	Truncated     bool                   `json:"truncated"`
	HistorySource string                 `json:"historySource"` // native or recorded
	Capsule       agent.HandoffContext   `json:"capsule"`
	Digest        string                 `json:"digest"`
	Losses        []agent.HandoffLoss    `json:"losses,omitempty"`
}

type Request

type Request struct {
	NewChatID     string `json:"newChatId"`
	RequestID     string `json:"requestId"`
	TargetAgentID string `json:"targetAgentId"` // saved workspace profile, not a harness type
	Task          string `json:"task"`
	// nil builds context from the source; an explicit value is the user's reviewed edit.
	Context *string `json:"context,omitempty"`
	// Binds a reviewed context to the preview that produced it. Stale first
	// admissions must refresh; accepted retries recover their persisted receipt.
	PreviewDigest string `json:"previewDigest,omitempty"`
}

type Result

type Result struct {
	ChatID string      `json:"chatId"`
	Run    session.Run `json:"run"`
}

type Service

type Service struct {
	Registry   *registry.Store
	Store      *session.Store
	Supervisor *orchestrator.Supervisor
	Mutation   *sync.Mutex
}

func (*Service) Preview

func (s *Service) Preview(ctx context.Context, sourceID string) (Preview, error)

func (*Service) Start

func (s *Service) Start(ctx context.Context, sourceID string, request Request) (Result, error)

Start creates a linked chat and starts an ordinary supervised turn. Persisted receipts plus normal turn idempotency make lost acknowledgements safe to retry.

Jump to

Keyboard shortcuts

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