runtime

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 11 Imported by: ? 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

Index

Constants

View Source
const (
	SyncResultTypeNone   = dispatcher.SyncResultTypeNone
	SyncResultTypeBranch = dispatcher.SyncResultTypeBranch
)

Sync result type constants.

Variables

View Source
var NoopController = dispatcher.NoopController

NoopController returns a controller that rejects all steering attempts.

Functions

func IsProcessStartFailure

func IsProcessStartFailure(err error) bool

IsProcessStartFailure reports whether err is a typed process launch failure.

func ReadSessionTarget

func ReadSessionTarget(promptPath string) string

ReadSessionTarget extracts the order ID from a session's prompt file.

Types

type AgentController

type AgentController = dispatcher.AgentController

AgentController aliases dispatcher.AgentController so loop/ doesn't import dispatcher.

type DispatchRequest

type DispatchRequest = dispatcher.DispatchRequest

DispatchRequest is shared with the existing dispatcher boundary.

type DispatcherRuntime

type DispatcherRuntime struct {
	// contains filtered or unexported fields
}

func NewDispatcherRuntime

func NewDispatcherRuntime(name string, d dispatcher.Dispatcher, runtimeDir string) *DispatcherRuntime

func (*DispatcherRuntime) Dispatch

func (*DispatcherRuntime) ForceKill

func (r *DispatcherRuntime) ForceKill(handle SessionHandle) error

func (*DispatcherRuntime) Recover

func (*DispatcherRuntime) SetMaxConcurrent

func (r *DispatcherRuntime) SetMaxConcurrent(n int)

SetMaxConcurrent sets the per-runtime concurrency cap. 0 means unlimited.

func (*DispatcherRuntime) Terminate

func (r *DispatcherRuntime) Terminate(handle SessionHandle) error

type RecoveredSession

type RecoveredSession struct {
	OrderID       string
	SessionHandle SessionHandle
	RuntimeName   string
	Reason        string
}

RecoveredSession is discovered from a runtime during startup recovery.

type Runtime

type Runtime interface {
	Dispatch(ctx context.Context, req DispatchRequest) (SessionHandle, error)
	Terminate(handle SessionHandle) error
	ForceKill(handle SessionHandle) error
	Recover(ctx context.Context) ([]RecoveredSession, error)
}

Runtime dispatches, observes, and recovers sessions for one platform.

func NewProcessRuntime

func NewProcessRuntime(d dispatcher.Dispatcher, runtimeDir string, maxConcurrent int) Runtime

NewProcessRuntime adapts a process dispatcher to the Runtime interface with PID-based session recovery.

type SessionHandle

type SessionHandle interface {
	ID() string
	Status() string
	Done() <-chan struct{}
	TotalCost() float64
	Terminate() error
	ForceKill() error
	VerdictPath() string
	Controller() AgentController
}

SessionHandle is a runtime-agnostic session contract.

type SyncResult

type SyncResult = dispatcher.SyncResult

SyncResult aliases dispatcher.SyncResult so loop/ doesn't import dispatcher.

Jump to

Keyboard shortcuts

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