fix: send session_id in LongMemEval add requests - #2410
wangxinyufighting wants to merge 1 commit into
Conversation
🤖 Open Code ReviewTarget: PR #2410 🔍 OpenCodeReview found 1 issue(s) in this PR. 1.
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix is covered by a regression test and no unresolved issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes LongMemEval ingestion by sending the session ID as session_id to /product/add.
Changes:
- Corrects the payload key from
conversation_idtosession_id. - Adds a regression test for the serialized request.
| File | Summary |
|---|---|
tests/evaluation/test_longmemeval_add_api_contract.py |
Verifies the corrected request payload contract. |
evaluation/scripts/utils/client.py |
Sends the session identifier as session_id. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ Automated Test Results: PASSEDAll tests passed (1/1 executed). memos_python_core/changed-repo-python: 1/1. Duration: 1s [advisory, non-gating] AI-generated tests on branch test/auto-gen-9d0ee616598c3ad0-20260925204429: 33/35 passed, 2 failed — these do NOT affect the PR verdict; review the branch manually. Branch: |
Description
Fix the session ID field sent by the evaluation client's
MemosApiClient.add()to the open-source/product/addendpoint.Problem
LongMemEval ingestion passes its session ID through the
conv_idargument. However, the client serializes it asconversation_id, whileAPIADDRequestexpectssession_id.The unrecognized field is ignored, so the server falls back to
default_sessioninstead of preserving the original session ID.Implementation
conversation_idtosession_id.conv_idargument and call sites unchanged.This change does not modify the server API, asynchronous ingestion behavior, or the MemOS Cloud client.
Dependencies: No new dependencies.
Related Issue (Required): None
Type of change
How Has This Been Tested?
The regression test mocks the HTTP request and verifies that the payload contains the expected
session_idand noconversation_id.It does not require a running MemOS server, database, or LLM service.
Before the fix:
KeyError: 'session_id'.After the fix:
4 passed, 1 warning.Commands run from the repository root:
Test environment: Python 3.11, pytest 9.0.2.
Pytest reports an
Unknown config option: asyncio_modewarning.These checks cover the focused fix; a full end-to-end benchmark was not run.
Checklist
Requested reviewer: None