@oh-my-pi/pi-agent-core 18.0.4 → 18.0.5

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.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.0.5] - 2026-08-25
6
+
7
+ ### Fixed
8
+
9
+ - Corrected remote compaction summaries so they accurately report the number of input tokens processed.
10
+
5
11
  ## [18.0.4] - 2026-08-24
6
12
 
7
13
  ### Changed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-agent-core",
4
- "version": "18.0.4",
4
+ "version": "18.0.5",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Stencil Labs, Inc.",
@@ -35,16 +35,16 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@oh-my-pi/pi-ai": "18.0.4",
39
- "@oh-my-pi/pi-catalog": "18.0.4",
40
- "@oh-my-pi/pi-natives": "18.0.4",
41
- "@oh-my-pi/pi-utils": "18.0.4",
42
- "@oh-my-pi/pi-wire": "18.0.4",
43
- "@oh-my-pi/snapcompact": "18.0.4",
38
+ "@oh-my-pi/pi-ai": "18.0.5",
39
+ "@oh-my-pi/pi-catalog": "18.0.5",
40
+ "@oh-my-pi/pi-natives": "18.0.5",
41
+ "@oh-my-pi/pi-utils": "18.0.5",
42
+ "@oh-my-pi/pi-wire": "18.0.5",
43
+ "@oh-my-pi/snapcompact": "18.0.5",
44
44
  "@opentelemetry/api": "^1.9.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@oh-my-pi/omptype": "18.0.4",
47
+ "@oh-my-pi/omptype": "18.0.5",
48
48
  "@opentelemetry/context-async-hooks": "^2.9.0",
49
49
  "@opentelemetry/sdk-trace-base": "^2.9.0",
50
50
  "@types/bun": "^1.3.14"
@@ -1497,6 +1497,21 @@ function selectNativeCompactionError(previousError: unknown, nextError: unknown)
1497
1497
  return AIError.is(AIError.classify(previousError), AIError.Flag.AuthFailed) ? nextError : previousError;
1498
1498
  }
1499
1499
 
1500
+ /**
1501
+ * User-facing placeholder summary for a provider-native remote compaction.
1502
+ *
1503
+ * `inputTokens` is the compaction request's provider-reported input usage
1504
+ * (persisted as `openaiRemoteCompaction.usedTokens`), NOT the size of the
1505
+ * retained replacement history — so the wording describes processed input, not
1506
+ * retained context, to avoid implying the number is the post-compaction size.
1507
+ */
1508
+ function formatRemoteCompactionSummary(inputTokens: number): string {
1509
+ return (
1510
+ "Remote compaction preserved provider-native history for this session." +
1511
+ (inputTokens > 0 ? ` Compaction processed ${inputTokens} input tokens.` : "")
1512
+ );
1513
+ }
1514
+
1500
1515
  /**
1501
1516
  * Generate summaries for compaction using prepared data.
1502
1517
  * Returns CompactionResult - SessionManager adds id/parentId when saving.
@@ -1711,10 +1726,8 @@ export async function compact(
1711
1726
  // redundant LLM round. If a LATER compaction cannot reuse this payload,
1712
1727
  // prepareCompaction re-expands the original messages and summarizes them
1713
1728
  // locally then (see remotePreserveReusable).
1714
- const usedTokens = getCompactionV2PreserveData(preserveData)?.usedTokens ?? 0;
1715
- summary =
1716
- "Remote compaction preserved provider-native history for this session." +
1717
- (usedTokens > 0 ? ` Retained ${usedTokens} tokens in the provider replay payload.` : "");
1729
+ const inputTokens = getCompactionV2PreserveData(preserveData)?.usedTokens ?? 0;
1730
+ summary = formatRemoteCompactionSummary(inputTokens);
1718
1731
  } else if (isSplitTurn && turnPrefixMessages.length > 0) {
1719
1732
  // Generate both summaries in parallel
1720
1733
  const [historyResult, turnPrefixResult] = await Promise.all([