Difference in tool output limit in Node SDK and Python SDK

We are using Node SDK, Assistant APIs with Function Calling , while returning the tool output we observed following error logs, surprisingly Python SDK does not throw errror in same case and works fine:

{
“stack”: " at APIError.generate (index.js:236:14)\n at OpenAI.makeStatusError (index.js:983:21)\n at OpenAI.makeRequest (index.js:1026:24)\n at async checkRunStatus (index.js:6549:27)\n at async oaiGetResponseFromAssistant (index.js:6510:18)\n at async index.js:6870:40",
“name”: “Error”,
“message”: “400 ‘tool_outputs’ too large: the combined tool outputs must be less than 512kb.”,
“timestamp”: 1715296813184
}

{
“stack”: " at APIError.generate (index.js:236:14)\n at OpenAI.makeStatusError (index.js:983:21)\n at OpenAI.makeRequest (index.js:1026:24)\n at async checkRunStatus (index.js:6549:27)\n at async checkRunStatus (index.js:6556:16)\n at async oaiGetResponseFromAssistant (index.js:6510:18)\n at async pushMessageToThreadHandler3 (index.js:6703:30)\n at async Object.fetch (index.js:7017:20)",
“name”: “Error”,
“message”: “400 ‘tool_outputs’ too large: the combined tool outputs must be less than 512kb.”,
“timestamp”: 1715297581072
}

Another observation, sometimes we observe different string size limit mentioned in Node SDK error…

“400 Invalid ‘tool_outputs[0].output’: string too long. Expected a string with maximum length 1048576, but got a string with length 4648906 instead.”