@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.
@@ -2500,13 +2500,6 @@ async function convertToOpenAIResponsesInput({
2500
2500
  const warnings = [];
2501
2501
  const processedApprovalIds = /* @__PURE__ */ new Set();
2502
2502
  const approvalToolCallIds = new Set(approvalToolCallIdsArray || []);
2503
- console.log("CALDEBUG [convertToOpenAIResponsesInput] Starting conversion:", {
2504
- containsApprovalResponses,
2505
- approvalToolCallIdsCount: approvalToolCallIds.size,
2506
- approvalToolCallIds: Array.from(approvalToolCallIds),
2507
- previousResponseId,
2508
- promptLength: prompt.length
2509
- });
2510
2503
  if (compactionInput && compactionInput.length > 0) {
2511
2504
  input.push(...compactionInput);
2512
2505
  }
@@ -2741,10 +2734,6 @@ async function convertToOpenAIResponsesInput({
2741
2734
  break;
2742
2735
  }
2743
2736
  case "tool": {
2744
- console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing tool role message:", {
2745
- partsCount: content.length,
2746
- partTypes: content.map((p) => p.type)
2747
- });
2748
2737
  for (const part of content) {
2749
2738
  if (part.type === "tool-approval-response") {
2750
2739
  const approvalResponse = part;
@@ -2768,14 +2757,7 @@ async function convertToOpenAIResponsesInput({
2768
2757
  const output = part.output;
2769
2758
  if (output.type === "execution-denied") {
2770
2759
  const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2771
- console.log("CALDEBUG [convertToOpenAIResponsesInput] Found execution-denied:", {
2772
- toolCallId: part.toolCallId,
2773
- toolName: part.toolName,
2774
- hasApprovalId: !!approvalId,
2775
- approvalId,
2776
- willSkip: !!approvalId
2777
- });
2778
- if (approvalId) {
2760
+ if (approvalId && !previousResponseId) {
2779
2761
  continue;
2780
2762
  }
2781
2763
  }
@@ -3831,6 +3813,18 @@ var openaiResponsesProviderOptionsSchema = lazySchema15(
3831
3813
  encrypted_content: z17.string()
3832
3814
  })
3833
3815
  ).optional(),
3816
+ /**
3817
+ * Server-side context management configuration.
3818
+ * When enabled with a compaction threshold, the server automatically compacts
3819
+ * the conversation in-stream when the rendered token count crosses the threshold.
3820
+ * @see https://developers.openai.com/api/docs/guides/compaction
3821
+ */
3822
+ contextManagement: z17.array(
3823
+ z17.object({
3824
+ type: z17.literal("compaction"),
3825
+ compact_threshold: z17.number()
3826
+ })
3827
+ ).optional(),
3834
3828
  /**
3835
3829
  * Whether the request contains tool approval responses.
3836
3830
  * Defaults to `false`.
@@ -4525,6 +4519,7 @@ var OpenAIResponsesLanguageModel = class {
4525
4519
  safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
4526
4520
  top_logprobs: topLogprobs,
4527
4521
  truncation: openaiOptions == null ? void 0 : openaiOptions.truncation,
4522
+ context_management: openaiOptions == null ? void 0 : openaiOptions.contextManagement,
4528
4523
  // model-specific settings:
4529
4524
  ...isReasoningModel && ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null) && {
4530
4525
  reasoning: {