---
title: "Discussion on \"Safe to run twice: idempotency for small assistant jobs\" | Hashnode"
description: "Discussion on \"Safe to run twice: idempotency for small assistant jobs\". A scheduled job that only reads is easy. The trouble starts when the job writes something outside your process: sends a message, publishes a post, creates a record, charges a card. Then a timeout stop"
url: "https://hashnode.com/posts/safe-to-run-twice-idempotency-for-small-assistant-jobs/6b014420832dafbfcf00a61a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Safe to run twice: idempotency for small assistant jobs](https://wolhadevlog.hashnode.dev/safe-to-run-twice-idempotency-for-small-assistant-jobs?utm_source=hashnode&utm_medium=feed)

A scheduled job that only reads is easy. The trouble starts when the job writes something outside your process: sends a message, publishes a post, creates a record, charges a card. Then a timeout stop

5h ago · 5 min read · wolhadevlog.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#productivity](https://hashnode.com/tag/productivity)

## Written by

[Harry Song](https://hashnode.com/@harrysong)

@harrysong

  
[View profile](https://hashnode.com/@harrysong)

Solo developer in Seoul building Wolha, an AI character chat app for romance and BL stories

I build Wolha (wolha.app) alone in Seoul: an AI character chat app for romance and BL stories with original characters drawn in Korean webtoon style. 12 languages, web, iOS and Android.

## Responses 1

Markdown supported · ⌘↵ to post

[Dr Srinivas Padmanabhuni](https://hashnode.com/@srinivaspadmanabhuni)

[5h ago](https://hashnode.com/posts/safe-to-run-twice-idempotency-for-small-assistant-jobs/6b014420832dafbfcf00a61a/comment/6b014fff69c11d9c3bec0097)

The line that stood out to me is the "start with no done" ledger state: a crashed run looks like a run that never started. The same gap shows up in agents, where the final message says something succeeded and nothing independent confirms it.

A travel-planning agent we tested replanned from Whitefield to Koramangala, found an inn at INR 4800, then tried hold\_booking at INR 5900, a price no search had returned. The tool refused, but the flight hold still went through and the final answer said "Infeasible". Only the recorded trace showed a half-completed side effect.

So the ledger needs to come from what actually happened, not from the agent's summary. That's what we built AiEnsured agentest, an Agentic AI Testing platform, to judge from recorded traces. It has 165 tests:

pip install agentest-ai

Developers are welcome to enhance and contribute to it.
