Repository navigation
Description
What the user sees
A Granite Switch adapter_index.json slot whose technology Mellea does not support (for example sr) is skipped at discovery with a log warning, and the rest of the checkpoint loads (#1797). If code later calls that slot by name, the error is a bare:
KeyError: "Adapter 'future_slot' not found after registration"
The reason is only in an earlier log line, which is easy to miss. If every slot in an index is unsupported, discovery fails with ValueError: No adapters found in <path>, which reads as an empty index rather than one whose slots were all filtered out.
Expected: the lookup error names the reason, as it already does for a decision slot whose merged config is invalid:
KeyError: "Adapter 'future_slot' not found after registration: technology 'sr' is not supported (supported: ['alora', 'lora', 'probe'])"
and the all-skipped case says that slots were present but none had a supported technology.
Mechanism
The backends already keep _adapter_skip_reasons, and the not-found path in AdapterMixin (mellea/backends/adapters/adapter.py, the skip_reason = self._adapter_skip_reasons.get(name) branch) appends the reason to the KeyError. Today only _discover_embedded_adapters populates it, for an invalid merged decider config.
The technology filter runs two layers lower, in _embedded_adapters_from_model_directory, which returns only list[tuple[Adapter, dict]]. _embedded_adapters_from_hub and _embedded_adapters_from_source pass that list straight up, so the skip never reaches skip_reasons.
Proposed change
- Have the model-directory discovery report unsupported-technology skips (name → reason) alongside its adapters, threaded through the Hub and source helpers into
_discover_embedded_adapters's existingskip_reasonsreturn. No new mechanism. - When every entry is skipped, raise with a message listing the skipped slots and their technologies.
- Keep the log warning.
Scope and cost
8 call sites in adapter.py and about 32 in test/backends/test_adapters/test_embedded_adapter.py use these helpers, so changing the return shape is mostly test churn. No published checkpoint carries an unsupported slot today, so this improves diagnostics only.
Tests
- Mixed index (lora, probe, unsupported): calling the unsupported slot raises
KeyErrorwhose message contains the technology. - All-unsupported index: the error names the skipped slots.
- Hub path: the same skip reason survives materialisation.
Follow-up to #1797.
Activity
feat(adapters): name the unsupported technology in adapter not-found …