Skip to content

The agent that grows with you

ci: run the unit job on a SQLite that uses WAL

teknium18ab10cc54171
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index da242d55ab7..46ccae2f634 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -48,7 +48,14 @@ jobs:
# fetching a manifest from raw.githubusercontent.com on EVERY job —
# a transient fetch failure fails the whole job (2026-07-28 slice-5
# incident). Pinned, the binary downloads directly; no manifest hop.
- version: "0.9.28"
+ #
+ # The uv pin also fixes which CPython `uv python install 3.11`
+ # resolves, and with it the linked SQLite. uv 0.9.28 resolved
+ # 3.11.14 / SQLite 3.50.4, which has the WAL-reset bug, so Hermes
+ # ran every state.db in DELETE mode here and the WAL path went
+ # untested. 0.12.13 resolves 3.11.16 / SQLite 3.53.1. The
+ # "Check SQLite runs WAL" step fails the job if a bump regresses it.
+ version: "0.12.13"
# Persist uv's download/wheel cache (~/.cache/uv) across runs.
# Keyed on the dependency manifests, so the cache is reused until
# pyproject.toml or uv.lock changes. `uv sync` still runs every
@@ -87,6 +94,15 @@ jobs:
# re-download, keeping the persisted cache small and fast to restore.
run: uv cache prune --ci
+ - name: Check SQLite runs WAL
+ # Hermes picks DELETE journal mode on a SQLite with the WAL-reset
+ # bug. If this interpreter links one, every WAL test silently runs
+ # DELETE (or skips), so fail loudly instead. Tests that need DELETE
+ # select it explicitly (journal_mode config, a pinned vulnerable
+ # version), so they run on any interpreter.
+ run: |
+ .venv/bin/python -c "import sqlite3, sys, hermes_state_wal as w; v = w.is_sqlite_wal_reset_vulnerable(); print(f'Python {sys.version.split()[0]}, SQLite {sqlite3.sqlite_version}, WAL-reset vulnerable: {v}'); sys.exit(1 if v else 0)"
+
- name: Restore per-file duration cache
# scripts/run_tests_parallel.py raises a file's timeout to
# 3x its last healthy duration (_effective_file_timeout) so a