Skip to content

fix: ignore tool-call items when collecting user senders#284

Open
rendigua2025-gif wants to merge 1 commit into
EverMind-AI:mainfrom
rendigua2025-gif:codex/fix-toolcall-senders
Open

fix: ignore tool-call items when collecting user senders#284
rendigua2025-gif wants to merge 1 commit into
EverMind-AI:mainfrom
rendigua2025-gif:codex/fix-toolcall-senders

Conversation

@rendigua2025-gif

Copy link
Copy Markdown

Summary

Fixes #276.

User-side extraction strategies assumed every item in memcell.items exposes a role attribute. Agent/tool-call trajectories can include ToolCallRequest items, which do not expose role, so extract_atomic_facts and extract_foresight could crash before processing otherwise valid user messages.

This PR adds a small shared helper for collecting user sender ids defensively, then uses it in both strategies.

Scope

  • Collect sender ids only from items where role == "user".
  • Skip non-chat/tool-call items instead of treating them as malformed messages.
  • Preserve the existing extraction behavior for normal chat messages.

This does not add tool-call semantics to user-side extraction; it only prevents unrelated tool-call items from crashing the user memory pipeline.

Tests

  • tests/unit/test_memory/test_strategies/test_strategy_to_handler_contract.py
  • tests/unit/test_memory/test_strategies/test_extract_atomic_facts.py
  • tests/unit/test_memory/test_strategies/test_extract_foresight.py

Note: I verified locally on Windows with a test-process-only fcntl stub because the current repository still imports POSIX fcntl during test collection on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User-side extraction strategies crash on ToolCallRequest because they assume every memcell item has role

1 participant