Skip to content

[Bug][multi-agent-memory]: statewave_tools.compile() shadows the builtin in a file meant to be copy-pasted #401

Description

@jy7lsna

Affected Component

statewave-multi-agent-memorystatewave_tools.py

Bug Description

statewave_tools.py:64 defines a module-level function named compile, which shadows the Python builtin of the same name.

That would be a minor style point in an application module, but this file is explicitly designed to be copied into other people's projects, and its own docstring tells them to import it into their namespace:

# statewave_tools.py:13
from statewave_tools import configure, remember, compile, recall

After that import, compile() in the importing module is Statewave's, not the builtin. Anything in that namespace that later calls the real compile — templating engines, exec/eval helpers, regex precompilation, some serialization libraries — breaks with a confusing error that points at the wrong file. README.md:454, 475, 498 and 550 all reproduce the same import-and-call pattern.

Expected Behavior

A drop-in helper file should not take a builtin name. compile_subject() (matching the server's own vocabulary) or compile_memories() (matching the SDK's compile_memories_wait) would both read better and collide with nothing.

Steps to Reproduce

from statewave_tools import compile
compile("<regex>", 0)   # TypeError, from a name the caller never expected to be rebound

Environment

main as of 2026-09-07.

Severity

Low, but with a bad failure mode: the symptom appears far from the cause, in the user's code rather than in this file.

Additional Context

Renaming touches the function, the module docstring, and four README snippets. Keeping a compile = compile_subject alias for one release would avoid breaking anyone who already copied the file.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions