Skip to content

feat(adapters): report unsupported-technology skips in the adapter not-found error #1837

Closed

Description

@planetf1

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 existing skip_reasons return. 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 KeyError whose 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

  1. added
    enhancement
    on Nov 16, 2026
  2. self-assigned this
    on Nov 16, 2026
  3. added
    area/adapter-functions
    on Nov 16, 2026
  4. added a commit that references this issue on Nov 20, 2026
    5293201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/adapter-functionsenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions