ekg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeErrorSignature

func NormalizeErrorSignature(s string) string

Types

type Advice

type Advice struct {
	ShouldEscalate  bool     `json:"should_escalate"`
	RetryBackoffSec int      `json:"retry_backoff_sec"`
	Reason          []string `json:"reason"`
}

type Engine

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

func New

func New(workspace string) *Engine

func (*Engine) GetAdvice

func (e *Engine) GetAdvice(ctx SignalContext) Advice

func (*Engine) RankProviders

func (e *Engine) RankProviders(candidates []string) []string

func (*Engine) RankProvidersForError

func (e *Engine) RankProvidersForError(candidates []string, errSig string) []string

func (*Engine) Record

func (e *Engine) Record(ev Event)

func (*Engine) SetConsecutiveErrorThreshold

func (e *Engine) SetConsecutiveErrorThreshold(v int)

type Event

type Event struct {
	Time     string `json:"time"`
	TaskID   string `json:"task_id,omitempty"`
	Session  string `json:"session,omitempty"`
	Channel  string `json:"channel,omitempty"`
	Source   string `json:"source,omitempty"`
	Status   string `json:"status"` // success|error|suppressed
	Provider string `json:"provider,omitempty"`
	Model    string `json:"model,omitempty"`
	ErrSig   string `json:"errsig,omitempty"`
	Log      string `json:"log,omitempty"`
}

type SignalContext

type SignalContext struct {
	TaskID  string
	ErrSig  string
	Source  string
	Channel string
}

Jump to

Keyboard shortcuts

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