AIX: CSF Dispatch: remove unsafe transforms that the client does not support

This commit is contained in:
Enrico Ros
2026-04-16 04:08:26 -07:00
parent f76524c650
commit ef84ca5a04
@@ -30,7 +30,12 @@ export async function* clientSideChatGenerate(
): AsyncGenerator<AixWire_Particles.ChatGenerateOp, void> {
// keep in sync with the `aixRouter.chatGenerateContent` server-side procedure
const _d: AixDebugObject = _createClientDebugConfig(access, connectionOptions, context.name);
const chatGenerateDispatchCreator = () => createChatGenerateDispatch(access, model, chatGenerate, streaming, !!connectionOptions?.enableResumability);
const chatGenerateDispatchCreator = () => createChatGenerateDispatch(access, model, chatGenerate, streaming, !!connectionOptions?.enableResumability)
.then(dispatch => {
// [CSF-Only] Client-side transform stripping - remove any dispatch transforms that are tagged as csfUnsafe (e.g. for CORS reasons)
if (dispatch.particleTransform?.csfUnsafe) dispatch.particleTransform = undefined;
return dispatch;
});
yield* executeChatGenerateWithContinuation(chatGenerateDispatchCreator, streaming, abortSignal, _d);
}