Repository navigation
fix(ts): forward per-call hook options through predictBatch - #936
NandhaKishorM merged 1 commit into
Conversation
|
Merged, and this is the one of the two fixes for #935 that went in. What decided it: besides the composition at the dispatch site, this also forwards #943 does have two tests this does not, and they are worth having: a per-call Merge note: this conflicted with #929, which rewrote the same docblock. I kept #929's sentence about Verified on the merged tree: 654 TypeScript tests pass across 34 files, |
NandhaKishorM#943 raised two checks that NandhaKishorM#936 does not make, and both were kept on the record when it was closed in its favour. Neither is in `router-batch.test.ts` today: - the `true` direction of the per-call `hooksRaise` override, asserting the override is honoured when the router has raising off, rather than only that the `false` direction is; - the order of a per-call `onPredictStart` against a per-call `hooks` entry, which fails on a swapped `composeHooks` argument where a membership check passes either way. Test-only: no production code changes. The casts NandhaKishorM#943 carried are dropped, since NandhaKishorM#936 widened `PredictBatchOptions` and the callbacks are typed now.
What
TypeScript
Router.predictBatchandpredictManyacceptonPredictStart,onPredictEndandhooksRaise, and compose them the wayRouter.predictdoes.hooksRaisealso applies toonRoute. This is the TypeScript counterpart of the Pythonpredict_batchhook forwarding in #912.Why
predictBatchonly composedopts.hooksand always used the Router'shooksRaise, so a per-call start or end hook was dropped and a per-callhooksRaise: falsewas ignored.predictManyforwards topredictBatch, so it had the same gap.How it was verified
Vitest: 34 files, 632 passed.
tsc --noEmit: clean.python tests/test_router.py: 703 passed, 0 failed. Ruff: all checks passed.Checklist
mainFixes #935