Merge branch 'worktree-agent-a11776f2a9241a0c9'
This commit is contained in:
@@ -817,6 +817,23 @@ type ChatAccountUsage struct {
|
||||
// account even with no windows yet, and a usage-limit refusal the chat
|
||||
// received before it no longer applies.
|
||||
SwitchedAt int64 `json:"switched_at,omitempty"`
|
||||
// ExtraUsage is the account's extra usage (Claude Code's "overage": paid
|
||||
// usage credits past the subscription limits) as the harness last
|
||||
// reported it; nil when it never said.
|
||||
ExtraUsage *ChatExtraUsage `json:"extra_usage,omitempty"`
|
||||
}
|
||||
|
||||
// ChatExtraUsage is Claude Code's overage state from rate_limit_event:
|
||||
// Status is its overageStatus ("allowed", "allowed_warning" or "rejected"),
|
||||
// InUse whether requests are drawing on extra usage now, and DisabledReason
|
||||
// its overageDisabledReason (e.g. "out_of_credits", "org_level_disabled",
|
||||
// "overage_not_provisioned") when it is off. ResetsAt is when the extra usage
|
||||
// period resets (epoch milliseconds), 0 if unknown.
|
||||
type ChatExtraUsage struct {
|
||||
Status string `json:"status,omitempty"`
|
||||
InUse bool `json:"in_use,omitempty"`
|
||||
DisabledReason string `json:"disabled_reason,omitempty"`
|
||||
ResetsAt int64 `json:"resets_at,omitempty"`
|
||||
}
|
||||
|
||||
// ChatQuotaWindow is one rolling quota window. UsedPercent is 0-100 (it can
|
||||
@@ -836,6 +853,10 @@ func (a *ChatAccountUsage) Clone() *ChatAccountUsage {
|
||||
}
|
||||
copy := *a
|
||||
copy.Windows = append([]ChatQuotaWindow(nil), a.Windows...)
|
||||
if a.ExtraUsage != nil {
|
||||
extra := *a.ExtraUsage
|
||||
copy.ExtraUsage = &extra
|
||||
}
|
||||
return ©
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user