Problem
The Cortex plugin's formatMemoryContext() function lost its rich preamble during a routing refactor (commit 3184d96). The MEMORY_PREAMBLE constant was present in 3d22b2b and the v2 format commit cc544fa but got removed.
Current output (broken)
<relevant-memories>
- [49f39413] [2026-03-23] [medium/episodic] content here
</relevant-memories>
Expected output (with preamble)
<relevant-memories>
Long-term memories from your Cortex memory system, matched to this conversation.
Format: [score%] [date] [salience/category] content {item_id}
Score: >70% strong match, 30-50% tangential. Weight accordingly.
...category guide, rules, etc...
- [78%] [2026-03-23] [medium/episodic] content here {49f39413}
[N of M memories shown — use cortex_search for more]
</relevant-memories>
Also missing from v2 format
- Score percentage as first field
- Item ID in braces at end
- Footer showing "N of M memories shown"
Fix
Restore MEMORY_PREAMBLE constant and update formatMemoryContext() to include it. Reference commit cc544fa for the v2 preamble text and format spec.
Secondary issue
openclaw-control-ui is being saved as username in memories — likely Cortex server-side attribution issue, not plugin-side.
Problem
The Cortex plugin's
formatMemoryContext()function lost its rich preamble during a routing refactor (commit3184d96). TheMEMORY_PREAMBLEconstant was present in3d22b2band the v2 format commitcc544fabut got removed.Current output (broken)
Expected output (with preamble)
Also missing from v2 format
Fix
Restore
MEMORY_PREAMBLEconstant and updateformatMemoryContext()to include it. Reference commitcc544fafor the v2 preamble text and format spec.Secondary issue
openclaw-control-uiis being saved as username in memories — likely Cortex server-side attribution issue, not plugin-side.