@oh-my-pi/pi-agent-core 16.4.1 → 16.4.2
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
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": "16.4.
|
|
4
|
+
"version": "16.4.2",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"fmt": "biome format --write ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@oh-my-pi/pi-ai": "16.4.
|
|
39
|
-
"@oh-my-pi/pi-catalog": "16.4.
|
|
40
|
-
"@oh-my-pi/pi-natives": "16.4.
|
|
41
|
-
"@oh-my-pi/pi-utils": "16.4.
|
|
42
|
-
"@oh-my-pi/pi-wire": "16.4.
|
|
43
|
-
"@oh-my-pi/snapcompact": "16.4.
|
|
38
|
+
"@oh-my-pi/pi-ai": "16.4.2",
|
|
39
|
+
"@oh-my-pi/pi-catalog": "16.4.2",
|
|
40
|
+
"@oh-my-pi/pi-natives": "16.4.2",
|
|
41
|
+
"@oh-my-pi/pi-utils": "16.4.2",
|
|
42
|
+
"@oh-my-pi/pi-wire": "16.4.2",
|
|
43
|
+
"@oh-my-pi/snapcompact": "16.4.2",
|
|
44
44
|
"@opentelemetry/api": "^1.9.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
OPENAI_HEADER_VALUES,
|
|
28
28
|
OPENAI_HEADERS,
|
|
29
29
|
} from "@oh-my-pi/pi-catalog/wire/codex";
|
|
30
|
-
import { $env, logger } from "@oh-my-pi/pi-utils";
|
|
30
|
+
import { $env, logger, stringifyJson } from "@oh-my-pi/pi-utils";
|
|
31
31
|
|
|
32
32
|
// ============================================================================
|
|
33
33
|
// Types & Configuration
|
|
@@ -329,7 +329,7 @@ async function attemptCompactionV2Streaming(
|
|
|
329
329
|
const response = await fetchImpl(endpoint, {
|
|
330
330
|
method: "POST",
|
|
331
331
|
headers: buildCompactionV2Headers(model, apiKey, request, codexMetadata),
|
|
332
|
-
body:
|
|
332
|
+
body: stringifyJson(body),
|
|
333
333
|
signal,
|
|
334
334
|
});
|
|
335
335
|
|
|
@@ -28,7 +28,7 @@ import { convertTools } from "@oh-my-pi/pi-ai/providers/openai-responses";
|
|
|
28
28
|
import { buildResponsesInput, resolveOpenAICompatPolicy } from "@oh-my-pi/pi-ai/providers/openai-shared";
|
|
29
29
|
import { preferredDialect } from "@oh-my-pi/pi-catalog/identity";
|
|
30
30
|
import { clampThinkingLevelForModel } from "@oh-my-pi/pi-catalog/model-thinking";
|
|
31
|
-
import { logger, prompt } from "@oh-my-pi/pi-utils";
|
|
31
|
+
import { logger, prompt, stringifyJson } from "@oh-my-pi/pi-utils";
|
|
32
32
|
import * as snapcompact from "@oh-my-pi/snapcompact";
|
|
33
33
|
import { type AgentTelemetry, instrumentedCompleteSimple } from "../telemetry";
|
|
34
34
|
import { ThinkingLevel } from "../thinking";
|
|
@@ -406,7 +406,7 @@ export function estimateTokens(message: AgentMessage, options?: { excludeEncrypt
|
|
|
406
406
|
}
|
|
407
407
|
} else if (block.type === "toolCall") {
|
|
408
408
|
fragments.push(block.name);
|
|
409
|
-
fragments.push(
|
|
409
|
+
fragments.push(stringifyJson(block.arguments) ?? "null");
|
|
410
410
|
} else if (block.type === "redactedThinking") {
|
|
411
411
|
// Encrypted reasoning blob the provider still bills for on replay;
|
|
412
412
|
// excluded from the compaction floor for the same reason as above.
|
package/src/compaction/openai.ts
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
OPENAI_HEADER_VALUES,
|
|
44
44
|
OPENAI_HEADERS,
|
|
45
45
|
} from "@oh-my-pi/pi-catalog/wire/codex";
|
|
46
|
-
import { $env, logger } from "@oh-my-pi/pi-utils";
|
|
46
|
+
import { $env, logger, stringifyJson } from "@oh-my-pi/pi-utils";
|
|
47
47
|
|
|
48
48
|
export * from "./compaction-v2-streaming";
|
|
49
49
|
|
|
@@ -419,7 +419,7 @@ export function buildOpenAiNativeHistory(
|
|
|
419
419
|
id: itemId,
|
|
420
420
|
call_id: normalized.callId,
|
|
421
421
|
name: block.name,
|
|
422
|
-
arguments:
|
|
422
|
+
arguments: stringifyJson(block.arguments) ?? "null",
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
}
|
|
@@ -549,7 +549,7 @@ export async function requestOpenAiRemoteCompaction(
|
|
|
549
549
|
const response = await (opts?.fetch ?? fetch)(endpoint, {
|
|
550
550
|
method: "POST",
|
|
551
551
|
headers,
|
|
552
|
-
body:
|
|
552
|
+
body: stringifyJson(request),
|
|
553
553
|
signal: withRequestTimeout(signal, opts?.timeoutMs ?? REMOTE_COMPACTION_TIMEOUT_MS),
|
|
554
554
|
});
|
|
555
555
|
|
|
@@ -646,7 +646,7 @@ export async function requestRemoteCompaction(
|
|
|
646
646
|
const response = await (opts?.fetch ?? fetch)(endpoint, {
|
|
647
647
|
method: "POST",
|
|
648
648
|
headers,
|
|
649
|
-
body:
|
|
649
|
+
body: stringifyJson(body),
|
|
650
650
|
signal: withRequestTimeout(signal, opts?.timeoutMs ?? REMOTE_COMPACTION_TIMEOUT_MS),
|
|
651
651
|
});
|
|
652
652
|
|
package/src/compaction/utils.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type { Message, ToolCall } from "@oh-my-pi/pi-ai";
|
|
6
6
|
import { type Dialect, getDialectDefinition } from "@oh-my-pi/pi-ai/dialect";
|
|
7
|
-
import { formatGroupedPaths, prompt } from "@oh-my-pi/pi-utils";
|
|
7
|
+
import { formatGroupedPaths, prompt, stringifyJson } from "@oh-my-pi/pi-utils";
|
|
8
8
|
import type { AgentMessage } from "../types";
|
|
9
9
|
import fileOperationsTemplate from "./prompts/file-operations.md" with { type: "text" };
|
|
10
10
|
import summarizationSystemPrompt from "./prompts/summarization-system.md" with { type: "text" };
|
|
@@ -309,7 +309,7 @@ function renderToolCalls(calls: ToolCall[]): string {
|
|
|
309
309
|
return calls
|
|
310
310
|
.map(call => {
|
|
311
311
|
const argsStr = Object.entries(call.arguments as Record<string, unknown>)
|
|
312
|
-
.map(([k, v]) => `${k}=${
|
|
312
|
+
.map(([k, v]) => `${k}=${stringifyJson(v) ?? "null"}`)
|
|
313
313
|
.join(", ");
|
|
314
314
|
return `${call.name}(${argsStr})`;
|
|
315
315
|
})
|