Skip to content

inferCapabilities is untested in the honesty direction — llama-cpp embedding GGUFs now advertise cache.checkpoint #858

Description

@sroussey

inferAdvertisesRegistered.test.ts (new in 0.3.47) asserts registered ⊆ inferred and unions the inferred sets across every fixture id for a provider. That is the right shape for "is this capability reachable at all" and deliberately not for "is it honest for this model". capabilityHonesty.ts does not fill the gap: it tests declared-capability ↔ registry lookup, which an over-advertised branch passes trivially — the run-fn is registered, it just cannot serve that model.

Live instance introduced by the same change: LlamaCpp_Capabilities.ts:41-50 (the embedding branch) now emits cache.checkpoint and session.dispose. Path:

inferLlamaCppCapabilities("nomic-embed-text-v1.5.Q4_K_M.gguf")  → cache.checkpoint
modelMeetsRequires(model, CacheCheckpointTask.requires)  (AiTask.ts:80-85) → true
LlamaCpp_CacheCheckpoint_Stream (LlamaCpp_CacheCheckpoint.ts:77-84)
  → new LlamaChatSession(...) + setChatHistory() on a model with no chat wrapper

Before, that model failed selection with a capability message; now it fails inside the provider. The generative branch alone satisfies the test (both fixtures pass at :155-160), so this was not required.

This is the repo's own "advertises true while every call throws" anti-pattern — the one the conformance test was written to eliminate — arriving inside the fix for its mirror image.

Fix:

  1. drop "cache.checkpoint" (:44) and "session.dispose" (:49) from the embedding branch;
  2. add the paired assertion (~20 LOC beside assertInferAdvertisesRegistered): for each fixture id, every inferred capability must have a registered run-fn whose serves set is a subset of that id's inferred set.

Found during the 2026-08-24 review. Snapshot: workglow-dev/prdanalysis/grades/2026-08-24/libs-providers.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions