@ouro.bot/cli 0.1.0-alpha.1025 → 0.1.0-alpha.1026

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/changelog.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1026",
6
+ "changes": [
7
+ "Private-runtime sessions no longer grow without bound: superseded system prompts are dropped from session history, so a long-running agent's dialog.json stays small instead of reaching hundreds of megabytes and running Node out of memory."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1025",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1025",
2
+ "runtimeVersion": "0.1.0-alpha.1026",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1025</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1026</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -1395,6 +1395,42 @@ function retainedSourceEventIds(message, existing, used) {
1395
1395
  && messageFingerprint(candidate, true) === fingerprint);
1396
1396
  return originals.some(matches) || sanitizeProviderMessages(originals).some(matches) ? ids : null;
1397
1397
  }
1398
+ /**
1399
+ * The system prompt is rebuilt every turn (it carries live world state), so each turn used to add
1400
+ * a full copy to native history: one long-running private-runtime session held 3,773 of them (329 MB of
1401
+ * 357 MB) and parsing it ran Node out of memory. A system prompt the projection no longer uses is
1402
+ * not conversation, so it is dropped once superseded. System records without text (redaction
1403
+ * markers), events anything refers to, and the newest event (so sequence numbers never repeat)
1404
+ * are always kept.
1405
+ */
1406
+ function dropSupersededSystemPrompts(events, projectionEventIds, approvalSuspensions) {
1407
+ if (projectionEventIds.length === 0)
1408
+ return events;
1409
+ const keep = new Set(projectionEventIds);
1410
+ for (const event of events) {
1411
+ const relations = event.relations;
1412
+ for (const id of [relations.replyToEventId, relations.threadRootEventId, relations.supersedesEventId, relations.redactsEventId, ...relations.references]) {
1413
+ if (id)
1414
+ keep.add(id);
1415
+ }
1416
+ }
1417
+ for (const id of JSON.stringify(approvalSuspensions ?? []).match(/evt-\d+/g) ?? [])
1418
+ keep.add(id);
1419
+ const newestSequence = events.reduce((max, event) => Math.max(max, event.sequence), -Infinity);
1420
+ const kept = events.filter((event) => event.role !== "system"
1421
+ || typeof event.content !== "string"
1422
+ || keep.has(event.id)
1423
+ || event.sequence === newestSequence);
1424
+ if (kept.length < events.length) {
1425
+ (0, runtime_1.emitNervesEvent)({
1426
+ component: "mind",
1427
+ event: "mind.session_system_prompts_dropped",
1428
+ message: "dropped superseded system prompts from session history",
1429
+ meta: { dropped: events.length - kept.length, kept: kept.length },
1430
+ });
1431
+ }
1432
+ return kept;
1433
+ }
1398
1434
  function buildCanonicalSessionEnvelope(options) {
1399
1435
  const existing = options.existing;
1400
1436
  // Callers pass pre-sanitized messages + pre-captured ingress times.
@@ -1474,14 +1510,15 @@ function buildCanonicalSessionEnvelope(options) {
1474
1510
  usedEventIds.add(id);
1475
1511
  }
1476
1512
  const projectionEventIds = selectProjectedEventIds(currentMessages, currentEventIds, trimmedMessages);
1513
+ const keptEvents = dropSupersededSystemPrompts(events, projectionEventIds, existing?.approvalSuspensions);
1477
1514
  // Projection omissions are not authority to delete native history.
1478
1515
  const projectionIdSet = new Set(projectionEventIds);
1479
- const effectiveEvents = selectEffectiveSessionEvents(events);
1516
+ const effectiveEvents = selectEffectiveSessionEvents(keptEvents);
1480
1517
  const effectiveIds = new Set(effectiveEvents.map((event) => event.id));
1481
1518
  const evictedEvents = effectiveEvents.filter((event) => !projectionIdSet.has(event.id));
1482
1519
  const envelope = {
1483
1520
  version: 2,
1484
- events,
1521
+ events: keptEvents,
1485
1522
  projection: {
1486
1523
  eventIds: projectionEventIds.filter((id) => effectiveIds.has(id)),
1487
1524
  trimmed: evictedEvents.length > 0,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1025",
3
+ "version": "0.1.0-alpha.1026",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1025",
9
+ "version": "0.1.0-alpha.1026",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@ouro.bot/friends": "0.1.0-alpha.17",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1025",
3
+ "version": "0.1.0-alpha.1026",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },