@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.
@@ -2479,10 +2479,23 @@ 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
+ });
2482
2489
  if (compactionInput && compactionInput.length > 0) {
2483
2490
  input.push(...compactionInput);
2484
2491
  }
2485
2492
  for (const { role, content } of prompt) {
2493
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing message:", {
2494
+ role,
2495
+ isString: typeof content === "string",
2496
+ partsCount: typeof content === "string" ? 0 : content.length,
2497
+ partTypes: typeof content === "string" ? [] : content.map((p) => p.type)
2498
+ });
2486
2499
  switch (role) {
2487
2500
  case "system": {
2488
2501
  switch (systemMessageMode) {
@@ -2713,6 +2726,10 @@ async function convertToOpenAIResponsesInput({
2713
2726
  break;
2714
2727
  }
2715
2728
  case "tool": {
2729
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing tool role message:", {
2730
+ partsCount: content.length,
2731
+ partTypes: content.map((p) => p.type)
2732
+ });
2716
2733
  for (const part of content) {
2717
2734
  if (part.type === "tool-approval-response") {
2718
2735
  const approvalResponse = part;
@@ -2736,6 +2753,13 @@ async function convertToOpenAIResponsesInput({
2736
2753
  const output = part.output;
2737
2754
  if (output.type === "execution-denied") {
2738
2755
  const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2756
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Found execution-denied:", {
2757
+ toolCallId: part.toolCallId,
2758
+ toolName: part.toolName,
2759
+ hasApprovalId: !!approvalId,
2760
+ approvalId,
2761
+ willSkip: !!approvalId
2762
+ });
2739
2763
  if (approvalId) {
2740
2764
  continue;
2741
2765
  }
@@ -2845,6 +2869,15 @@ async function convertToOpenAIResponsesInput({
2845
2869
  }
2846
2870
  }
2847
2871
  }
2872
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Final input:", {
2873
+ inputLength: input.length,
2874
+ inputTypes: input.map((item) => item.type || item.role),
2875
+ hasItemReferences: input.some((item) => item.type === "item_reference"),
2876
+ itemReferences: input.filter((item) => item.type === "item_reference").map((item) => ({
2877
+ type: item.type,
2878
+ id: typeof item.id === "string" ? item.id.substring(0, 20) + "..." : item.id
2879
+ }))
2880
+ });
2848
2881
  return { input, warnings };
2849
2882
  }
2850
2883
  var openaiResponsesReasoningProviderOptionsSchema = import_v415.z.object({