Skip to content

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

Description

@rendigua2025-gif

Summary

Some user-side extraction strategies assume every item in memcell.items has a role attribute. Tool-call trajectories can include ToolCallRequest items, which do not have role, causing downstream strategies to crash and eventually enter dead_letter.

Observed affected strategies:

extract_atomic_facts
extract_foresight

Why this matters

Tool-use trajectories are common for coding agents and assistant workflows. A single tool-call item should not break user memory extraction for the whole memcell.

In the observed run, the agent case itself was extracted, but user-side extraction strategies failed independently because they iterated over mixed item types as if every item were a normal conversational message.

Observed evidence

OME records:

extract_atomic_facts: dead_letter
extract_foresight: dead_letter

Failure message:

AttributeError: 'ToolCallRequest' object has no attribute 'role'

Relevant code locations:

src/everos/memory/strategies/extract_atomic_facts.py:66
src/everos/memory/strategies/extract_foresight.py:54
src/everos/service/_boundary.py

The extraction strategies contain logic shaped like:

sender_ids = sorted({m.sender_id for m in memcell.items if m.role == "user"})

But _boundary.py can map assistant tool calls into ToolCallRequest, which does not expose role.

Reproduction shape

Use a synthetic agent/coding trajectory with assistant tool calls, for example:

  1. User reports a failing focused test.
  2. Assistant emits a tool call to run the test.
  3. Tool returns trace output.
  4. Assistant identifies the root cause.
  5. Assistant emits another tool call to apply or validate a fix.
  6. Tool returns passing output.
  7. Assistant summarizes the result.

Then flush/process the session. The memcell contains mixed item types, including tool-call request objects.

Expected behavior

Tool-call items should not crash extraction strategies that only need user messages.

Possible fixes:

  • Filter by item type before reading role.
  • Use getattr(m, "role", None) == "user" where appropriate.
  • Centralize sender/user-message extraction in a helper that understands mixed memcell item types.
  • Ignore non-text/tool-call items in user-side strategies unless they are explicitly supported.

Environment

EverOS: 1.0.0 source checkout
Runtime: Docker Linux runtime
Python: 3.12
Data: synthetic agent trajectory only

No real user memory or secrets were used.

Activity

  1. cyfyifanchen commented on Sep 9, 2026

    @cyfyifanchen
    Collaborator

    Thanks for flagging this. Tool-call items should not crash these extraction paths, and both paths are now covered in v1.2.3: atomic-fact extraction consumes an EpisodeExtracted event, while foresight filters for ChatMessage before accessing role. The latter also has mixed tool-call regression coverage.

    The relevant follow-up landed in #393: #393

    Closing this as fixed, and closing #284 as superseded. If another extraction path still trips over tool-call items on the current release, please share the traceback so we can follow that up separately.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions