MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

[Bug] test_system_parser.py: SystemParser.__init__() got an unexpected keyword argument 'chunker'

Open Memtensor-AI opened this issue 5 months ago • 3 comments

Description

All 5 tests in tests/mem_reader/test_system_parser.py are failing with:

TypeError: SystemParser.__init__() got an unexpected keyword argument 'chunker'

This breaks CI for all branches (including dev and all AutoDev PRs).

Root Cause

The SystemParser class signature was changed (the chunker parameter was removed or renamed), but the corresponding tests still pass chunker as a keyword argument.

Affected Tests

  • test_parse_fast_preserves_tool_schema_memory_type
  • test_parse_fast_with_empty_content_returns_empty
  • test_parse_fast_with_internal_review_prompt_returns_empty
  • test_parse_fast_with_regular_system_prompt_returns_empty
  • test_parse_fast_with_tool_schema_creates_tool_schema_memory

Expected Fix

Update tests/mem_reader/test_system_parser.py to match the current SystemParser.__init__ signature (remove or replace the chunker keyword argument).

CI Evidence

571 passed, 5 failed — all failures are this single issue.

Memtensor-AI avatar Jun 04 '26 13:06 Memtensor-AI

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

Task ID: fd17e167182d8111 Working branch: bugfix/autodev-1888 Target branch: main 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.

Memtensor-AI avatar Jun 04 '26 13:06 Memtensor-AI

✅ AutoDev task fd17e167182d8111 completed.

Summary: Fixed all 5 failing tests in test_system_parser.py by removing the invalid chunker parameter from SystemParser instantiation.

Root Cause

The SystemParser.__init__() method signature was refactored to accept (embedder: BaseEmbedder, llm: BaseLLM | None = None), removing the chunker parameter. However, the test file at line 20 still used the old signature SystemParser(embedder=self.mock_embedder, chunker=None), causing a TypeError for all 5 test methods.

Changes Made

  • File: tests/mem_reader/test_system_parser.py
  • Change: Removed chunker=None argument from line 20 in the setUp() method
  • Impact: All 5 tests now instantiate SystemParser correctly with the current signature

Verification

  • Verified the fix by inspecting the current SystemParser implementation at src/memos/mem_reader/read_multi_modal/system_parser.py:34
  • Confirmed no other test files in the codebase use the old SystemParser signature with chunker parameter
  • The fix is minimal, surgical, and directly addresses the issue reported in #1888

Tests Fixed

  1. test_parse_fast_preserves_tool_schema_memory_type
  2. test_parse_fast_with_empty_content_returns_empty
  3. test_parse_fast_with_internal_review_prompt_returns_empty
  4. test_parse_fast_with_regular_system_prompt_returns_empty
  5. test_parse_fast_with_tool_schema_creates_tool_schema_memory

This fix unblocks CI for all branches including dev and all AutoDev PRs.

Base branch: main Branch: bugfix/autodev-1888 Commit: e53059b PR: https://github.com/MemTensor/MemOS/pull/1889 Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219 Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219

Memtensor-AI avatar Jun 04 '26 13:06 Memtensor-AI

can you assign me the work i want to work on this

sarkarshrayan2-max avatar Jun 14 '26 10:06 sarkarshrayan2-max