Documentation
¶
Overview ¶
Package errorwatch provides error detection and automatic follow-up for agent errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrorPatterns = []string{
"context deadline exceeded",
"context canceled",
"timeout",
"connection refused",
"connection reset",
}
ErrorPatterns defines the patterns to detect recoverable agent errors.
Functions ¶
func FollowUpMessage ¶
FollowUpMessage generates a follow-up message for an agent that encountered an error.
func IsRecoverableError ¶
IsRecoverableError checks if the error message matches known recoverable patterns.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector detects error patterns and manages follow-up cooldowns.
func DefaultDetector ¶
func DefaultDetector() *Detector
DefaultDetector creates a detector with 30-second cooldown.
func NewDetector ¶
NewDetector creates a new error detector with the specified cooldown period.
func (*Detector) CheckAndGenerateFollowUp ¶
func (d *Detector) CheckAndGenerateFollowUp(agentName string, errMsg string) FollowUpResult
CheckAndGenerateFollowUp checks if a follow-up should be sent and generates the message.
func (*Detector) RecordFollowUp ¶
RecordFollowUp records that a follow-up was sent to the agent.
type FollowUpResult ¶
FollowUpResult contains the result of checking whether to send a follow-up.