From 4648ea662c82c0a93be3833f5207529eae124125 Mon Sep 17 00:00:00 2001 From: Shu Yao Date: Mon, 12 Jan 2026 18:16:57 +0800 Subject: [PATCH] fix: OpenAI Provider json, jsonl file load error --- runtime/node/agent/providers/openai_provider.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/node/agent/providers/openai_provider.py b/runtime/node/agent/providers/openai_provider.py index d42dd171..cb40a6ef 100755 --- a/runtime/node/agent/providers/openai_provider.py +++ b/runtime/node/agent/providers/openai_provider.py @@ -544,7 +544,13 @@ class OpenAIProvider(ModelProvider): mime = (attachment.mime_type or "").lower() name = (attachment.name or "").lower() - if not mime.startswith("text/"): + is_json = mime in { + "application/json", + "application/jsonl", + "application/x-ndjson", + "application/ndjson", + } or name.endswith((".json", ".jsonl", ".ndjson")) + if not (mime.startswith("text/") or is_json): return None if attachment.remote_file_id: return None # nothing to inline if already remote-only