AI/Nov 17 edition/Reporting & analysis
CodingInfrastructure

CodingSoftware & developer tools

LLM 0.37.3 fixes `llm logs` crash triggered by SQLite 3.54.1's change to JSON in subqueries

SQLite 3.54.1 stopped carrying JSON's hidden subtype through scalar subqueries, so nested JSON now comes back as quoted strings. That crashed LLM's log command on Homebrew setups. Version 0.37.3 wraps the affected subquery in json() and adds CI coverage.

From the Simon Willison article of November 16, 2026 and cited sources: In SQLite 3.54.1, a JSON function given a scalar subquery now treats the subquery's result as plain text. [2] [3] [4]

SOURCES[2] SQLite 3.54.1 release log sqlite.org[3] SQLite forum: Hipp's reply on the json_object subquery… sqlite.org[4] SQLite bug report, 2026-10-12 sqlite.org

AI-assisted, not human-edited. Methodology Corrections Who owns this site

KEY FACTS
What happened
In SQLite 3.54.1, a JSON function given a scalar subquery now treats the subquery's result as plain text. [2] [3] [4]
Original source
Simon Willison article, independent perspective
Brief by
AT Pulse research desk AI-assisted; publisher and contact on the desk page
When
November 16, 2026 article published
Evidence
11 sources across 4 sites

Reach: not measured yet

THE CORE IDEAS4 TAKEAWAYS
01

In SQLite 3.54.1, a JSON function given a scalar subquery now treats the subquery's result as plain text. It embeds that result as a quoted string instead of nested JSON. SQLite's creator, D. Richard Hipp, says the new behaviour is correct and the old behaviour was the bug. The 3.54.1 release notes do not mention the change. [2] [3] [4]

02

In LLM, an older tool-results query nested a json_group_array subquery inside json_object. The attachments list came back as a string, and Python then failed when it looped over the string's characters. The patch wraps the subquery in json(), which works on every SQLite version, and CI now also tests against SQLite 3.54.1. [1] [6]

03

Several unrelated projects ran into the same change weeks earlier. In Threadlines, a database migration wrote arrays as quoted strings without raising any error. The data was simply wrong, with no crash to flag it. [5] [9] [10]

04

Teams often don't choose their SQLite version directly. Node 22.23 and Homebrew both brought in 3.54.1. The practical fixes are to find JSON functions that take scalar subqueries, wrap those subqueries in json(), and test against more than one SQLite version. [5] [6]

WHY IT MATTERS

Independent projects reproduced the change, and in one it wrote wrongly shaped data without any error. Teams storing logs or agent state as JSON in SQLite may be exposed through runtime or package-manager upgrades they do not directly control.

Executive brief

LLM 0.37.3 doesn't fix a bug in LLM. It adapts to a bug fix in SQLite. SQLite 3.54.1 stopped passing JSON's internal "subtype" out of scalar subqueries. As a result, json_object('a', (select json_array(1))) now produces {"a":"[1]"}, a quoted string, where it used to produce a real nested array. SQLite's creator D. Richard Hipp says the new behaviour is correct and the old one was the bug (SQLite forum). After Homebrew shipped 3.54.1, llm logs began crashing (Simon Willison). Other projects hit the same change weeks earlier. Any code that builds JSON from subqueries may be affected.

What changed and event timeline

  1. Upstream bug filed

    A report showed that two logically equivalent WHERE clauses gave different JSON types in json_group_object(). SQLite developers fixed how subtypes are preserved, and that fix underlies the later change ().

  2. SQLite 3.54.1 released

    The release notes describe a patch release with a 32-bit heap-overflow fix and "other user-reported fixes". The JSON subtype change is not called out in the notes ().

  3. Downstream breakage appears

    Threadlines merged a fix after Node 22.23, which bundles SQLite 3.54.1, broke a migration: arrays were being stored as quoted strings. The fix wrapped four subqueries in json() ().

  4. Hipp rules it a fix

    Willison asked whether the change was intentional. Hipp replied that (SELECT json_array(...)) returns SQL text, so 3.54.1 is correct and 3.54.0 was the bug ().

  5. LLM 0.37.3 ships

    This bug-fix release covers the crash seen with Homebrew's SQLite 3.54.1 (;).

Capabilities and access

  • Version: LLM 0.37.3, Willison's command-line tool and Python library for working with language models.
  • It is a patch release.
  • Recent history: it follows 0.37.2 (11 November), which fixed cases where a configured OpenAI API key could be sent to a different provider's OpenAI-compatible endpoint (Willison, 0.37.2; Let's Data Science).
Read the full section
  • Version: LLM 0.37.3, Willison's command-line tool and Python library for working with language models.
  • New features: none. It is a patch release.
  • Recent history: it follows 0.37.2 (11 November), which fixed cases where a configured OpenAI API key could be sent to a different provider's OpenAI-compatible endpoint (Willison, 0.37.2; Let's Data Science).
  • Who should upgrade: Homebrew users on macOS running SQLite 3.54.1, the setup named in issue #1879.

