Documentation
¶
Index ¶
- Constants
- Variables
- func IsProcessStartFailure(err error) bool
- func ReadSessionTarget(promptPath string) string
- type AgentController
- type DispatchRequest
- type DispatcherRuntime
- func (r *DispatcherRuntime) Dispatch(ctx context.Context, req DispatchRequest) (SessionHandle, error)
- func (r *DispatcherRuntime) ForceKill(handle SessionHandle) error
- func (r *DispatcherRuntime) Recover(context.Context) ([]RecoveredSession, error)
- func (r *DispatcherRuntime) SetMaxConcurrent(n int)
- func (r *DispatcherRuntime) Terminate(handle SessionHandle) error
- type RecoveredSession
- type Runtime
- type SessionHandle
- type SyncResult
Constants ¶
const ( SyncResultTypeNone = dispatcher.SyncResultTypeNone SyncResultTypeBranch = dispatcher.SyncResultTypeBranch )
Sync result type constants.
Variables ¶
var NoopController = dispatcher.NoopController
NoopController returns a controller that rejects all steering attempts.
Functions ¶
func IsProcessStartFailure ¶
IsProcessStartFailure reports whether err is a typed process launch failure.
func ReadSessionTarget ¶
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 (r *DispatcherRuntime) Dispatch(ctx context.Context, req DispatchRequest) (SessionHandle, error)
func (*DispatcherRuntime) ForceKill ¶
func (r *DispatcherRuntime) ForceKill(handle SessionHandle) error
func (*DispatcherRuntime) Recover ¶
func (r *DispatcherRuntime) Recover(context.Context) ([]RecoveredSession, error)
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.