@zenning/openai 3.0.23 → 3.0.25

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,10 +2500,23 @@ 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
+ });
2503
2510
  if (compactionInput && compactionInput.length > 0) {
2504
2511
  input.push(...compactionInput);
2505
2512
  }
2506
2513
  for (const { role, content } of prompt) {
2514
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing message:", {
2515
+ role,
2516
+ isString: typeof content === "string",
2517
+ partsCount: typeof content === "string" ? 0 : content.length,
2518
+ partTypes: typeof content === "string" ? [] : content.map((p) => p.type)
2519
+ });
2507
2520
  switch (role) {
2508
2521
  case "system": {
2509
2522
  switch (systemMessageMode) {
@@ -2734,6 +2747,10 @@ async function convertToOpenAIResponsesInput({
2734
2747
  break;
2735
2748
  }
2736
2749
  case "tool": {
2750
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing tool role message:", {
2751
+ partsCount: content.length,
2752
+ partTypes: content.map((p) => p.type)
2753
+ });
2737
2754
  for (const part of content) {
2738
2755
  if (part.type === "tool-approval-response") {
2739
2756
  const approvalResponse = part;
@@ -2757,6 +2774,13 @@ async function convertToOpenAIResponsesInput({
2757
2774
  const output = part.output;
2758
2775
  if (output.type === "execution-denied") {
2759
2776
  const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2777
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Found execution-denied:", {
2778
+ toolCallId: part.toolCallId,
2779
+ toolName: part.toolName,
2780
+ hasApprovalId: !!approvalId,
2781
+ approvalId,
2782
+ willSkip: !!approvalId
2783
+ });
2760
2784
  if (approvalId) {
2761
2785
  continue;
2762
2786
  }
@@ -2866,6 +2890,15 @@ async function convertToOpenAIResponsesInput({
2866
2890
  }
2867
2891
  }
2868
2892
  }
2893
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Final input:", {
2894
+ inputLength: input.length,
2895
+ inputTypes: input.map((item) => item.type || item.role),
2896
+ hasItemReferences: input.some((item) => item.type === "item_reference"),
2897
+ itemReferences: input.filter((item) => item.type === "item_reference").map((item) => ({
2898
+ type: item.type,
2899
+ id: typeof item.id === "string" ? item.id.substring(0, 20) + "..." : item.id
2900
+ }))
2901
+ });
2869
2902
  return { input, warnings };
2870
2903
  }
2871
2904
  var openaiResponsesReasoningProviderOptionsSchema = z15.object({