@oh-my-pi/pi-agent-core 18.1.6 → 18.1.9
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.
|
@@ -456,7 +456,7 @@ export declare function recordManualChatTelemetry(telemetry: AgentTelemetry | un
|
|
|
456
456
|
/**
|
|
457
457
|
* Options accepted by {@link instrumentedCompleteSimple}. Mirrors the
|
|
458
458
|
* `streamAssistantResponse` chat-span lifecycle for oneshot LLM calls
|
|
459
|
-
* (compaction summaries, handoff document, branch summary,
|
|
459
|
+
* (compaction summaries, handoff document, branch summary, image_question).
|
|
460
460
|
*/
|
|
461
461
|
export interface InstrumentedChatSpanOptions {
|
|
462
462
|
readonly telemetry: AgentTelemetry | undefined;
|
|
@@ -467,7 +467,7 @@ export interface InstrumentedChatSpanOptions {
|
|
|
467
467
|
/**
|
|
468
468
|
* Tag stamped onto `pi.gen_ai.oneshot.kind`. Values used by the agent:
|
|
469
469
|
* `compaction_summary`, `compaction_short_summary`, `compaction_turn_prefix`,
|
|
470
|
-
* `handoff`, `branch_summary`, `
|
|
470
|
+
* `handoff`, `branch_summary`, `image_question`. Free-form to allow callers
|
|
471
471
|
* outside this package to add new kinds without bumping the helper.
|
|
472
472
|
*/
|
|
473
473
|
readonly oneshotKind?: string;
|
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.1.
|
|
4
|
+
"version": "18.1.9",
|
|
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": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@oh-my-pi/pi-ai": "18.1.
|
|
39
|
-
"@oh-my-pi/pi-catalog": "18.1.
|
|
40
|
-
"@oh-my-pi/pi-natives": "18.1.
|
|
41
|
-
"@oh-my-pi/pi-utils": "18.1.
|
|
42
|
-
"@oh-my-pi/pi-wire": "18.1.
|
|
43
|
-
"@oh-my-pi/snapcompact": "18.1.
|
|
38
|
+
"@oh-my-pi/pi-ai": "18.1.9",
|
|
39
|
+
"@oh-my-pi/pi-catalog": "18.1.9",
|
|
40
|
+
"@oh-my-pi/pi-natives": "18.1.9",
|
|
41
|
+
"@oh-my-pi/pi-utils": "18.1.9",
|
|
42
|
+
"@oh-my-pi/pi-wire": "18.1.9",
|
|
43
|
+
"@oh-my-pi/snapcompact": "18.1.9",
|
|
44
44
|
"@opentelemetry/api": "^1.9.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@oh-my-pi/omptype": "18.1.
|
|
47
|
+
"@oh-my-pi/omptype": "18.1.9",
|
|
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"
|
|
@@ -27,6 +27,7 @@ import { captureOpenAIHttpError } from "@oh-my-pi/pi-ai/utils/openai-http";
|
|
|
27
27
|
import {
|
|
28
28
|
applyCodexResidencyHeader,
|
|
29
29
|
CODEX_BASE_URL,
|
|
30
|
+
codexRoutingHint,
|
|
30
31
|
getCodexAccountId,
|
|
31
32
|
OPENAI_HEADER_VALUES,
|
|
32
33
|
OPENAI_HEADERS,
|
|
@@ -424,6 +425,7 @@ function buildCompactionV2Headers(
|
|
|
424
425
|
headers[OPENAI_HEADERS.BETA] = OPENAI_HEADER_VALUES.BETA_RESPONSES;
|
|
425
426
|
headers[OPENAI_HEADERS.ORIGINATOR] = OPENAI_HEADER_VALUES.ORIGINATOR_CODEX;
|
|
426
427
|
headers[OPENAI_HEADERS.CODEX_BETA_FEATURES] = OPENAI_HEADER_VALUES.REMOTE_COMPACTION_V2;
|
|
428
|
+
headers[OPENAI_HEADERS.ROUTING_HINT] = codexRoutingHint(request.model, undefined);
|
|
427
429
|
if (model.useResponsesLite) {
|
|
428
430
|
headers[OPENAI_HEADERS.RESPONSES_LITE] = "true";
|
|
429
431
|
}
|
package/src/compaction/openai.ts
CHANGED
|
@@ -48,6 +48,7 @@ import { captureOpenAIHttpError } from "@oh-my-pi/pi-ai/utils/openai-http";
|
|
|
48
48
|
import {
|
|
49
49
|
applyCodexResidencyHeader,
|
|
50
50
|
CODEX_BASE_URL,
|
|
51
|
+
codexRoutingHint,
|
|
51
52
|
getCodexAccountId,
|
|
52
53
|
OPENAI_HEADER_VALUES,
|
|
53
54
|
OPENAI_HEADERS,
|
|
@@ -824,6 +825,8 @@ export async function requestOpenAiRemoteCompaction(
|
|
|
824
825
|
}
|
|
825
826
|
headers[OPENAI_HEADERS.BETA] = OPENAI_HEADER_VALUES.BETA_RESPONSES;
|
|
826
827
|
headers[OPENAI_HEADERS.ORIGINATOR] = OPENAI_HEADER_VALUES.ORIGINATOR_CODEX;
|
|
828
|
+
// This compaction request sends no `service_tier`, so the hint is model-only.
|
|
829
|
+
headers[OPENAI_HEADERS.ROUTING_HINT] = codexRoutingHint(request.model, undefined);
|
|
827
830
|
Object.assign(
|
|
828
831
|
headers,
|
|
829
832
|
createOpenAICodexCompatibilityMetadata({
|
package/src/telemetry.ts
CHANGED
|
@@ -1638,7 +1638,7 @@ export async function recordManualChatTelemetry(
|
|
|
1638
1638
|
/**
|
|
1639
1639
|
* Options accepted by {@link instrumentedCompleteSimple}. Mirrors the
|
|
1640
1640
|
* `streamAssistantResponse` chat-span lifecycle for oneshot LLM calls
|
|
1641
|
-
* (compaction summaries, handoff document, branch summary,
|
|
1641
|
+
* (compaction summaries, handoff document, branch summary, image_question).
|
|
1642
1642
|
*/
|
|
1643
1643
|
export interface InstrumentedChatSpanOptions {
|
|
1644
1644
|
readonly telemetry: AgentTelemetry | undefined;
|
|
@@ -1649,7 +1649,7 @@ export interface InstrumentedChatSpanOptions {
|
|
|
1649
1649
|
/**
|
|
1650
1650
|
* Tag stamped onto `pi.gen_ai.oneshot.kind`. Values used by the agent:
|
|
1651
1651
|
* `compaction_summary`, `compaction_short_summary`, `compaction_turn_prefix`,
|
|
1652
|
-
* `handoff`, `branch_summary`, `
|
|
1652
|
+
* `handoff`, `branch_summary`, `image_question`. Free-form to allow callers
|
|
1653
1653
|
* outside this package to add new kinds without bumping the helper.
|
|
1654
1654
|
*/
|
|
1655
1655
|
readonly oneshotKind?: string;
|