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)
| 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. |
| 416 | func 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. |
no test coverage detected