@sentry/junior-memory 0.155.0 → 0.156.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-memory",
3
- "version": "0.155.0",
3
+ "version": "0.156.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,7 +27,7 @@
27
27
  "commander": "^14.0.3",
28
28
  "drizzle-orm": "^0.45.2",
29
29
  "zod": "^4.4.3",
30
- "@sentry/junior-plugin-api": "0.155.0"
30
+ "@sentry/junior-plugin-api": "0.156.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^25.9.1",
package/src/events.ts CHANGED
@@ -22,7 +22,8 @@ const capturedMemoriesSchema = z
22
22
 
23
23
  const recalledMemoriesSchema = z
24
24
  .object({
25
- memories: z.array(z.string().min(1)).max(5),
25
+ // Matches the automatic-recall candidate window; admission packs by char budget.
26
+ memories: z.array(z.string().min(1)).max(20),
26
27
  costUsd: z.number().finite().nonnegative().optional(),
27
28
  })
28
29
  .strict();
package/src/recall.ts CHANGED
@@ -17,7 +17,6 @@ import {
17
17
  } from "./store";
18
18
  import { memoryRuntimeContextSchema } from "./types";
19
19
 
20
- const DEFAULT_RECALL_LIMIT = 5;
21
20
  const RECALL_CANDIDATE_LIMIT = 20;
22
21
  const MAX_PROMPT_CHARS = 4_000;
23
22
  const MAX_MEMORY_LINE_CHARS = 600;
@@ -59,7 +58,8 @@ const recalledMemorySchema = z
59
58
  /** Structured snapshot retained for one automatic memory recall. */
60
59
  export const memoryRecallContextSchema = z
61
60
  .object({
62
- memories: z.array(recalledMemorySchema).min(1).max(DEFAULT_RECALL_LIMIT),
61
+ // Count is a safety rail only. Admission packs by MAX_PROMPT_CHARS.
62
+ memories: z.array(recalledMemorySchema).min(1).max(RECALL_CANDIDATE_LIMIT),
63
63
  })
64
64
  .strict();
65
65
 
@@ -187,8 +187,7 @@ export async function createMemoryPromptContributions(
187
187
  );
188
188
  const relevant = recall.relevantIds
189
189
  .map((id) => candidatesById.get(id))
190
- .filter((memory): memory is MemoryRecord => memory !== undefined)
191
- .slice(0, DEFAULT_RECALL_LIMIT);
190
+ .filter((memory): memory is MemoryRecord => memory !== undefined);
192
191
  const selected = selectPromptMemories(relevant);
193
192
  const costUsd = addUsd(embeddingCostUsd, recall.costUsd);
194
193
  await emitRecallOutcome({