Port abort support into the core ONNX provider chat function #6

Open
opened 2026-10-02 07:27:22 +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, the token callback that chat hands to the pipeline never calls onToken.
  3. With no signal, the token callback that chat hands to the pipeline calls onToken for every token.

Files

  • core/providers/onnx.js

T2T-Issue: 0xd1cda24c0d6e7d6e826be27c66ca2ab6978d48caa832bcbde6c2777e97ea09ba
Number: 3
Kind: improvement
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 324

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`, the token callback that `chat` hands to the pipeline never calls `onToken`. 3. With no `signal`, the token callback that `chat` hands to the pipeline calls `onToken` for every token. ### Files - `core/providers/onnx.js` --- T2T-Issue: 0xd1cda24c0d6e7d6e826be27c66ca2ab6978d48caa832bcbde6c2777e97ea09ba Number: 3 Kind: improvement Origin: imported Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919 Ledger: elffuss/ledger, event 324
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: elffuss/core#6