Usage · Case-file mode

Threads that never run out of room.

An IM thread can go on for weeks, and a single CLI session can't hold all of it. Case-file mode keeps what matters about the thread in a short document — the case file — and moves the conversation onto a fresh session when the old one fills up, so the thread keeps going without losing the plot.

Turn it on

  1. Open the agent — Settings → Agents → edit.
  2. Tick Case-file mode in the basic section, under Default model. It is off by default.
  3. Save. It applies to every IM bot of that agent — Slack, 飞书, Telegram and 微信. The agent's web conversations are unaffected.

The case file

  • One per thread, shared by every agent that answers in that thread, with every revision kept.
  • Written by the agent. It records the durable state — the goal, decisions, open items — and keeps it short: past about 8,000 tokens it is asked to condense, past 12,000 it must cut the file down before doing anything else.
  • Yours to edit. It is a Markdown file at <your home>/.daymug/agents/<agent id>/case/<channel>-<thread>.md. Change it, and your version is taken as a new revision at the start of the next turn.
  • Read at the start of each session. A fresh session gets the whole case file; turns inside a session get a one-line reminder only when needed.

When the session rotates

Before each turn DayMug looks at how full the session's context was after the previous turn:

Context usedWhat happens
below 70%Keep going in the same session.
70% or moreStart a fresh session — if the case file has been updated since this conversation began.
92% or moreStart a fresh session regardless.

The new session starts from the case file plus the last reply of the old one, and appears as a new conversation named after the old one with a number: Weekly report → Weekly report-2 → Weekly report-3. Nothing changes for the people in the thread.

Tuning

  • case_rotate_context_ratio in config.yaml moves the 70% threshold (a number between 0 and 1; 0 means the default, not “off”). The 92% hard limit and the case-file sizes are fixed.
  • To stop rotating, turn case-file mode off on the agent.
  • Turns in case-file threads don't trigger the per-task cost guardrail notice.