AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Oct 13, 2026, 10:00 JST

HACH developer: persist AI agent task steps, not cursors

HACH developer: persist AI agent task steps, not cursors

3 Key Points

  1. What happened

    The developer of HACH, a resident AI agent for Slack, Teams and Chatwork, published a design guide arguing long-running agent tasks must assume the process will crash and persist each step's status (pending, done, failed) to external storage.

  2. Why it matters

    Re-running an unfinished task can double API costs and, for side-effecting calls like sending email or updating status, cause duplicate sends and updates, so side-effecting calls need an idempotency key that the receiving system also rejects on repeat.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

This checkpoint design is a second line of defense, one step behind zero-downtime deployment: where that earlier work aims to avoid dropping a process mid-task, this one assumes the drop will happen anyway and asks how to recover afterward. It frames the core failure as losing track of how far a task got — a problem that is cheap to ignore for short question-and-answer responses, where simply asking the user to repeat the request does little harm, but expensive for tasks that run for many minutes.

The proposed structure separates three kinds of calls. Read-only searches or tool calls can safely be re-run and need no idempotency key. Writes and email sends must carry an idempotency key, with the receiving system — the company's own database, if the API is internal — turning a second call with the same key into a no-op. LLM inference causes no real harm but duplicates cost, so if its output was already persisted, the saved result should be reused rather than recomputed. Where an external service does not support idempotency keys, use a guard that checks the caller's own record of whether that key already ran before making the call.

A second thread in the piece is that the same persisted state doubles as user-facing progress reporting. The author, who develops HACH, notes that as resident agent tasks grow longer and more complex, the cost of postponing recoverable design rises, and suggests wiring up step-level persistence early, while short responses still dominate.

FAQ
Why is restarting a long-running agent task from scratch so costly?
Each tool call carries a real external API cost (LLM inference, search, writes to other systems), so re-running duplicates that spend. Tasks with side effects, such as checking billing status, can also cause duplicate emails or duplicate status updates.
Why is resume by cursor position considered risky?
If a step finished but the process crashed before the persist write completed, position-based resume treats the completed step as unfinished. Check each step's status individually — skipping done steps and running only pending or failed ones — and use the cursor only as a rough guide.
Can the saved task state be used for anything besides crash recovery?
Yes. The same persisted data can be shown to users as progress, such as 5 of 8 steps done with an estimated 2 minutes remaining, comparable to a PM tracking several projects at once.

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleEpic's $1.5 billion Disney shooter goes "AI first"