---
id: 16928
lang: en
title: "SQLite 3.54.1 Update Broke LLM Utility Logging: JSON Array Turned Into a String"
published_at: "2026-11-21 01:44:52"
source_name: "Simon Willison"
source_url: "https://simonwillison.net/2026/Nov/16/llm/"
canonical_url: "https://news.hamidun.com/en/news/16928"
categories: ["llm", "research"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# SQLite 3.54.1 Update Broke LLM Utility Logging: JSON Array Turned Into a String

> **Краткая суть (BLUF):** The latest SQLite 3.54.1 from Homebrew broke logging in Simon Willison's LLM utility, a tool for working with language models. The query json_object('a', (select json_array(1))) used to return {"a":[1]}, but now it returns {"a":"[1]"}: the list became a quoted string. Richard Hipp, the author of SQLite, calls this a fix: according to the documentation, a subquery returns text, not JSON. If you nest subqueries inside json_object, wrap them in json().  • LLM 0.37.3 is a bugfix release: logs are being written again with the new SQLite • In SQLite 3.54.0, a nested json_array stayed an array; in 3.54.1 it becomes text • Workaround: json((select json_array(1))) inside json_object

Sometimes an application breaks not because of your code or an update to the program itself, but because a library underneath it quietly changed. That is what happened with LLM, a command-line tool and Python library by Simon Willison for working with language models. It stores the history of model requests in a SQLite database. When Homebrew started shipping SQLite 3.54.1, logging stopped working: the json_object function began returning a nested JSON array as a plain string. LLM version 0.37.3 fixes this. The release is small, but it shows how a single database fix can break someone else's code that has worked for years.

## What exactly broke

SQLite is the most widely deployed embedded database: it lives in browsers, phones, and thousands of utilities. It has JSON functions, including json_object (builds a JSON object) and json_array (builds a list). The LLM utility uses them when it writes information about each model call to the database.

The change is easy to see in one line. In SQLite 3.54.0, the query

select json_object('a', (select json_array(1)))

returned {"a":[1]}, meaning the nested list stayed a real list. In version 3.54.1, the same query returns {"a":"[1]"}. Quotation marks appeared, and for any code reading the result, this is a different data type: it expected a list and got text. For logs, this means the structure of the record no longer matches what was expected.

## Bug or intended behavior

Richard Hipp, the author of SQLite, replied on the project forum directly: this was a bug fix. According to the documentation, the result of a (SELECT json_array(...)) construct is SQL text, not JSON. So the behavior in 3.54.1 is correct, and 3.54.0 was behaving incorrectly.

This situation is familiar to anyone who has worked with third-party APIs. You write code against behavior that is not in the specification. It works, you get used to it, and you stop noticing that you rely on an undocumented quirk. Later, the maintainers bring the implementation in line with the documentation, and your code breaks. Formally, they are right; in practice, the problem is yours.

## How to fix your queries

The workaround is simple: if the nested subquery should remain JSON, tell the database explicitly by wrapping it in the json() function:

select json_object('a', json((select json_array(1))))

The json() function takes text, verifies that it is valid JSON, and returns it as a JSON value. Inside json_object, the list then stays a list and appears in the result without extra quotation marks.

## What developers should do

First, check your own queries. Look for places where the result of a subquery using json_array or json_object is passed into an outer json_object or json_array. These are the constructs affected by the change. If you find them, add an explicit json() call.

Second, remember that SQLite often comes not from your lock file but from the system: through Homebrew, a Linux distribution, or a version bundled with a programming language. As a result, database behavior can change during a routine package update even though nothing in your project was touched. If reproducibility matters, pin the SQLite version in your environment or run tests against several versions.

Third, LLM users only need to upgrade to 0.37.3, and logging will work again with the new SQLite.

## Limitations

The release itself is narrow. The fix addresses one quirk of the JSON functions and adds no new capabilities for working with models. The release notes contain no information about other changes in LLM, so those cannot be assessed. The lesson, however, is general: tests at the boundary with system libraries and explicit type casting save hours of debugging when a dependency is updated without your involvement.

---
- **Первоисточник:** [Simon Willison](https://simonwillison.net/2026/Nov/16/llm/)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/16928
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
