Skip to content

test(adapters): cover _supports_composed_adapters on in-tree backends - #1842

Draft
planetf1 wants to merge 1 commit into
generative-computing:mainfrom
planetf1:issue-1824
Draft

planetf1 wants to merge 1 commit into
generative-computing:mainfrom
planetf1:issue-1824

Conversation

@planetf1

@planetf1 planetf1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Thanks for sending a pull request! Please make sure you read the contributing guidelines.

Issue

Fixes #1824

Description

If an in-tree backend loses its _supports_composed_adapters = True line, anyone calling an adapter function on it (check_answerability, find_citations and the rest) gets ValueError: Backend ... does not support composed adapters instead of a result. Granite Switch setups are unaffected. This happened during the #1821 rebase and only the HF nightly caught it. These tests make the fast unit suite catch it.

  • Checks that LocalHFBackend, OpenAIBackend and OllamaModelBackend each set the flag. A case skips if its extra isn't installed.
  • Pins the False default on AdapterMixin, which is why each backend has to opt in.
  • Checks that resolve_adapter raises that ValueError on a backend without the flag.
  • Tests only, no library changes.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code was added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

uv run pytest test/backends/test_adapters/test_composed_adapter_opt_in.py with all extras: 5 passed. With Ollama's flag set to False in-process, the Ollama case fails.

Attribution

  • AI coding assistants used

Adding a new component, requirement, sampling strategy, or tool?

If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.

  • Component
  • Requirement
  • Sampling Strategy
  • Tool

NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.

@planetf1 planetf1 self-assigned this Nov 16, 2026
Assert that LocalHFBackend, OpenAIBackend and OllamaModelBackend opt in to
composed adapters, that AdapterMixin defaults the flag to False, and that
resolve_adapter raises ValueError on a backend that has not opted in.

Closes generative-computing#1824

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(adapters): cover _supports_composed_adapters on in-tree backends

1 participant