openfox 2.0.0-beta.4 → 2.0.0-beta.6

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.
Files changed (50) hide show
  1. package/dist/{chat-handler-IUWEBZG7.js → chat-handler-27FY5TEH.js} +15 -29
  2. package/dist/{chunk-WBYS7AQN.js → chunk-3FFHHYWP.js} +178 -99
  3. package/dist/{chunk-HGAMIPFO.js → chunk-7FDY3EOH.js} +18 -176
  4. package/dist/{chunk-CEZNMLOO.js → chunk-7TTEGAO6.js} +12 -13
  5. package/dist/{chunk-FQLK5GL5.js → chunk-BVHFMAVN.js} +1 -1
  6. package/dist/{chunk-HW3U4XSZ.js → chunk-CDDMHSZF.js} +4 -4
  7. package/dist/{chunk-HHAJ3QF6.js → chunk-EMJGF3A7.js} +9 -24
  8. package/dist/{chunk-KEF4O3UM.js → chunk-FRCLNAE2.js} +2952 -3256
  9. package/dist/{chunk-RF2JGDSS.js → chunk-IGSZUXQP.js} +3 -3
  10. package/dist/{chunk-HLZV4S2I.js → chunk-NPHYEUYE.js} +127 -35
  11. package/dist/{chunk-NNEHZT3V.js → chunk-QUSUEN5R.js} +3 -3
  12. package/dist/{chunk-EYCCASW3.js → chunk-R3EK3ODJ.js} +6 -6
  13. package/dist/{chunk-7IKUIYFZ.js → chunk-RBJ25FIR.js} +135 -147
  14. package/dist/{chunk-PSJIT5LZ.js → chunk-RFNEDBVO.js} +4 -4
  15. package/dist/chunk-RI6GAMNP.js +13 -0
  16. package/dist/{chunk-26DZZZDC.js → chunk-XJEOP6XU.js} +5 -11
  17. package/dist/cli/dev.js +1 -1
  18. package/dist/cli/index.js +1 -1
  19. package/dist/compactor-TDNRM3A7.js +9 -0
  20. package/dist/{config-YU7NYZYG.js → config-VBBMTXJZ.js} +5 -6
  21. package/dist/{events-YO52472Q.js → events-PQ3KTI5H.js} +8 -8
  22. package/dist/{folding-K5L6M4WK.js → folding-CXORTBAU.js} +2 -3
  23. package/dist/{orchestrator-F75DNQKQ.js → orchestrator-QDCVUBCL.js} +18 -23
  24. package/dist/package.json +1 -1
  25. package/dist/{processor-FTEASNGS.js → processor-K4B7QRO2.js} +8 -10
  26. package/dist/{protocol-K62EPEGS.js → protocol-CN24IKQN.js} +3 -5
  27. package/dist/{protocol-BQ12Aw5J.d.ts → protocol-De-Pzgry.d.ts} +12 -38
  28. package/dist/{provider-HTJEB3ON.js → provider-NRWSSO55.js} +9 -10
  29. package/dist/{serve-CEQ2QMM5.js → serve-J6EM3G6N.js} +25 -27
  30. package/dist/server/index.d.ts +1 -6
  31. package/dist/server/index.js +15 -17
  32. package/dist/{settings-VRAOAPLA.js → settings-6XX56F3F.js} +2 -2
  33. package/dist/shared/index.d.ts +2 -2
  34. package/dist/shared/index.js +1 -1
  35. package/dist/{tools-OPEU2E5M.js → tools-GCANYSB7.js} +12 -15
  36. package/dist/web/assets/{index-bDyDeCAz.css → index-aa3jRAZ9.css} +2 -2
  37. package/dist/web/assets/index-ntDiC8b_.js +299 -0
  38. package/dist/web/index.html +2 -2
  39. package/dist/web/sw.js +1 -1
  40. package/dist/workflow-defaults/default.workflow.json +3 -3
  41. package/package.json +1 -1
  42. package/dist/auto-compaction-A3PIMGLF.js +0 -28
  43. package/dist/chunk-CGZHLM3K.js +0 -70
  44. package/dist/chunk-MCPID4EJ.js +0 -28
  45. package/dist/chunk-SZKEGZIB.js +0 -140
  46. package/dist/optimize-storage-2N6BY5KZ.js +0 -7
  47. package/dist/runtime-config-NPSPMRDA.js +0 -9
  48. package/dist/vision-fallback-3MIZZ6NQ.js +0 -22
  49. package/dist/web/assets/index-ZTEHxmVW.js +0 -317
  50. /package/dist/web/{workbox-7fc22fbe.js → workbox-8c29f6e4.js} +0 -0
