Skip to content

feat: mimir.auto_inject config flag to suppress automatic Persistent Memory block #442

Description

@tcconnally

Problem

_mimir_context_inject() in mimir_connector.py appends a ## Persistent Memory (Mimir) block to every rendered output when mimir.enabled=true, regardless of whether the source .md contains an @memory directive. There is no config flag to suppress this auto-injection.

Observed behavior

With mimir.enabled=true in the global config, every rendered file gets the Mimir block appended — even a secondary workspace render where the user explicitly wants a lean output. Setting mimir.context_limit: 0 in pack.yaml has no effect (see related issue: pack.yaml config not merged).

Expected behavior

Add a mimir.auto_inject: false config key that suppresses the automatic append. When false, Mimir memories are only included when an explicit @memory directive is present in the source.

Code location

src/perseus/mimir_connector.py line ~1388, _mimir_context_inject() function:

if not mcfg.get("enabled", True):
    return None

Needs an additional check:

if not mcfg.get("auto_inject", True):
    return None

Impact

Users with multiple render targets (e.g. primary + secondary workspace) get the Mimir block duplicated across every rendered file the runtime auto-loads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions