Startup crash compiling a PyArmor-obfuscated workflow with LangGraph 1.2.12+

Hi LangGraph team,

We observed a startup regression in a Linux container using Python 3.12.16 and PyArmor 8.5.11. With the same PyArmor version, the workflow compiles and the app starts on LangGraph 1.2.11. With 1.2.12–1.2.14, the process exits with code 139 during workflow compilation. We also observed the crash on 1.2.24. Pinning 1.2.11 restored startup in our rebuilt deployment.

We expected the workflow to compile or return a Python error if the callable couldn’t be inspected. Instead, Python’s fault handler placed the crash in bytecode inspection of an obfuscated workflow callable during graph compilation.

The first failing release, 1.2.12, includes PR #8569, which changed automatic subgraph detection to use bytecode inspection. That matches the failure path we observed. Could you review the automatic subgraph detection path introduced there and advise whether there is a supported way to register the subgraph explicitly or opt out of inspection for this callable? We need to keep our PyArmor version unchanged.

LangGraph 1.2.12 release · PR #8569

Hey @waiz-ksolves
Thanks for narrowing it down to 1.2.12, your read on #8569 is right.

Before 1.2.12, LangGraph read each node’s source code to look for subgraphs. With PyArmor that just failed quietly and compile kept going. Now it reads the function’s bytecode instead, and PyArmor’s bytecode crashes it outright. That’s the exit 139 you’re seeing.

There’s no setting to turn this off right now. A few ways around it:

  1. Stay on 1.2.11 for now.
  2. Wrap the node so it’s not a plain function, like builder.add_node("my_node", functools.partial(my_node)). LangGraph skips those. If that node calls a subgraph, you’ll lose that subgraph’s checkpoints and streaming.
  3. If a node just calls a subgraph, add the compiled subgraph as the node directly: Subgraphs - Docs by LangChain
  4. Don’t obfuscate the files that define your nodes, if that’s an option.

I’ll raise this with the team.