[BUG] openai/gpt-5.2-codex Error message: JSON Parse error: Unterminated string errors #7678

Open
opened 2026-02-16 18:07:55 -05:00 by yindo · 4 comments
Owner

Originally created by @thesammykins on GitHub (Jan 26, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

During session the agent would output a lengthy error ending with Error message: JSON Parse error: Unterminated string

From share link, this item has the entire error message. Also attached the session.json to issue.

Image

session.json

Plugins

No response

OpenCode version

1.1.36

Steps to reproduce

  1. Use opencode
  2. Have openai/gpt-5.2-codex as your model
  3. Use normally to plan+build
  4. Randomly dumping the Error message: JSON Parse error: Unterminated string into the conversation
  5. Say "continue" and agent picks back up
  6. Error may occur again

Screenshot and/or share link

Image

https://opncd.ai/share/JtdU1xX3

Operating System

macOS 26.3

Terminal

Warp

Originally created by @thesammykins on GitHub (Jan 26, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description During session the agent would output a lengthy error ending with `Error message: JSON Parse error: Unterminated string` From share link, this item has the entire error message. Also attached the session.json to issue. <img width="291" height="109" alt="Image" src="https://github.com/user-attachments/assets/8be11751-07ef-47d3-af96-a0a71c457c79" /> [session.json](https://github.com/user-attachments/files/24871021/session.json) ### Plugins _No response_ ### OpenCode version 1.1.36 ### Steps to reproduce 1. Use `opencode` 2. Have `openai/gpt-5.2-codex` as your model 3. Use normally to plan+build 4. Randomly dumping the `Error message: JSON Parse error: Unterminated string` into the conversation 5. Say "continue" and agent picks back up 6. Error may occur again ### Screenshot and/or share link <img width="3277" height="1732" alt="Image" src="https://github.com/user-attachments/assets/6de2709c-b009-493c-b6c1-82dd99c62856" /> https://opncd.ai/share/JtdU1xX3 ### Operating System macOS 26.3 ### Terminal Warp
yindo added the bug label 2026-02-16 18:07:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 26, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #1278: JSON Parse error: Unterminated string with openrouter/kimi-k2 (same error message, different model)
  • #2188: JSON parsing failed: Text (similar JSON parsing failures)
  • #3034: task tool "SyntaxError: Unexpected end of JSON input" (related JSON parsing issues with different models)

These issues all involve JSON parsing errors during model execution. Feel free to ignore if this specific case with gpt-5.2-codex is different.

@github-actions[bot] commented on GitHub (Jan 26, 2026): This issue might be a duplicate of existing issues. Please check: - #1278: JSON Parse error: Unterminated string with openrouter/kimi-k2 (same error message, different model) - #2188: JSON parsing failed: Text (similar JSON parsing failures) - #3034: task tool "SyntaxError: Unexpected end of JSON input" (related JSON parsing issues with different models) These issues all involve JSON parsing errors during model execution. Feel free to ignore if this specific case with gpt-5.2-codex is different.
Author
Owner

@LeoNardo-LB commented on GitHub (Feb 4, 2026):

Same issue

@LeoNardo-LB commented on GitHub (Feb 4, 2026): Same issue
Author
Owner

@R44VC0RP commented on GitHub (Feb 4, 2026):

hey @thesammykins can you run opencode export > session.json on the session where you encountered that issue?

@R44VC0RP commented on GitHub (Feb 4, 2026): hey @thesammykins can you run `opencode export > session.json` on the session where you encountered that issue?
Author
Owner

@thesammykins commented on GitHub (Feb 4, 2026):

hey @R44VC0RP the session.json for the session is linked in my original comment :)

https://github.com/user-attachments/files/24871021/session.json

@thesammykins commented on GitHub (Feb 4, 2026): hey @R44VC0RP the session.json for the session is linked in my original comment :) https://github.com/user-attachments/files/24871021/session.json
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7678