Skip to content

fix: preserve the default HTTP BGE reranking strategy - #2628

Merged
endxxxx merged 1 commit into
MemTensor:dev-v2.0.37from
Elon-Jiang:fix/bge-factory-default-strategy
Nov 18, 2026
Merged

endxxxx merged 1 commit into
MemTensor:dev-v2.0.37from
Elon-Jiang:fix/bge-factory-default-strategy

Conversation

@Elon-Jiang

Copy link
Copy Markdown

Description

Fixes #2627.

RerankerFactory.from_config fails with ValueError: Invalid backend: None for a minimal http_bge_strategy / bge_strategy configuration that omits reranker_strategy. Both the HTTP strategy constructor and RerankerStrategyFactory.from_config already default to single_turn, but the outer factory unconditionally overrides that default with None.

Preserve single_turn when the configuration key is absent. Explicit selections and invalid-strategy errors are unchanged. No dependencies, signatures or schemas change.

This is independent of #2626: the omitted default fails during construction, before any HTTP request; this PR changes no authentication behavior.

Type of change

  • Bug fix (non-breaking)

How Has This Been Tested?

  • Unit tests: poetry run pytest tests/reranker/ -q — 30 passed.
  • Regression steps: on unchanged 3a16e5fe3048a209f722806f4123fa2e533588fd, the 2 omitted-strategy cases fail and 4 explicit-strategy/rejection controls pass. All 6 pass with the one-line correction.
  • make format — passed (643 files).
  • HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 make test — 1,011 passed, 9 skipped, 38 warnings. Full optional dependencies were already installed from this baseline's Poetry lockfile. A task-owned environment is reused by this isolated worktree; the tests import this worktree's source. Offline flags avoid the unrelated Qwen example-model download.

The tests exercise public configuration, factory and rerank calls, actual single-turn document preparation/reconstruction, Requests serialization and response handling. Only the external HTTP service response is supplied through Session.send; no hosted reranker/model was called.

Checklist

  • Reviewed the focused diff and behavior with AI assistance; no human review is claimed.
  • Code comments/docs: not applicable; this restores the existing constructor default.
  • Added regressions for both backend aliases and explicit-choice controls.
  • MemOS-Docs issue/PR: not applicable; no new configuration option.
  • Linked the related Issue.
  • Reviewer: no specific maintainer requested; available for project review.

Reviewer Checklist

Left for the reviewer; upstream checks and maintainer acceptance are pending.

AI assistance was used for investigation, implementation and local verification.

@endxxxx
endxxxx changed the base branch from main to dev-v2.0.37 November 18, 2026 12:08
@endxxxx
endxxxx merged commit fac00ba into MemTensor:dev-v2.0.37 Nov 18, 2026
13 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: strategy reranker factory overrides omitted strategy with None

2 participants