# n8n AI Agent node fails with "Cannot read properties of null (reading 'length')" after upgrade to 1.103.1
## What was going on
After upgrading to n8n 1.103.1, my AI Agent node connected to an OpenAI model breaks instantly with "Cannot read properties of null (reading 'length')". The exact same workflow ran fine on 1.102.4. The error pops up as soon as I add the AI Agent node and hook it up to OpenAI. Reinstalling did not help. Is this a known regression?
## The fix that worked
Yes, this was a regression. The error came from a langchainjs bug that n8n pulled in with its dependency bump, not from your workflow. It was fixed upstream in langchainjs v0.3.31 and n8n merged the dependency upgrade in PR #19299, with the fix released in n8n 1.112.0. So the fix is simply to update to 1.112.0 or newer. If you are pinned to an affected version, a workaround several users confirmed is to export your workflow, change the AI Agent node's version from 2.2 to 1.9, and re-import it. Note the trade-off: the 1.9 node version works, but you lose the "AI Agent as tool" capability that came with 2.2, so updating the n8n version is the cleaner fix.
## Where this came from
https://github.com/n8n-io/n8n/issues/17522