MCPcopy Index your code
hub / github.com/docker/docker-agent / IsContextOverflowError

Function IsContextOverflowError

pkg/modelerrors/modelerrors.go:186–194  ·  view source on GitHub ↗

IsContextOverflowError reports whether err indicates the conversation exceeded a provider-side limit (token window, wire size, or media size). Use [OverflowKindOf] to distinguish the three shapes.

(err error)

Source from the content-addressed store, hash-verified

184// exceeded a provider-side limit (token window, wire size, or media size).
185// Use [OverflowKindOf] to distinguish the three shapes.
186func IsContextOverflowError(err error) bool {
187 if err == nil {
188 return false
189 }
190 if _, ok := errors.AsType[*ContextOverflowError](err); ok {
191 return true
192 }
193 return classifyOverflow(err) != ""
194}
195
196// OverflowKindOf returns the [OverflowKind] of err, or "" if it isn't an
197// overflow error. If err is already wrapped in a [*ContextOverflowError]

Callers 5

executeMethod · 0.92
isRetryableModelErrorFunction · 0.85
ClassifyModelErrorFunction · 0.85

Calls 1

classifyOverflowFunction · 0.85

Tested by 2