DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to stop repeated tool runs after a crash with Master Agent

Persist requests in SQLite so a repeated request returns the saved result instead of running again.

Short answer: Build with SQLite support by following the Quick start build steps with libsqlite3 development files installed; then run a request with state and identity using ./build/cli/sparx run --state ./state/agent.db --session alice --request-id ac-001 --input 'set AC to 22 degrees'; Repeat the same command after a restart and confirm it returns the recorded outcome without a second tool call. All steps.

Who it is forAn operations engineer running an agent that changes a real system and must not apply the same change twice after a restart or failure.

The problemIf a process dies mid-request, it is unclear whether the tool ran, and retrying can repeat the change.

The outcomeRepeated requests return the recorded outcome, and interrupted requests are marked UNKNOWN for external checking and explicit reconciliation.

What you need first

  • CMake 3.18+ and a C++17 compiler on Linux or macOS
  • Python 3 for tests and packaging
  • libcurl development files only if you want the HTTP model adapter
  • SQLite development files only if you want durable storage

Steps

  1. Build with SQLite support by following the Quick start build steps with libsqlite3 development files installed.
  2. Run a request with state and identity using ./build/cli/sparx run --state ./state/agent.db --session alice --request-id ac-001 --input 'set AC to 22 degrees'. (inferred, check the README)
  3. Repeat the same command after a restart and confirm it returns the recorded outcome without a second tool call.
  4. After an interruption, run ./build/cli/sparx recover --state ./state/agent.db to mark unfinished requests as UNKNOWN.
  5. Check the external system for each UNKNOWN request, then follow the recovery guide at docs/durable_recovery.md to reconcile it.

Prompt for your agent

Using the repo OpenSparX/MasterAgent, run `sparx run --state ./state/agent.db --session <session> --request-id <id> --input '<command>'` twice, restarting between runs, then run `sparx recover --state ./state/agent.db`. Expected output is the same recorded outcome on the second run and any unfinished requests listed as UNKNOWN. Verify that the tool was not invoked a second time.

Caveat. The README states there is no transaction across a real device and SQLite, so this is not an exactly-once guarantee, and storage is not encrypted.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for OpenSparX/MasterAgent and "Stop repeated tool runs after a crash"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer