Add abort support to the core ONNX provider chat function #7

Open
opened 2026-10-02 08:04:36 +00:00 by elffuss-bot · 0 comments
Owner

The product copy of the ONNX provider takes a fourth argument signal and stops calling the token callback once the signal is aborted. The core copy of chat in core/providers/onnx.js has only three parameters, so a product that vendors the core loses the stop button for this provider. Why it matters: The core is the source the products vendor from; if it lacks the fix, the next sync removes abort support from the products.

Proposal

Give chat a fourth parameter signal = null and wrap the pipeline token callback so onToken is not called after signal?.aborted is true.

Acceptance criteria

  1. The chat function of core/providers/onnx.js declares a fourth parameter named signal with default null.
  2. With an aborted signal, chat never calls onToken, and with no signal it still calls onToken for every token.

Files

  • core/providers/onnx.js

T2T-Issue: 0xc061cbad52bed8ff95a90bbe778649684057e759d44b433dc318f7ba7fae0636
Number: 4
Kind: improvement
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 481

The product copy of the ONNX provider takes a fourth argument `signal` and stops calling the token callback once the signal is aborted. The core copy of `chat` in core/providers/onnx.js has only three parameters, so a product that vendors the core loses the stop button for this provider. Why it matters: The core is the source the products vendor from; if it lacks the fix, the next sync removes abort support from the products. ### Proposal Give `chat` a fourth parameter `signal = null` and wrap the pipeline token callback so `onToken` is not called after `signal?.aborted` is true. ### Acceptance criteria 1. The `chat` function of core/providers/onnx.js declares a fourth parameter named `signal` with default `null`. 2. With an aborted `signal`, `chat` never calls `onToken`, and with no `signal` it still calls `onToken` for every token. ### Files - `core/providers/onnx.js` --- T2T-Issue: 0xc061cbad52bed8ff95a90bbe778649684057e759d44b433dc318f7ba7fae0636 Number: 4 Kind: improvement Origin: imported Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919 Ledger: elffuss/ledger, event 481
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: elffuss/core#7