opencode-lore 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-lore",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Three-tier memory architecture for OpenCode — distillation, not summarization",
package/src/index.ts CHANGED
@@ -224,9 +224,6 @@ export const LorePlugin: Plugin = async (ctx) => {
224
224
 
225
225
  const sessionID = output.messages[0]?.info.sessionID;
226
226
 
227
- const lastUserMsg = [...output.messages].reverse().find((m) => m.info.role === "user");
228
- const statsPart = lastUserMsg?.parts.find((p) => p.type === "text");
229
-
230
227
  const result = transform({
231
228
  messages: output.messages,
232
229
  projectPath,
@@ -252,6 +249,12 @@ export const LorePlugin: Plugin = async (ctx) => {
252
249
  backgroundDistill(sessionID);
253
250
  }
254
251
 
252
+ // Look up statsPart AFTER the transform so the PATCHed text is clean
253
+ // (system-reminder wrappers stripped). Looking up before would persist
254
+ // ephemeral system-reminder content, making it visible in the UI.
255
+ const lastUserMsg = [...output.messages].reverse().find((m) => m.info.role === "user");
256
+ const statsPart = lastUserMsg?.parts.find((p) => p.type === "text");
257
+
255
258
  if (sessionID && statsPart && lastUserMsg) {
256
259
  const loreMeta = {
257
260
  layer: result.layer,