pub async fn resolve(
catalog: &dyn ModelCatalogPort,
model: Option<&str>,
) -> ModelContextExpand description
Resolve the ModelContext for a model in one catalog round-trip.
model is None when the caller has no model to name — an agent session
against an already-running server, say. That yields a passthrough context
without touching the catalog, which is why every caller can hand its
Option straight in rather than open-coding the empty case.
Any failure to resolve returns ModelContext::passthrough: an unknown or
unreachable model costs the request its model-specific handling, never the
request itself. The two failure modes are logged differently on purpose —
an unknown model is routine (clients name models the catalog has never
heard of), while a catalog error means something is actually broken.