Skip to content

v4.3.2: fix: archive/import header-format tolerance, absolute hook script paths

Latest

Choose a tag to compare

@LuiggiVal08 LuiggiVal08 released this 03 Aug 20:48

Fixed

  • memory_archive no-oped on CLI-initialized projectsarchiveOldEntries and pruneExpiredEntries only recognized the entries[N|] header written by the MCP config writer, but toon-memory init creates data.toon with a [N|] header. On those files both functions returned 0 silently, so memory_archive, the MAX_ENTRIES auto-trim, and TTL pruning never ran. They now accept both header conventions, and the count bump preserves the entries/archived prefix (the archive writer also used to strip archived from archive.toon, breaking subsequent runs).
  • Hook scripts referenced capture.js/session-start.js relative to the hook CWDconstants.ts derived the CLI directory from process.argv[1], which the entry points overwrite with "toon-memory", so generated hooks ran node "capture.js" ... resolved against whatever directory the agent executed the hook from. Script paths are now derived from import.meta.url and are absolute.
  • toon-memory import left the entry count stale — the header regex required a literal ] right after the count (entries[\d+\|]), which no real header has, so the count never updated after importing. It now matches both entries[N|] and [N|] headers and preserves the prefix.

Tests

  • archiveOldEntries works on [N|], entries[N|], and mixed files, and preserves the archived[ prefix across repeated runs
  • toon-memory init writes hook scripts with absolute paths; toon-memory import bumps the header count on a CLI-style [N|] file