Skip to content

Commit 983256c

Browse files
committed
Wipe styx cache when styxcache version changes
styxcache 0.2.0 persists stdout/stderr alongside cache entries, but legacy 0.1.0 entries predate that and silently replay empty stdout on hit (see styx-api/styx-runtime-py _replay_stream's missing-file path). This would re-introduce the ants.print_header.output empty-list bug as soon as a pre-0.2.0 entry is hit. Prepare step now reads the installed styxcache version, compares to a marker file, and wipes the cache dir if they differ.
1 parent e63bb8d commit 983256c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/test_full.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ jobs:
5050
# Purge stale staging dirs from crashed previous runs (safe: atomic-rename commits)
5151
rm -rf "$STYXCACHE_DIR/.incoming" 2>/dev/null || true
5252
53+
# Invalidate the whole cache when the styxcache version changes:
54+
# legacy entries may lack data (e.g. persisted stdout) that newer
55+
# versions expect, and missing-file handling is silent — so we rebuild.
56+
version=$(uv run python -c "from importlib.metadata import version; print(version('styxcache'))")
57+
marker="$STYXCACHE_DIR/.styxcache_version"
58+
if [ ! -f "$marker" ] || [ "$(cat "$marker")" != "$version" ]; then
59+
echo "styxcache version changed (now $version); wiping cache"
60+
find "$STYXCACHE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
61+
echo "$version" > "$marker"
62+
fi
63+
5364
size_kb=$(du -sk "$STYXCACHE_DIR" 2>/dev/null | awk '{print $1}')
5465
size_kb=${size_kb:-0}
5566
cap_kb=$(( STYXCACHE_MAX_GB * 1024 * 1024 ))

0 commit comments

Comments
 (0)