agentstate

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package agentstate defines the publication and configuration guards used by process-local external runtimes. Native conversation files belong to the Agent.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRuntimeConfigStale means the runtime process was created from an older
	// bot configuration generation. Retrying the write from that process would
	// let stale credentials or configuration replace the current generation.
	ErrRuntimeConfigStale = errors.New("runtime configuration generation is stale")
	// ErrRuntimeConfigResetInProgress is transient: a bot-scoped reset owns the
	// workspace configuration publication lock. Session-scoped history resets
	// deliberately do not block bot-global configuration synchronization.
	ErrRuntimeConfigResetInProgress = errors.New("bot runtime reset is in progress")
)

Functions

This section is empty.

Types

type RuntimeConfigEpoch

type RuntimeConfigEpoch struct {
	Bot     int64
	Session int64
}

RuntimeConfigEpoch is the durable generation of process-affecting bot and session configuration. It is deliberately independent of publication head: credentials and workspace config may change while canonical chat history does not.

type RuntimeStateStore added in v0.21.0

type RuntimeStateStore interface {
	RuntimeConfigEpoch(ctx context.Context, botID, sessionID string) (RuntimeConfigEpoch, error)
	GuardRuntimeSync(ctx context.Context, botID string, expectedBotEpoch int64, fn func(context.Context) error) error
	Head(ctx context.Context, botID, sessionID string) (SessionPublicationHead, bool, error)
}

RuntimeStateStore fences warm processes against committed rounds and configuration changes. It does not store or restore native conversation files.

type SessionPublicationHead

type SessionPublicationHead struct {
	RunID string
}

SessionPublicationHead identifies the last committed round observed by a warm runtime. An absent head is represented separately by Head's bool result.

Jump to

Keyboard shortcuts

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