Skip to content

fix: HTTP BGE reranking drops memory text when selected sources are missing #2559

Open

Description

@jianyx1

Pre-submission checklist

  • Searched existing issues and PRs for rerank_source and concat_original_source.
  • Checked the project behavior and verified the failure is in MemOS's request construction.

Bug Description | 问题描述

When HTTPBGEReranker is configured with rerank_source="sources", a memory with a nonempty memory field and no metadata.sources is sent to the endpoint as an empty document. This also happens when sources is None. The reranker receives no text for that candidate, even though the same record has valid text when source enrichment is disabled.

How to Reproduce | 如何重现

  1. Instantiate HTTPBGEReranker with rerank_source="sources".
  2. Call rerank("offline preference", [{"memory": "Prefers offline mode", "metadata": {}}], top_k=1) against a stub endpoint and inspect the JSON request.
  3. The payload contains "documents": [""]. Expected "documents": ["Prefers offline mode"].

Environment | 环境信息

MemOS 2.0.33 (d326a64), Python 3.12.14, macOS. Reproduced using the real reranker with a mocked HTTP response.

Additional Context | 其他信息

The source concatenator initializes the primary text inside the loop over sources, which is never entered when no selected source field is present. The fix will retain the primary text for those candidates and keep normal source-enriched documents and index alignment.

AI assistance: Codex identified and reproduced the problem. A focused patch and regression tests are being prepared for this report.

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 4, 2026
  2. self-assigned this
    on Nov 4, 2026
  3. Memtensor-AI commented on Nov 4, 2026

    @Memtensor-AI
    Collaborator

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

    Task ID: aa6f4f98538689ee
    Working branch: bugfix/autodev-2559-20261104125512737
    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.

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