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:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    area:coreMOS 编排层 / 框架底座 / 跨模块问题
    status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理
    types:bugSomething isn't working | 功能异常
    on Nov 17, 2026
  2. 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.

  3. 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 agent is coding | AI 正在编码ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务area:coreMOS 编排层 / 框架底座 / 跨模块问题status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions