Skip to content

fix: append memory after stable system prefix - #47

Closed
prdai wants to merge 1 commit into
joshuadavidthomas:mainfrom
prdai-archive:fix/append-memory-after-stable-prefix
Closed

prdai wants to merge 1 commit into
joshuadavidthomas:mainfrom
prdai-archive:fix/append-memory-after-stable-prefix

Conversation

@prdai

@prdai prdai commented Oct 18, 2026

Copy link
Copy Markdown

Summary

  • Stop splicing memory into event.system at index 1; append it after the stable prefix instead
  • Update plugin tests to find the memory chunk by content rather than a fixed index

Fixes #46

Context

#46 reported two cache-busting behaviors:

  1. Per-turn toISOString() in <memory_metadata> — already removed on main / 0.3.0 (thanks)
  2. Early splice at system index 1 — still present; any memory edit invalidates tools + core instructions for prompt cache

This PR addresses (2). Appending keeps tools/core instructions cacheable; memory (and journal notes) only touch the trailing system chunk.

Test plan

  • bun test src/plugin.test.ts --timeout 120000
  • bun test src/prompt.test.ts
  • Manual: long OpenCode session should show growing cacheRead rather than a flat ~22k ceiling after memory is injected

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@prdai

prdai commented Oct 18, 2026

Copy link
Copy Markdown
Author

Closing — early placement of memory blocks is expected for salience; the per-turn ISO timestamp bust is already fixed on main / 0.3.0.

@prdai prdai closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-turn ISO timestamp in early system prompt busts prompt cache

1 participant