Intrinsic generation path drops a caller's explicit adapter_types

Aperta
#1,750 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@ajbozarth ci sta già lavorando.

Dal 19/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

area/adapter-functions area/backends

On the LocalHF Intrinsic generation path, an explicit Intrinsic.adapter_types is silently ignored — a caller who asks for (ALORA,) is served whatever the resolution walk registered, with no error and no warning. Before #1654 that path filtered by the caller's types and raised when unsatisfiable. Should the Intrinsic path honor a caller's explicit adapter_types again, and if so how?

Today (on the #1654 branch)

  • _generate_from_intrinsic looks the adapter up by name only: _find_adapter(action.intrinsic_name, None) (huggingface.py), with a comment that None is deliberate so a weightless prompt winner (type "prompt", never in a caller's tuple) isn't filtered out.
  • Registration is name-only too: resolve_adapter(name) runs the walk and registers one winner, never seeing the caller's types.
  • So the caller's adapter_types reaches neither resolution nor generation on this path. On main the same path filtered by action.adapter_types and raised backend has no adapter for processing intrinsic when unsatisfiable (OpenAI/Ollama still do this).

Why this happens (and why it's not a localized bug)

The path drops the type filter on purpose to keep the prompt winner reachable; losing the caller's restriction is the side effect. It is not merge drift and was not an articulated decision — #1654's PR body documents only the aLoRA-auto-select behavior change, not this one.

How reachable is it today

Narrow, which bears on urgency:

  • call_intrinsic (the core.* / rag.* helpers) does not expose adapter_types at all — it hardcodes (ALORA, LORA), which is itself vestigial on HF.
  • A direct Intrinsic(name, adapter_types=...) via act() does not auto-resolve; it requires prior registration via a separate name-only resolve_adapter/add_adapter, which already ignores the types.
  • The reroute path (ALoraRequirement) does honor explicit types (_find_adapter(name, search_types)), so the real "I want a specific type" use case has a working channel there.

So the regression is a silent drop on a path where the capability is barely expressible, not a loudly-broken common path.

The decision

  1. Should an explicit caller adapter_types be honored on the Intrinsic path? If yes, it means teaching resolution (not just the generation lookup) about the caller's types — threading allowed_types through resolve_adapter and the walk (so the winner is chosen within the allowed set), and exposing adapter_types on call_intrinsic and the public helpers. Filtering only at the generation lookup does not work: the walk has already committed to a winner by its own order, so a conflicting restriction would raise a false "no adapter" even when a satisfying adapter exists on the Hub.
  2. If not honored, at minimum make it non-silent — warn when a direct Intrinsic carries an explicit adapter_types the resolved winner doesn't satisfy.
  3. How does the prompt realization fit a caller restriction — append-prompt as a universal fallback, or strict "these types or fail"?

Relationship to the sibling issue

This is one of two places where the pre-prompt, adapter_type-keyed selection model struggles with the typeless prompt realization. This issue is the generation-path side: it doesn't filter (passes None) so the prompt stays reachable, at the cost of the caller's restriction. The sibling (#1749) is the gate side: it filters (("alora",)), so it loses the prompt. Same root incompatibility, opposite symptom. They are independent fixes but share the underlying design question (how a typeless realization participates in type-keyed selection), so they may be worth resolving together in one PR.

Scope

LocalHF. OpenAI/Ollama currently honor caller types (pre-#1654 model) and are a separate follow-up (#1748); the model chosen here is what they'd be aligned to.

Related

  • #1654 — introduces the behavior.
  • #993 — the prompt-fallback feature (closed by #1654).
  • Sibling: reroute-gap (#1749).

Code

_generate_from_intrinsic (huggingface.py); resolve_adapter + the walk (adapter.py); call_intrinsic (mellea/stdlib/components/intrinsic/_util.py); _find_adapter (adapter.py, type-filtered lookup).

Lingua principale
Python
Stelle
1.8k
Fork
161
Merge medio
4g 3h
PR unite (30g)
45

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di generative-computing/mellea

Tutte le issue di generative-computing/mellea

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.