Skip to content

fix: strategy reranker factory overrides omitted strategy with None #2627

Open

Description

@Elon-Jiang

Pre-submission checklist

  • Searched existing Issues, open PR files, and factory history.
  • Checked the public strategy constructor's default and existing factory tests.
  • The failure is in MemOS factory argument forwarding.

Bug Description

A minimal RerankerConfigFactory(backend="http_bge_strategy", config={"reranker_url": "..."}) fails in RerankerFactory.from_config with ValueError: Invalid backend: None.

HTTPBGERerankerStrategy already defaults reranker_strategy to "single_turn", as does RerankerStrategyFactory.from_config. The outer factory passes c.get("reranker_strategy") unconditionally, overriding that default with None when the optional key is absent. The bge_strategy alias has the same failure.

How to Reproduce

from memos.configs.reranker import RerankerConfigFactory
from memos.reranker.factory import RerankerFactory

config = RerankerConfigFactory(
    backend="http_bge_strategy",
    config={"reranker_url": "https://reranker.example.test/rerank"},
)
RerankerFactory.from_config(config)  # ValueError: Invalid backend: None

Expected: construct the default single-turn HTTP reranker. Explicit "reranker_strategy": "single_turn" is a successful control. The HTTP strategy constructor itself also accepts an omitted strategy.

On unchanged main 3a16e5fe3048a209f722806f4123fa2e533588fd, public factory/rerank regression tests yield 2 failures (both omitted-key aliases) and 4 passing controls (explicit default and unknown-strategy rejection).

Environment

macOS, Python 3.12.13, MemoryOS 2.0.36, fully installed Poetry lock environment. Successful ranking controls use actual configuration, factory, strategy preparation/reconstruction, Requests prepared requests and response processing; only the external HTTP service response is supplied at Session.send. No hosted model was called.

Willingness to Implement

Prepared with AI assistance.

Activity

  1. added
    ai:task
    area:core
    status:in-progress
    types:bug
    on Nov 17, 2026
  2. added
    ai:coding
    on Nov 17, 2026
  3. Memtensor-AI commented on Nov 17, 2026

    @Memtensor-AI
    Collaborator

    🤖 AutoDev has picked up this issue and started working on it.

    Task ID: bb644ae862fde35b
    Working branch: bugfix/autodev-2627-20261117095053233
    Target branch: latest dev* branch
    Workflow: opsp (analysis → coding → testing → PR)

    I will post the PR link here once done. If I need more information, I will ask in the comments.

  4. self-assigned this
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai:codingai:taskarea:corestatus:in-progresstypes:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions