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

Function warnCapsLookupMiss

pkg/modelinfo/modelinfo.go:416–426  ·  view source on GitHub ↗

warnCapsLookupMiss emits a one-shot diagnostic when a model is absent from models.dev, distinguishing this recoverable misconfiguration from the silent text-only fallback it used to cause. It points the user at the config escape hatch so attachments can be restored. See issue #2741.

(ctx context.Context, id modelsdev.ID, cause error)

Source from the content-addressed store, hash-verified

414// text-only fallback it used to cause. It points the user at the config escape
415// hatch so attachments can be restored. See issue #2741.
416func warnCapsLookupMiss(ctx context.Context, id modelsdev.ID, cause error) {
417 if _, dup := capsMissLogged.LoadOrStore(id.String(), struct{}{}); dup {
418 return
419 }
420 slog.WarnContext(ctx,
421 "modelinfo: model not found in models.dev; assuming text-only, so image and PDF "+
422 "attachments will be dropped. If this model does accept attachments, declare them "+
423 "in the agent config (models.<name>.capabilities: {image: true, pdf: true}) to "+
424 "override capability detection.",
425 "model", id.String(), "cause", cause)
426}
427
428// LoadCaps fetches (or returns from cache) the capability record for the given
429// model ID using the provided store.

Callers 1

LoadCapsFunction · 0.85

Calls 2

LoadOrStoreMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected