Skip to content

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

Merged
planetf1 merged 1 commit into
generative-computing:mainfrom
planetf1:issue-1824
Nov 19, 2026
Merged

planetf1 merged 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

Adapter functions (check_answerability, find_citations and the rest) fail with ValueError: Backend ... does not support composed adapters on any in-tree backend that is missing _supports_composed_adapters = True. That happened during the #1821 rebase: the opt-ins were dropped and only the HF nightly noticed. This PR adds fast unit tests so the next regression fails in the normal suite. Tests only, no library changes.

  • Each of LocalHFBackend, OpenAIBackend and OllamaModelBackend sets the flag. A case skips if its extra isn't installed.
  • AdapterMixin defaults the flag to False, so each backend has to opt in.
  • resolve_adapter raises the ValueError above on a backend without the flag.

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 <[email protected]>
@planetf1
planetf1 marked this pull request as ready for review November 18, 2026 15:45
@planetf1
planetf1 requested a review from a team as a code owner November 18, 2026 15:45

@AngeloDanducci AngeloDanducci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@planetf1
planetf1 added this pull request to the merge queue Nov 19, 2026
Merged via the queue into generative-computing:main with commit f6ab6e6 Nov 19, 2026
14 checks passed
@planetf1
planetf1 deleted the issue-1824 branch November 19, 2026 11:56
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

2 participants