@zenning/openai 3.0.24 → 3.0.26

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.
@@ -2479,13 +2479,6 @@ async function convertToOpenAIResponsesInput({
2479
2479
  const warnings = [];
2480
2480
  const processedApprovalIds = /* @__PURE__ */ new Set();
2481
2481
  const approvalToolCallIds = new Set(approvalToolCallIdsArray || []);
2482
- console.log("CALDEBUG [convertToOpenAIResponsesInput] Starting conversion:", {
2483
- containsApprovalResponses,
2484
- approvalToolCallIdsCount: approvalToolCallIds.size,
2485
- approvalToolCallIds: Array.from(approvalToolCallIds),
2486
- previousResponseId,
2487
- promptLength: prompt.length
2488
- });
2489
2482
  if (compactionInput && compactionInput.length > 0) {
2490
2483
  input.push(...compactionInput);
2491
2484
  }
@@ -2720,10 +2713,6 @@ async function convertToOpenAIResponsesInput({
2720
2713
  break;
2721
2714
  }
2722
2715
  case "tool": {
2723
- console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing tool role message:", {
2724
- partsCount: content.length,
2725
- partTypes: content.map((p) => p.type)
2726
- });
2727
2716
  for (const part of content) {
2728
2717
  if (part.type === "tool-approval-response") {
2729
2718
  const approvalResponse = part;
@@ -2747,14 +2736,7 @@ async function convertToOpenAIResponsesInput({
2747
2736
  const output = part.output;
2748
2737
  if (output.type === "execution-denied") {
2749
2738
  const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2750
- console.log("CALDEBUG [convertToOpenAIResponsesInput] Found execution-denied:", {
2751
- toolCallId: part.toolCallId,
2752
- toolName: part.toolName,
2753
- hasApprovalId: !!approvalId,
2754
- approvalId,
2755
- willSkip: !!approvalId
2756
- });
2757
- if (approvalId) {
2739
+ if (approvalId && !previousResponseId) {
2758
2740
  continue;
2759
2741
  }
2760
2742
  }
@@ -3810,6 +3792,18 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils24.lazySchem
3810
3792
  encrypted_content: import_v417.z.string()
3811
3793
  })
3812
3794
  ).optional(),
3795
+ /**
3796
+ * Server-side context management configuration.
3797
+ * When enabled with a compaction threshold, the server automatically compacts
3798
+ * the conversation in-stream when the rendered token count crosses the threshold.
3799
+ * @see https://developers.openai.com/api/docs/guides/compaction
3800
+ */
3801
+ contextManagement: import_v417.z.array(
3802
+ import_v417.z.object({
3803
+ type: import_v417.z.literal("compaction"),
3804
+ compact_threshold: import_v417.z.number()
3805
+ })
3806
+ ).optional(),
3813
3807
  /**
3814
3808
  * Whether the request contains tool approval responses.
3815
3809
  * Defaults to `false`.
@@ -4478,6 +4472,7 @@ var OpenAIResponsesLanguageModel = class {
4478
4472
  safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
4479
4473
  top_logprobs: topLogprobs,
4480
4474
  truncation: openaiOptions == null ? void 0 : openaiOptions.truncation,
4475
+ context_management: openaiOptions == null ? void 0 : openaiOptions.contextManagement,
4481
4476
  // model-specific settings:
4482
4477
  ...isReasoningModel && ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null) && {
4483
4478
  reasoning: {