@@ -1,6 +1,3 @@
1
- import {
2
- describeImageFromDataUrl
3
- } from "./chunk-SZKEGZIB.js";
4
1
  import {
5
2
  logger
6
3
  } from "./chunk-K44MW7JJ.js";
@@ -362,6 +359,9 @@ function getModelProfile(modelName) {
362
359
  }
363
360
  return DEFAULT_PROFILE;
364
361
  }
362
+ function modelSupportsVision(modelName) {
363
+ return getModelProfile(modelName).supportsVision;
364
+ }
365
365
 
366
366
  // src/server/llm/client-pure.ts
367
367
  function buildModelParams(params) {
@@ -372,27 +372,16 @@ function buildModelParams(params) {
372
372
  ...params.maxTokens !== void 0 && { maxTokens: params.maxTokens }
373
373
  };
374
374
  }
375
- function buildAttachmentContent(msgContent, attachments, modelSupportsVision) {
375
+ function buildAttachmentContent(msgContent, attachments, modelSupportsVision2) {
376
376
  const content = [];
377
377
  if (msgContent?.trim()) {
378
378
  content.push({ type: "text", text: msgContent });
379
379
  }
380
380
  for (const attachment of attachments) {
381
- content.push(convertAttachmentSync(attachment, modelSupportsVision));
381
+ content.push(convertAttachmentSync(attachment, modelSupportsVision2));
382
382
  }
383
383
  return content;
384
384
  }
385
- async function convertMessagesWithOptions(messages, profile, visionFallbackEnabled, userVisionOverride, signal, onVisionFallbackStart, onVisionFallbackDone) {
386
- const modelSupportsVision = userVisionOverride ?? profile.supportsVision ?? false;
387
- const options = {
388
- modelSupportsVision,
389
- visionFallbackEnabled,
390
- signal,
391
- onVisionFallbackStart,
392
- onVisionFallbackDone
393
- };
394
- return needsVisionFallback(messages, modelSupportsVision, visionFallbackEnabled) ? await convertMessagesWithFallback(messages, options) : convertMessages(messages, { modelSupportsVision, visionFallbackEnabled: false });
395
- }
396
385
  function convertToolCalls(toolCalls) {
397
386
  return toolCalls.map((toolCall) => ({
398
387
  id: toolCall.id,
@@ -416,8 +405,8 @@ function buildAssistantMessage(msg) {
416
405
  }
417
406
  return result;
418
407
  }
419
- function convertAttachmentSync(attachment, modelSupportsVision) {
420
- if (modelSupportsVision) {
408
+ function convertAttachmentSync(attachment, modelSupportsVision2) {
409
+ if (modelSupportsVision2) {
421
410
  return {
422
411
  type: "image_url",
423
412
  image_url: { url: attachment.data }
@@ -428,68 +417,14 @@ function convertAttachmentSync(attachment, modelSupportsVision) {
428
417
  text: `[Image: ${attachment.filename || "image"}] (vision not supported, cannot describe)`
429
418
  };
430
419
  }
431
- function createAttachmentForConversion(data, filename, id) {
432
- return {
433
- data,
434
- ...filename !== void 0 && { filename },
435
- ...id !== void 0 && { id }
436
- };
437
- }
438
- async function convertAttachmentWithFallback(attachment, options) {
439
- logger.debug("[VisionFallback] convertAttachmentWithFallback called", {
440
- filename: attachment.filename,
441
- id: attachment.id,
442
- hasCallbacks: !!options.onVisionFallbackStart
443
- });
444
- if (options.modelSupportsVision) {
445
- logger.debug("[VisionFallback] Model supports vision - passing image directly");
446
- return {
447
- type: "image_url",
448
- image_url: { url: attachment.data }
449
- };
450
- }
451
- if (!options.visionFallbackEnabled) {
452
- logger.debug("[VisionFallback] Fallback disabled - returning placeholder");
453
- return {
454
- type: "text",
455
- text: `[Image: ${attachment.filename || "image"}] (vision not supported)`
456
- };
457
- }
458
- const attachmentId = attachment.id ?? crypto.randomUUID();
459
- const filename = attachment.filename;
460
- logger.debug("[VisionFallback] Starting delegation for:", { attachmentId, filename });
461
- options.onVisionFallbackStart?.(attachmentId, filename);
462
- const context = filename ? `File: ${filename}` : void 0;
463
- const description = await describeImageFromDataUrl(attachment.data, { context, signal: options.signal });
464
- logger.debug("[VisionFallback] Delegation complete:", { attachmentId, descriptionLength: description.length });
465
- options.onVisionFallbackDone?.(attachmentId, description);
466
- return {
467
- type: "text",
468
- text: `[Image: ${attachment.filename || "image"}] ${description}`
469
- };
470
- }
471
- async function buildAttachmentContentWithFallback(msgContent, attachments, options) {
472
- const content = [];
473
- if (msgContent?.trim()) {
474
- content.push({ type: "text", text: msgContent });
475
- }
476
- for (const attachment of attachments) {
477
- const convertedContent = await convertAttachmentWithFallback(
478
- createAttachmentForConversion(attachment.data, attachment.filename, attachment.id),
479
- options
480
- );
481
- content.push(convertedContent);
482
- }
483
- return content;
484
- }
485
- function convertMessages(messages, options) {
420
+ function convertMessages(messages, modelSupportsVision2) {
486
421
  const filtered = messages.filter((msg) => {
487
422
  return !(msg.role === "assistant" && !msg.content?.trim() && (!msg.toolCalls || msg.toolCalls.length === 0));
488
423
  });
489
424
  return filtered.map((msg) => {
490
425
  if (msg.role === "tool") {
491
426
  if (msg.attachments && msg.attachments.length > 0) {
492
- const content = buildAttachmentContent(msg.content, msg.attachments, options.modelSupportsVision);
427
+ const content = buildAttachmentContent(msg.content, msg.attachments, modelSupportsVision2);
493
428
  return {
494
429
  role: "tool",
495
430
  content,
@@ -506,7 +441,7 @@ function convertMessages(messages, options) {
506
441
  return buildAssistantMessage(msg);
507
442
  }
508
443
  if (msg.role === "user" && msg.attachments && msg.attachments.length > 0) {
509
- const content = buildAttachmentContent(msg.content, msg.attachments, options.modelSupportsVision);
444
+ const content = buildAttachmentContent(msg.content, msg.attachments, modelSupportsVision2);
510
445
  return {
511
446
  role: "user",
512
447
  content
@@ -518,49 +453,6 @@ function convertMessages(messages, options) {
518
453
  };
519
454
  });
520
455
  }
521
- async function convertMessagesWithFallback(messages, options) {
522
- logger.debug("[VisionFallback] convertMessagesWithFallback called", { messageCount: messages.length });
523
- const filtered = messages.filter((msg) => {
524
- return !(msg.role === "assistant" && !msg.content?.trim() && (!msg.toolCalls || msg.toolCalls.length === 0));
525
- });
526
- const converted = [];
527
- for (const msg of filtered) {
528
- if (msg.role === "tool") {
529
- if (msg.attachments && msg.attachments.length > 0) {
530
- const content = await buildAttachmentContentWithFallback(msg.content, msg.attachments, options);
531
- converted.push({
532
- role: "tool",
533
- content,
534
- tool_call_id: msg.toolCallId
535
- });
536
- } else {
537
- converted.push({
538
- role: "tool",
539
- content: msg.content,
540
- tool_call_id: msg.toolCallId
541
- });
542
- }
543
- continue;
544
- }
545
- if (msg.role === "assistant") {
546
- converted.push(buildAssistantMessage(msg));
547
- continue;
548
- }
549
- if (msg.role === "user" && msg.attachments && msg.attachments.length > 0) {
550
- const content = await buildAttachmentContentWithFallback(msg.content, msg.attachments, options);
551
- converted.push({
552
- role: "user",
553
- content
554
- });
555
- continue;
556
- }
557
- converted.push({
558
- role: msg.role,
559
- content: msg.content
560
- });
561
- }
562
- return converted;
563
- }
564
456
  function convertTools(tools) {
565
457
  return tools.map((tool) => ({
566
458
  type: "function",
@@ -571,30 +463,10 @@ function convertTools(tools) {
571
463
  }
572
464
  }));
573
465
  }
574
- function needsVisionFallback(messages, modelSupportsVision, visionFallbackEnabled) {
575
- const hasAttachments = messages.some(
576
- (msg) => msg.attachments && msg.attachments.length > 0 || msg.role === "tool" && msg.attachments && msg.attachments.length > 0
577
- );
578
- const result = hasAttachments && !modelSupportsVision && visionFallbackEnabled;
579
- logger.debug("[VisionFallback] needsVisionFallback check", {
580
- hasAttachments,
581
- modelSupportsVision,
582
- visionFallbackEnabled,
583
- result
584
- });
585
- return result;
586
- }
587
- async function buildChatCompletionCreateParams(model, request, profile, capabilities, disableThinking, visionFallbackEnabled, isStreaming, onVisionFallbackStart, onVisionFallbackDone) {
466
+ async function buildChatCompletionCreateParams(model, request, profile, capabilities, disableThinking, isStreaming) {
588
467
  const userVisionOverride = request.modelSettings?.supportsVision;
589
- const convertedMessages = await convertMessagesWithOptions(
590
- request.messages,
591
- profile,
592
- visionFallbackEnabled,
593
- userVisionOverride,
594
- request.signal,
595
- onVisionFallbackStart,
596
- onVisionFallbackDone
597
- );
468
+ const modelSupportsVision2 = userVisionOverride ?? profile.supportsVision ?? false;
469
+ const convertedMessages = convertMessages(request.messages, modelSupportsVision2);
598
470
  const temperature = request.modelSettings?.temperature ?? request.temperature ?? profile.temperature;
599
471
  const maxTokens = request.modelSettings?.maxTokens ?? request.maxTokens ?? profile.defaultMaxTokens;
600
472
  const topP = request.modelSettings?.topP ?? profile.topP;
@@ -623,26 +495,14 @@ async function buildChatCompletionCreateParams(model, request, profile, capabili
623
495
  return { params, modelParams };
624
496
  }
625
497
  async function buildCreateParamsFromInput(input, isStreaming) {
626
- const {
627
- model,
628
- request,
629
- profile,
630
- capabilities,
631
- disableThinking,
632
- visionFallbackEnabled = false,
633
- onVisionFallbackStart,
634
- onVisionFallbackDone
635
- } = input;
498
+ const { model, request, profile, capabilities, disableThinking } = input;
636
499
  return buildChatCompletionCreateParams(
637
500
  model,
638
501
  request,
639
502
  profile,
640
503
  capabilities,
641
504
  !!disableThinking,
642
- visionFallbackEnabled,
643
- isStreaming,
644
- onVisionFallbackStart,
645
- onVisionFallbackDone
505
+ isStreaming
646
506
  );
647
507
  }
648
508
  var buildNonStreamingCreateParams = (input) => buildCreateParamsFromInput(input, false);
@@ -677,13 +537,7 @@ function extractThinking(content) {
677
537
  }
678
538
 
679
539
  // src/server/llm/streaming.ts
680
- var XML_TOOL_PATTERNS = ["<tool_call>", "<function=", "</tool_call>", "<parameter="];
681
- function hasXmlToolPattern(text) {
682
- return XML_TOOL_PATTERNS.some((p) => text.includes(p));
683
- }
684
540
  async function* streamWithSegments(client, request) {
685
- const xmlAbortController = new AbortController();
686
- const combinedSignal = request.signal ? AbortSignal.any([request.signal, xmlAbortController.signal]) : xmlAbortController.signal;
687
541
  let content = "";
688
542
  let thinkingContent = "";
689
543
  let response = null;
@@ -705,7 +559,7 @@ async function* streamWithSegments(client, request) {
705
559
  currentThinkingSegment = "";
706
560
  };
707
561
  try {
708
- for await (const event of client.stream({ ...request, signal: combinedSignal })) {
562
+ for await (const event of client.stream(request)) {
709
563
  switch (event.type) {
710
564
  case "text_delta":
711
565
  if (firstTokenTime === null) {
@@ -714,11 +568,6 @@ async function* streamWithSegments(client, request) {
714
568
  flushThinking();
715
569
  content += event.content;
716
570
  currentTextSegment += event.content;
717
- if (!request.disableXmlProtection && hasXmlToolPattern(content)) {
718
- xmlAbortController.abort();
719
- yield { type: "xml_tool_abort" };
720
- return null;
721
- }
722
571
  yield { type: "text_delta", content: event.content };
723
572
  break;
724
573
  case "thinking_delta":
@@ -728,11 +577,6 @@ async function* streamWithSegments(client, request) {
728
577
  flushText();
729
578
  thinkingContent += event.content;
730
579
  currentThinkingSegment += event.content;
731
- if (!request.disableXmlProtection && hasXmlToolPattern(thinkingContent)) {
732
- xmlAbortController.abort();
733
- yield { type: "xml_tool_abort" };
734
- return null;
735
- }
736
580
  yield { type: "thinking_delta", content: event.content };
737
581
  break;
738
582
  case "tool_call_delta":
@@ -756,9 +600,6 @@ async function* streamWithSegments(client, request) {
756
600
  }
757
601
  }
758
602
  } catch (error) {
759
- if (error instanceof Error && error.name === "AbortError") {
760
- return null;
761
- }
762
603
  yield { type: "error", error: error instanceof Error ? error.message : "Unknown error" };
763
604
  return null;
764
605
  }
@@ -791,6 +632,7 @@ async function* streamWithSegments(client, request) {
791
632
 
792
633
  export {
793
634
  getModelProfile,
635
+ modelSupportsVision,
794
636
  getBackendCapabilities,
795
637
  detectBackend,
796
638
  getBackendDisplayName,
@@ -801,4 +643,4 @@ export {
801
643
  extractThinking,
802
644
  streamWithSegments
803
645
  };
804
- //# sourceMappingURL=chunk-HGAMIPFO.js.map
646
+ //# sourceMappingURL=chunk-7FDY3EOH.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createServerMessage,
3
3
  isClientMessage
4
- } from "./chunk-FQLK5GL5.js";
4
+ } from "./chunk-BVHFMAVN.js";
5
5
 
6
6
  // src/server/ws/protocol.ts
7
7
  function enrichMessagesWithToolResults(messages) {
@@ -94,8 +94,14 @@ function createChatTodoMessage(todos) {
94
94
  function createChatProgressMessage(message, phase) {
95
95
  return createServerMessage("chat.progress", { message, ...phase ? { phase } : {} });
96
96
  }
97
- function createChatFormatRetryMessage(attempt, maxAttempts) {
98
- return createServerMessage("chat.format_retry", { attempt, maxAttempts });
97
+ function createChatFormatRetryMessage(attempt, maxAttempts, pattern, field, matchedContent) {
98
+ return createServerMessage("chat.format_retry", {
99
+ attempt,
100
+ maxAttempts,
101
+ ...pattern !== void 0 ? { pattern } : {},
102
+ ...field !== void 0 ? { field } : {},
103
+ ...matchedContent !== void 0 ? { matchedContent } : {}
104
+ });
99
105
  }
100
106
  function createChatMessageMessage(message) {
101
107
  return createServerMessage("chat.message", { message });
@@ -120,9 +126,6 @@ function createChatPathConfirmationMessage(callId, tool, paths, workdir, reason)
120
126
  function createChatAskUserMessage(callId, question) {
121
127
  return createServerMessage("chat.ask_user", { callId, question });
122
128
  }
123
- function createChatVisionFallbackMessage(payload) {
124
- return createServerMessage("chat.vision_fallback", payload);
125
- }
126
129
  function createModeChangedMessage(mode, auto, reason) {
127
130
  return createServerMessage("mode.changed", { mode, auto, ...reason ? { reason } : {} });
128
131
  }
@@ -198,9 +201,6 @@ function storedEventToServerMessage(event) {
198
201
  if (data.stats) {
199
202
  updates.stats = data.stats;
200
203
  }
201
- if (data.promptContext) {
202
- updates.promptContext = data.promptContext;
203
- }
204
204
  return createChatMessageUpdatedMessage(data.messageId, updates);
205
205
  }
206
206
  case "tool.preparing": {
@@ -283,9 +283,9 @@ function storedEventToServerMessage(event) {
283
283
  const data = event.data;
284
284
  return createChatAskUserMessage(data.callId, data.question);
285
285
  }
286
- case "format.retry": {
286
+ case "pattern.retry": {
287
287
  const data = event.data;
288
- return createChatFormatRetryMessage(data.attempt, data.maxAttempts);
288
+ return createChatFormatRetryMessage(data.attempt, data.maxAttempts, data.pattern, data.field, data.matchedContent);
289
289
  }
290
290
  case "turn.snapshot":
291
291
  case "context.compacted":
@@ -320,7 +320,6 @@ export {
320
320
  createChatErrorMessage,
321
321
  createChatPathConfirmationMessage,
322
322
  createChatAskUserMessage,
323
- createChatVisionFallbackMessage,
324
323
  createModeChangedMessage,
325
324
  createPhaseChangedMessage,
326
325
  createCriteriaUpdatedMessage,
@@ -334,4 +333,4 @@ export {
334
333
  createQueueStateMessage,
335
334
  storedEventToServerMessage
336
335
  };
337
- //# sourceMappingURL=chunk-CEZNMLOO.js.map
336
+ //# sourceMappingURL=chunk-7TTEGAO6.js.map
@@ -26,4 +26,4 @@ export {
26
26
  isClientMessage,
27
27
  isServerMessage
28
28
  };
29
- //# sourceMappingURL=chunk-FQLK5GL5.js.map
29
+ //# sourceMappingURL=chunk-BVHFMAVN.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-HLZV4S2I.js";
4
+ } from "./chunk-NPHYEUYE.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-26DZZZDC.js";
8
+ } from "./chunk-XJEOP6XU.js";
9
9
  import {
10
10
  createContextStateMessage,
11
11
  createSessionStateMessage
12
- } from "./chunk-CEZNMLOO.js";
12
+ } from "./chunk-7TTEGAO6.js";
13
13
  import {
14
14
  logger
15
15
  } from "./chunk-K44MW7JJ.js";
@@ -143,4 +143,4 @@ export {
143
143
  needsNameGenerationCheck,
144
144
  applyGeneratedSessionName
145
145
  };
146
- //# sourceMappingURL=chunk-HW3U4XSZ.js.map
146
+ //# sourceMappingURL=chunk-CDDMHSZF.js.map
@@ -5,10 +5,7 @@ import {
5
5
  getBackendCapabilities,
6
6
  getModelProfile,
7
7
  mapFinishReason
8
- } from "./chunk-HGAMIPFO.js";
9
- import {
10
- ensureVisionFallbackConfigLoaded
11
- } from "./chunk-SZKEGZIB.js";
8
+ } from "./chunk-7FDY3EOH.js";
12
9
  import {
13
10
  logger
14
11
  } from "./chunk-K44MW7JJ.js";
@@ -187,23 +184,13 @@ function createLLMClient(config, initialBackend = "unknown") {
187
184
  });
188
185
  try {
189
186
  const shouldDisableThinking = disableThinking || request.disableThinking === true;
190
- await ensureVisionFallbackConfigLoaded();
191
- const { isVisionFallbackEnabled } = await import("./vision-fallback-3MIZZ6NQ.js");
192
- const paramsOptions = {
187
+ const { params: createParams } = await buildNonStreamingCreateParams({
193
188
  model,
194
189
  request,
195
190
  profile,
196
191
  capabilities,
197
- disableThinking: shouldDisableThinking,
198
- visionFallbackEnabled: isVisionFallbackEnabled()
199
- };
200
- if (request.onVisionFallbackStart) {
201
- paramsOptions.onVisionFallbackStart = request.onVisionFallbackStart;
202
- }
203
- if (request.onVisionFallbackDone) {
204
- paramsOptions.onVisionFallbackDone = request.onVisionFallbackDone;
205
- }
206
- const { params: createParams } = await buildNonStreamingCreateParams(paramsOptions);
192
+ disableThinking: shouldDisableThinking
193
+ });
207
194
  const response = await openai.chat.completions.create(createParams, {
208
195
  signal: request.signal
209
196
  });
@@ -264,18 +251,13 @@ function createLLMClient(config, initialBackend = "unknown") {
264
251
  idleTimeout
265
252
  });
266
253
  try {
267
- await ensureVisionFallbackConfigLoaded();
268
- const { isVisionFallbackEnabled } = await import("./vision-fallback-3MIZZ6NQ.js");
269
254
  const shouldDisableThinking = disableThinking || request.disableThinking === true;
270
255
  const createParams = await buildStreamingCreateParams({
271
256
  model,
272
257
  request,
273
258
  profile,
274
259
  capabilities,
275
- disableThinking: shouldDisableThinking,
276
- visionFallbackEnabled: isVisionFallbackEnabled(),
277
- onVisionFallbackStart: request.onVisionFallbackStart,
278
- onVisionFallbackDone: request.onVisionFallbackDone
260
+ disableThinking: shouldDisableThinking
279
261
  });
280
262
  const { params: streamingParams } = createParams;
281
263
  const stream = await openai.chat.completions.create(streamingParams, {
@@ -298,6 +280,8 @@ function createLLMClient(config, initialBackend = "unknown") {
298
280
  idleTimeoutController.abort();
299
281
  }
300
282
  }, 100);
283
+ const onAbort = () => clearInterval(idleTimer);
284
+ request.signal?.addEventListener("abort", onAbort, { once: true });
301
285
  try {
302
286
  for await (const chunk of stream) {
303
287
  if (idleTimeoutController.signal.aborted) {
@@ -412,6 +396,7 @@ function createLLMClient(config, initialBackend = "unknown") {
412
396
  }
413
397
  } finally {
414
398
  clearInterval(idleTimer);
399
+ request.signal?.removeEventListener("abort", onAbort);
415
400
  }
416
401
  if (tagBuffer) {
417
402
  if (inThinking) {
@@ -478,4 +463,4 @@ export {
478
463
  getLlmStatus,
479
464
  clearModelCache
480
465
  };
481
- //# sourceMappingURL=chunk-HHAJ3QF6.js.map
466
+ //# sourceMappingURL=chunk-EMJGF3A7.js.map