pi-openai-toolkit 0.14.13 → 0.15.1

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/src/debug.ts CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  type ArtifactSessionInfo,
11
11
  type DebugArtifactEnvelope,
12
12
  type DebugArtifactKind,
13
- type CompactionConfig,
13
+ type DebugConfig,
14
14
  type RedactOptions,
15
15
  } from "./types";
16
16
 
@@ -96,7 +96,7 @@ export function redactValue(value: unknown, options: RedactOptions = {}): unknow
96
96
  return redactWithKeyPattern(value, SENSITIVE_KEY_RE, options);
97
97
  }
98
98
 
99
- export function resolveArtifactPaths(settings: CompactionConfig, context: ArtifactContext): ArtifactPaths {
99
+ export function resolveArtifactPaths(settings: DebugConfig, context: ArtifactContext): ArtifactPaths {
100
100
  const sessionInfo = toSessionInfo(context);
101
101
  const rootDir = settings.artifactRoot.startsWith("~/")
102
102
  ? path.join(os.homedir(), settings.artifactRoot.slice(2))
@@ -127,7 +127,7 @@ function selectArtifactDirectory(paths: ArtifactPaths, kind: DebugArtifactKind):
127
127
  }
128
128
  }
129
129
 
130
- function shouldWriteArtifact(kind: DebugArtifactKind, settings: CompactionConfig): boolean {
130
+ function shouldWriteArtifact(kind: DebugArtifactKind, settings: DebugConfig): boolean {
131
131
  switch (kind) {
132
132
  case "provider-request":
133
133
  return settings.logProviderPayloads;
@@ -144,7 +144,7 @@ function shouldWriteArtifact(kind: DebugArtifactKind, settings: CompactionConfig
144
144
  export function writeDebugArtifact(
145
145
  kind: DebugArtifactKind,
146
146
  data: unknown,
147
- settings: CompactionConfig,
147
+ settings: DebugConfig,
148
148
  context: ArtifactContext,
149
149
  ): string | undefined {
150
150
  if (!shouldWriteArtifact(kind, settings)) {
@@ -196,7 +196,7 @@ export function writeReplayFailureArtifact(
196
196
  api?: string;
197
197
  model?: string;
198
198
  },
199
- settings: CompactionConfig,
199
+ settings: DebugConfig,
200
200
  context: ArtifactContext,
201
201
  ): string | undefined {
202
202
  try {
@@ -1,5 +1,6 @@
1
1
  import type { ResponsesCompatibleRequestPayload } from "./runtime";
2
2
  import { isDeferredToolCarryover, type DeferredToolCarryoverV1 } from "./types";
3
+ import { LOCAL_WEB_SEARCH_TOOL_NAME, WEB_RUN_TOOL_NAME } from "./web-search/types";
3
4
 
4
5
  type JsonObject = Record<string, unknown>;
5
6
 
@@ -223,10 +224,11 @@ export function rewritePayloadWithDeferredToolCarryover(args: {
223
224
  }
224
225
  if (!Array.isArray(args.payload.tools)) return unchanged;
225
226
 
227
+ // Search routing needs its local callable at the top level on every request.
226
228
  const carryoverNames = new Set(
227
229
  args.carryover.toolNames
228
230
  .map((name) => name.trim())
229
- .filter((name) => name.length > 0 && name !== "web_search"),
231
+ .filter((name) => name.length > 0 && name !== LOCAL_WEB_SEARCH_TOOL_NAME && name !== WEB_RUN_TOOL_NAME),
230
232
  );
231
233
  if (carryoverNames.size === 0) return unchanged;
232
234