Technical analysis for researchers and developers

  • How SQLite JSON works: JSON functions tag their results with a hidden "JSON subtype".
  • What changed: in 3.54.x, a scalar subquery drops the tag. The outer function then treats the result as plain text and quotes it (Threadlines PR #582).
  • How it broke LLM: a legacy tool-results query nested (select json_group_array(...)) inside json_object().
Read the full section
  • How SQLite JSON works: JSON functions tag their results with a hidden "JSON subtype". That tag tells an outer json_object, json_set and similar functions to embed the value as JSON rather than escape it as a string.
  • What changed: in 3.54.x, a scalar subquery drops the tag. The outer function then treats the result as plain text and quotes it (Threadlines PR #582).
  • How it broke LLM: a legacy tool-results query nested (select json_group_array(...)) inside json_object(). The attachments list came back as a string, Python looped over its characters, and the code failed with AttributeError: 'str' object has no attribute 'get' (issue #1879).
  • Fix: wrap the subquery in json(). That restores the tag on every SQLite version.
  • Testing: LLM's CI now also tests against SQLite 3.54.1 (issue #1879).

Claims and evidence

  • 3.54.1 changed the output of json_object when its argument is a subquery. Independent projects reproduced this: Threadlines PR #582, agmsg PR #1661 and styal PR #1414.
  • The new behaviour is correct. This is the SQLite maintainer's ruling, based on his reading of the documentation (SQLite forum).
  • Homebrew's SQLite update triggered the LLM crash. The reviewed sources do not give the date Homebrew updated its package.
Read the full section
  • 3.54.1 changed the output of json_object when its argument is a subquery. Independent projects reproduced this: Threadlines PR #582, agmsg PR #1661 and styal PR #1414.
  • The new behaviour is correct. This is the SQLite maintainer's ruling, based on his reading of the documentation (SQLite forum).
  • Homebrew's SQLite update triggered the LLM crash. This rests on the linked post and issue #1879. The reviewed sources do not give the date Homebrew updated its package.

Context and prior work

This has happened before. In July 2022, SQLite 3.39.0 started double-encoding JSON that came out of subqueries and views. LLM 0.37.3 is the third patch in two weeks, after 0.37.1 and 0.37.2 (Willison, 0.37.2).

Read the full section

This has happened before. In July 2022, SQLite 3.39.0 started double-encoding JSON that came out of subqueries and views. Hipp's reasoning then was the same: subqueries convert JSON to TEXT, so code must call json() explicitly (SQLite forum, 2022). The 2026 change appears to close a remaining path where the subtype still leaked through, prompted by the October 12 bug report. LLM 0.37.3 is the third patch in two weeks, after 0.37.1 and 0.37.2 (Willison, 0.37.2).

Limitations, safety and contested findings

  • Not everyone agrees the change is clearly correct. Nuno Cruces argued that keeping the subtype is useful (SQLite forum).
  • The change is easy to miss. The 3.54.1 release notes do not mention it (release log).
  • Data can be corrupted without any error.
Read the full section
  • Not everyone agrees the change is clearly correct. In the forum thread, an anonymous commenter pointed out that the value still reports subtype 74, SQLite's JSON marker, and questioned whether the documentation is clear. Nuno Cruces argued that keeping the subtype is useful (SQLite forum).
  • The change is easy to miss. The 3.54.1 release notes do not mention it (release log).
  • Data can be corrupted without any error. In Threadlines, the result was wrongly shaped data written to storage by a migration, with no crash to flag it (PR #582).

Business and practitioner implications

  • Look for JSON functions (json_object, json_set, json_array, json_insert, json_replace) that take scalar subqueries as arguments, and wrap those subqueries in json().
  • The version is often decided by a runtime or package manager you don't control: Node 22.23 and Homebrew Python both pulled in 3.54.1 (PR #582; issue #1879).
  • Most exposed: AI tools that keep logs or agent state in SQLite as JSON.
Read the full section
  • Search your SQL. Look for JSON functions (json_object, json_set, json_array, json_insert, json_replace) that take scalar subqueries as arguments, and wrap those subqueries in json().
  • Know where your SQLite comes from. The version is often decided by a runtime or package manager you don't control: Node 22.23 and Homebrew Python both pulled in 3.54.1 (PR #582; issue #1879). Pinning or testing against several SQLite versions in CI, as LLM now does, lowers the risk.
  • Most exposed: AI tools that keep logs or agent state in SQLite as JSON.
FOLLOW THE EVIDENCE

The source trail.

Sources (11)
A LITTLE LESS NOISE. A LOT MORE CONTEXT.

Stay curious.
Follow the evidence.

Independent perspectives, the original sources, and room for the questions that don't have easy answers.

How we build the brief
Connect with us

Find us where you already read.