Files
boxmaker/docs/plans/M5d1/files/runbook-session-compact-failed.md
kyleandGrok 4.6 3726ae585f docs: M5d-1 and M5d-2 implementation plans for Ornith
Eight closed tasks for epochs and compaction, then ten for the scheduler,
ToolSummary, and tiers. Given tests first. Gate 1456 → 1507 → 1572.

Co-Authored-By: Grok 4.6 <noreply@x.ai>
2026-10-02 21:54:37 -07:00

1.7 KiB

session-compact-failed

What you see. loopd logs that it could not compact a session, then this entry. The session stays on its current epoch. A turn that was already too large to fit (session_full) stays session_full. A turn that finished stays finished; the next turn on that session may be session_full if it would not fit.

loopd: could not compact session chat-0-0: compact.md: No such file or directory (os error 2); see docs/runbook.md#session-compact-failed

Why. Compaction needs a summary of the current epoch (a completion on the background slot with compact.md as the last user message, or the fallback of that epoch's owner texts). If the prompt file cannot be read, the summary call fails for a reason other than a full context, or writing the next epoch's files fails, loopd refuses to guess a prefix. It does not start a new epoch from an empty summary when the model call failed.

Confirm.

ls -l "$(dirname "$BOXMAKER_HOME/../config")/compact.md" 2>/dev/null
ls -l "$BOXMAKER_HOME/sessions/<id>"/
tail -n 5 "$BOXMAKER_HOME/sessions/<id>/0.jsonl"

compact.md lives next to system.md (the path in loopd.toml's [baseline] system). A last line of type epoch_end without <n>.baseline.json and <n>.jsonl is a compact that stopped halfway; the next compact resumes it.

Fix. Restore compact.md beside system.md (the starter is config/compact.md in the repository). Check that inferproxy still answers. If the session directory is mid-write, do not delete EpochEnd; the next compact continues from it.

Check. The next turn on that session either runs on the current epoch, or compact succeeds and the next turn's log is <n>.jsonl with epoch n.