DEDUPED Hot AI repos, turned into use cases Get 5 a day

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.

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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page