Changeset 0.22.4 (#146)

This commit is contained in:
2026-03-02 22:16:08 +00:00
parent 9940fb5831
commit 3953dcf364
25 changed files with 2254 additions and 145 deletions

View File

@@ -506,6 +506,7 @@ type Attachment struct {
ChannelID string `json:"channel_id" db:"channel_id"`
UserID string `json:"user_id" db:"user_id"`
MessageID *string `json:"message_id,omitempty" db:"message_id"`
ProjectID *string `json:"project_id,omitempty" db:"project_id"` // v0.22.4: project-scoped uploads
Filename string `json:"filename" db:"filename"`
ContentType string `json:"content_type" db:"content_type"`
SizeBytes int64 `json:"size_bytes" db:"size_bytes"`
@@ -890,6 +891,7 @@ type ProviderHealthWindow struct {
RequestCount int `json:"request_count" db:"request_count"`
ErrorCount int `json:"error_count" db:"error_count"`
TimeoutCount int `json:"timeout_count" db:"timeout_count"`
RateLimitCount int `json:"rate_limit_count" db:"rate_limit_count"` // v0.22.4
TotalLatencyMs int64 `json:"total_latency_ms" db:"total_latency_ms"`
MaxLatencyMs int `json:"max_latency_ms" db:"max_latency_ms"`
LastError *string `json:"last_error,omitempty" db:"last_error"`
@@ -919,12 +921,38 @@ type ProviderHealthSummary struct {
Status ProviderStatus `json:"status"`
RequestCount int `json:"request_count"` // last hour
ErrorRate float64 `json:"error_rate"` // last hour
ErrorCount int `json:"error_count"` // last hour
RateLimitCount int `json:"rate_limit_count"` // last hour (v0.22.4)
TimeoutCount int `json:"timeout_count"` // last hour
AvgLatencyMs int `json:"avg_latency_ms"` // last hour
MaxLatencyMs int `json:"max_latency_ms"` // last hour
LastError *string `json:"last_error,omitempty"`
LastErrorAt *string `json:"last_error_at,omitempty"`
}
// ToolHealthWindow tracks health of built-in tools (web_search, url_fetch, etc.)
// in hourly buckets, analogous to ProviderHealthWindow.
type ToolHealthWindow struct {
ID string `json:"id" db:"id"`
ToolName string `json:"tool_name" db:"tool_name"`
WindowStart time.Time `json:"window_start" db:"window_start"`
RequestCount int `json:"request_count" db:"request_count"`
ErrorCount int `json:"error_count" db:"error_count"`
TotalLatencyMs int64 `json:"total_latency_ms" db:"total_latency_ms"`
MaxLatencyMs int `json:"max_latency_ms" db:"max_latency_ms"`
LastError *string `json:"last_error,omitempty" db:"last_error"`
LastErrorAt *string `json:"last_error_at,omitempty" db:"last_error_at"`
}
// ToolHealthSummary is the API response for a tool's health.
type ToolHealthSummary struct {
ToolName string `json:"tool_name"`
Status string `json:"status"` // healthy, degraded, down, unknown
RequestCount int `json:"request_count"`
ErrorRate float64 `json:"error_rate"`
AvgLatencyMs int `json:"avg_latency_ms"`
}
// =========================================
// CAPABILITY OVERRIDES (v0.22.0)
// =========================================