Repository navigation
Description
Description
Description / 问题描述
[CN] 在使用 OpenCode 配合 gpt-5.3-codex 模型时,偶尔会遇到 JSON 解析失败的情况。
[EN] Occasional JSON parsing failures occur when using OpenCode with the gpt-5.3-codex model.
[CN] 报错信息显示为 JSON Parse error: Unterminated string,通常发生在模型尝试调用工具(Tools)或解析复杂上下文时。
[EN] The error message JSON Parse error: Unterminated string appears, typically when the model attempts tool-calls or processes complex contexts.
Actual Behavior / 实际现象
- [CN] AI 响应中途停止,界面弹出原始日志。
[EN] AI response stops mid-way, and raw logs are displayed on the UI. - [CN] 日志显示 JSON 在传输过程中被截断(例如在
tools定义部分)。
[EN] Logs show the JSON payload is truncated during streaming (e.g., within thetoolsdefinition).
Environment / 环境
- Model:
gpt-5.3-codex - Platform: OpenCode-web
Repository / 项目仓库
- Link:
https://github.com/deretame/async_uv - Context: This is an open-source project. The issue occurs frequently when Codex tries to index or analyze the root directory of this repository.
(这是一个开源项目。当 Codex 尝试索引或分析该仓库的根目录时,此问题频繁发生。)
// --- [LOG START: METADATA RETAINED] ---
{
"type": "response.created",
"response": {
"id": "resp_029c556764108ed40169cddc15a8b481919f76008087e8f49a",
"model": "gpt-5.3-codex",
"status": "in_progress",
"parallel_tool_calls": true,
"safety_identifier": "user-p1NpZeckCsXyN2GZOfJyhtLI",
"tools": [
{
"type": "function",
"name": "question",
"description": "Use this tool when you need to ask the user questions..."
// ... (full schema for 'question' retained)
},
{
"type": "function",
"name": "bash",
"description": "Executes a given bash command in a persistent shell session...",
"parameters": {
"type": "object",
"properties": {
"command": { "type": "string" },
"workdir": { "default": "/home/windy/pack/async_uv" }
}
}
},
// --- [STRATEGIC TRUNCATION: 15+ TOOLS REMOVED TO FIT 64KB LIMIT] ---
{
"type": "function",
"name": "context7_query-docs",
"description": "Retrieves and queries up-to-date documentation..."
}
]
}
}
// --- [CRITICAL ERROR AT THE END OF STREAM] ---
// JSON parsing failed: Text: {"type":"response
// Error message: JSON Parse error: Unterminated string
Plugins
none
OpenCode version
1.3.13 web
Steps to reproduce
## Steps to Reproduce / 复现步骤
[EN] This issue occurs frequently (intermittently) during normal usage.
[CN] 此问题在日常使用中非常高频(且具有一定的随机性)。
- Open a project with many files (e.g., my
async_uvworkspace).
打开一个包含较多文件的项目(例如我的async_uv工作区)。 - Upload an image or provide a complex prompt that triggers Codex tool-calls (e.g., "Analyze this image").
上传一张图片或输入复杂的指令,触发 Codex 的工具调用逻辑(例如:“解析这张图”)。 - Wait for the streaming response.
等待流式响应输出。 - Result: The response often halts mid-stream, popping up the
JSON Parse error.
结果: 响应经常在传输中途断开,并弹出 JSON 解析错误。
Screenshot and/or share link
https://opncd.ai/share/IgyV5Okb
Operating System
PRETTY_NAME="Debian GNU/Linux 13 (trixie)" NAME="Debian GNU/Linux" VERSION_ID="13" VERSION="13 (trixie)" VERSION_CODENAME=trixie DEBIAN_VERSION_FULL=13.4 ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
Terminal
Windows Terminal, wsl2, fish
Activity
github-actions commentedon Apr 2, 2026
This issue might be a duplicate of existing issues. Please check:
Error message: JSON Parse error: Unterminated stringerrors #10755: SameJSON Parse error: Unterminated stringerror withgpt-5.2-codex(open issue tracking this same problem on the codex model family)Please review the above issues to see if your problem is already being tracked, and consider adding your findings there if so.
Seraphtai commentedon Apr 2, 2026
+1
EnderLiquid commentedon May 9, 2026
I reproduced this issue across all three terminal environments within Windows Terminal — PowerShell 5.1, PowerShell 7, and Git Bash — while using OpenCode version
1.14.41's TUI and calling thegpt-5.3-codex/gpt-5.4models via the OpenAI Responses API format.I created a branch based on
1.14.41, merged PR #24289 , built and tested it locally, but the issue was not mitigated.menardorama commentedon May 10, 2026
FYI I just tested my PR against got-5.3 codex and it works without any errors
github-actions commentedon Jul 10, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.