@oh-my-pi/pi-agent-core 18.4.8 → 18.4.10

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,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.4.10] - 2026-10-02
6
+
7
+ ### Fixed
8
+
9
+ - `streamProxy` no longer finalizes a cut-off tool-call argument buffer into an executable auto-closed preview; such a call gets the parse-error arguments, so the tool is not run and the model receives the parse error ([#13868](https://github.com/can1357/oh-my-pi/pull/13868) by [@alphastorm](https://github.com/alphastorm))
10
+ - OpenAI remote compaction no longer sends stored native tool calls whose names are blank, longer than 128 characters, or contain whitespace or control characters. The outputs that answer those calls are dropped as well ([#13985](https://github.com/can1357/oh-my-pi/pull/13985) by [@Xytronix](https://github.com/Xytronix)).
11
+
5
12
  ## [18.4.6] - 2026-10-01
6
13
 
7
14
  ### Added
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.4.8",
4
+ "version": "18.4.10",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": {
@@ -38,16 +38,16 @@
38
38
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
39
39
  },
40
40
  "dependencies": {
41
- "@oh-my-pi/pi-ai": "18.4.8",
42
- "@oh-my-pi/pi-catalog": "18.4.8",
43
- "@oh-my-pi/pi-natives": "18.4.8",
44
- "@oh-my-pi/pi-utils": "18.4.8",
45
- "@oh-my-pi/pi-wire": "18.4.8",
46
- "@oh-my-pi/snapcompact": "18.4.8",
41
+ "@oh-my-pi/pi-ai": "18.4.10",
42
+ "@oh-my-pi/pi-catalog": "18.4.10",
43
+ "@oh-my-pi/pi-natives": "18.4.10",
44
+ "@oh-my-pi/pi-utils": "18.4.10",
45
+ "@oh-my-pi/pi-wire": "18.4.10",
46
+ "@oh-my-pi/snapcompact": "18.4.10",
47
47
  "@opentelemetry/api": "^1.9.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@oh-my-pi/omptype": "18.4.8",
50
+ "@oh-my-pi/omptype": "18.4.10",
51
51
  "@opentelemetry/context-async-hooks": "^2.9.0",
52
52
  "@opentelemetry/sdk-trace-base": "^2.9.0",
53
53
  "@types/bun": "^1.3.14"
@@ -36,6 +36,7 @@ import type {
36
36
  ProviderSessionState,
37
37
  } from "@oh-my-pi/pi-ai/types";
38
38
  import {
39
+ dropMalformedOpenAIResponsesToolCalls,
39
40
  getOpenAIResponsesHistoryItems,
40
41
  getOpenAIResponsesHistoryPayload,
41
42
  normalizeResponsesToolCallId,
@@ -537,7 +538,10 @@ export function buildOpenAiNativeHistory(
537
538
  }
538
539
  }
539
540
  }
540
- const historyItems = adaptComputerHistoryForCompaction(rawHistoryItems, model.supportsComputerUse === true);
541
+ const historyItems = adaptComputerHistoryForCompaction(
542
+ dropMalformedOpenAIResponsesToolCalls(rawHistoryItems),
543
+ model.supportsComputerUse === true,
544
+ );
541
545
  input.push(...historyItems);
542
546
  addOpenAiCallIds(historyItems, knownCallIds, customCallIds, computerCallIds);
543
547
  msgIndex++;
@@ -589,7 +593,7 @@ export function buildOpenAiNativeHistory(
589
593
  }
590
594
  }
591
595
  const historyItems = adaptComputerHistoryForCompaction(
592
- providerPayload.items,
596
+ dropMalformedOpenAIResponsesToolCalls(providerPayload.items),
593
597
  model.supportsComputerUse === true,
594
598
  );
595
599
  if (providerPayload.dt) {
package/src/proxy.ts CHANGED
@@ -20,7 +20,8 @@ import {
20
20
  type StreamingPartialJsonCarrier,
21
21
  setStreamingPartialJson,
22
22
  } from "@oh-my-pi/pi-ai/utils/block-symbols";
23
- import { parseStreamingJson, parseStreamingJsonThrottled, readSseJson } from "@oh-my-pi/pi-utils";
23
+ import { parseToolCallArguments } from "@oh-my-pi/pi-ai/utils/tool-call-arguments";
24
+ import { parseStreamingJsonThrottled, readSseJson } from "@oh-my-pi/pi-utils";
24
25
 
25
26
  // Event stream adapter for proxy SSE events
26
27
  export class ProxyMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
@@ -378,7 +379,7 @@ function processProxyEvent(
378
379
  // throttle may have skipped trailing deltas, so the last
379
380
  // parsed arguments can lag the accumulated buffer.
380
381
  const acc = partialJsonByIndex.get(proxyEvent.contentIndex);
381
- if (acc !== undefined && acc.length > 0) content.arguments = parseStreamingJson(acc) || {};
382
+ if (acc !== undefined && acc.length > 0) content.arguments = parseToolCallArguments(acc) || {};
382
383
  partialJsonByIndex.delete(proxyEvent.contentIndex);
383
384
  parsedLenByIndex.delete(proxyEvent.contentIndex);
384
385
  clearStreamingPartialJson(content);
@@ -427,6 +428,6 @@ function finalizeBufferedArguments(partial: AssistantMessage, partialJsonByIndex
427
428
  for (const [index, acc] of partialJsonByIndex) {
428
429
  if (acc.length === 0) continue;
429
430
  const content = partial.content[index];
430
- if (content?.type === "toolCall") content.arguments = parseStreamingJson(acc) || {};
431
+ if (content?.type === "toolCall") content.arguments = parseToolCallArguments(acc) || {};
431
432
  }
432
433
  }