ADR 334 · Accepted

A vision call runs on the configuration its site names

Context

A site names the configuration its calls run on (ADR-244). chat(), complete() and streamChat() apply it for a call that states its site; vision() did not. It resolved the installation default with ConfigurationResolver::resolveDefaultConfiguration() and never passed the site, so a vision call that named its site ran on the default.

DocumentAnalysisService makes that visible (#1503). Its probe asks the provider of the configuration the call's site names (ADR-331). When that provider reads no PDF, the service rasterizes the pages and sends each one through VisionService::analyzeImageFull() to vision(). The site was lost twice on that path: buildVisionOptions() copied only the constructor fields of the caller's options, and analyzeImageFull() rebuilds its options the same way. The pages then went to the default's provider, one the site had not configured. A configuration in criteria mode does not reach this path: ADR-332 refuses the fallback for it (code 1796473302).

The issue listed two ways out: let vision() honour the site, or refuse the fallback for every site configuration that differs from the default. The product owner decided on 2026-12-02 for the first.

Decision

1. vision() resolves the configuration with the call's site. It calls resolveDefaultConfiguration($providerKey, $options->getSite()), as chat() does. A pinned provider still skips the configuration, and a call without a site, or for a site that names none, runs on the installation default as before. A site that names a configuration that does not exist, is inactive or is restricted to backend groups fails the call, as it fails chat() (ADR-244); vision() has no actor to check the groups against.

2. The vision service keeps the site. VisionService::analyzeImageFull() carries the site of the caller's options into the options it rebuilds, as it carries the caller source. Every method of the service goes through it.

3. The document fallback passes the site. DocumentAnalysisService sets the site of the caller's ChatOptions on the VisionOptions of the rasterized pages. The pages run on the configuration the probe asked about.

4. Criteria mode stays refused. ADR-332's decision 4 is unchanged: a criteria-mode configuration whose selected model reads no PDF does not fall back. Its stated reason, that vision() runs on the installation default, no longer holds for a call with a site. What still holds is that vision() is not handed the probe's selection and selects a model again for its own operation. The exception message says that now; the code and the reason stay.

No signature changes, so the API snapshot does not change.

Consequences

  • ●● A site's vision calls and the rasterized pages of its documents run on the configuration the site names, with its provider, model and key.

  • ● The vision service no longer drops the site, so its calls carry the site in their call metadata (ProviderCallContext::METADATA_SITE) like a direct vision() call.

  • ◑ A vision() call that passes a site and answered before can fail now: when the site names a configuration that does not exist, is inactive or is restricted to backend groups; when that configuration resolves no model (ProviderException, code 1735300100); and when the model it resolves cannot serve vision (UnsupportedFeatureException, for example code 5549344501 when its adapter has no vision support). Before, such a call ran on the installation default. chat() with the same site already failed in the first two cases.

  • ◑ A call that keeps answering may answer from another provider and model, with other costs, when the site's configuration differs from the default.

  • ◑ A site that names a configuration in criteria mode gets a model selected for the vision operation.

  • ◑ A document of a site whose criteria-mode configuration selects a model without PDF support still fails with 1796473302 instead of being rasterized.

Net Score: +1.5

Alternatives considered

Refuse the fallback for every site configuration that differs from the default. Rejected: a document analysis that answers today would throw, and vision() would keep ignoring the site for every other caller.

← All ADRs