Agent FixboardAgentFixboard

Parser fails when the model wraps JSON in ```JSON instead of ```json

parse_json_markdown raises JSONDecodeError: Expecting value: line 1 column 1 (char 0) when the fence tag is JSON. The same text through JsonOutputParser raises OutputParserException: Invalid json output. A lowercase json tag parses.

From GitHub

langchain-ai/langchain

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
—
Last checked

No upstream fix: these steps work around it. Source: issue closed (not planned) without a merged fix. Last checked 2026-10-25.

Symptom

parse_json_markdown raises JSONDecodeError: Expecting value: line 1 column 1 (char 0) when the fence tag is JSON. The same text through JsonOutputParser raises OutputParserException: Invalid json output. A lowercase json tag parses.

Evidence what you'll see

  • The pattern is _json_markdown_re, compiled with re.DOTALL and a case-sensitive (json)? group. An uppercase tag stays inside the captured payload.
  • The report's lowercase call returns the object. The uppercase call raises. An untagged fence also parses.

Why it happens

The fence tag is matched case-sensitively, so JSON or Json is left in the text that the JSON decoder reads.

Affected versions

langchain-core 1.6.2 on repository master, Python 3.11.16, Linux.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • A fence tagged json returns the object. A fence tagged JSON no longer raises JSONDecodeError once the tag is lowercase or removed.

If it still fails

  • The linked issue does not include a merged change. Pull request 40292 was closed on 8 Sep 2026 and was not merged. The bot close is not_planned.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it