Cannot use httpAction to send langgraph streaming events
httpAction to build an api for streaming events that produced by langgraph.js, below is what I do and errors I had encountered:1. First, I made a very simple demo, only produce stream events by using langchain's openai model provider, is works fine
2. Next, I wrote a relative complex langgraph agent (I'm sure it works), this time convex throw an error to inform using "use node"
3. Since
httpAction does not allow "use node", I extract all agent codes into a internal action4. Then I invoke this internal action in
httpAction to get the stream, and I saw this error:It seems like I can't return a
IterableReadableStreamWithAbortSignal object (which generated by langgraphagent.streamEvents method) through internalAction? What can I do to make it work?UPDATE: After a step-by-step debug, I can confirm the problem is caused by this line:
If I put this line in the
httpAction, it errors because it depends on "node:async_hooks" which requires using "use node" directiveIf I move this line to an
internalAction and return the result, Convex will complain CompiledStateGraph is not a supported Convex typeI was trapped at this step, anyone can help me out?
