Skip to content

memory: MCP memory_add path has no extraction-ctx preflight — #1903 defect is identical on /mcp/memory #1930

Description

@thinmintdev

Split out of the PR #1917 review (finding 4, non-blocking there because #1903's repro was the REST route).

src/hal0/mcp/memory.py (memory_add tool, ~line 360) calls the same wrapper.add as POST /api/memory/add, with no extraction-slot context-window preflight. /mcp/memory is the path agents actually retain through — the REST shim's own docstring calls itself a veneer for non-MCP callers — so on a below-floor box an MCP retain still returns success and is then dropped by the engine (retain_extract_facts 500 "Context size has been exceeded") or answered by persisting prompt scaffolding as a fact.

The MCP tool signature only receives wrapper (no request/app state), so the fix needs a seam that gives the tool access to slot_manager/model_registry (or moves the preflight into the wrapper itself, where both callers share it). Until then the next rc-validate run will re-find #1903 on the MCP side.

Refs #1903, PR #1917.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions