AI Anonymous / Practical field guide / November 9, 2026

Did it queue twice?

A tool times out after writing to the queue. When your agent repeats the request, can the queue tell a replay from a new action?

In this field note · 6 sections
  1. Replay the same action
  2. Let SQLite enforce the action ID
  3. Choose what makes an action the same
  4. Follow the write past the queue
  5. Read the SQLite and Python contracts
  6. Run the lab or share the field note

Suppose an AI agent asks a tool to queue a draft review note for ticket T-42. The tool commits the row, but the caller never gets the acknowledgment. The caller repeats action A-101. In an unchecked queue, two identical requests become two rows. The lab adds a unique action ID and makes the repeated request visible as a replay.

What we ran. A fictional queue replay and five automated checks on Windows with CPython 3.13.15 and SQLite 3.50.4. The exercise uses a temporary local database and the Python standard library.
Poster reading “Did it queue twice?” One cream action card sits inside a worn wooden tray with brass corners. A curved amber arrow leads from a matching card back toward the tray. The masthead reads AI Anonymous and the footer reads JABSYSTEMS.IO.
Original AI-generated illustration of an action card returning to the same queue.

01 / Reproduce

Replay the same action

Extract the practice ZIP and open PowerShell in the extracted folder. Use Python 3.12 or later with SQLite 3.35 or later. The first script runs the replay. The second checks the supplied results and tests rollback, constraint errors, and a payload containing an apostrophe and non-ASCII text.

python .\queue_lab.py
python .\verify_lab.py

The unchecked table accepts both deliveries of A-101 and holds two rows. The guarded table starts empty and gets four requests. Each request uses a new connection to the same temporary database.

  1. A-101, draft for T-42 → queued.
  2. A-101, draft for T-42 again → replayed.
  3. A-101, draft for T-43 → conflict. The original draft request stays in place.
  4. A-102, draft for T-42 → queued. A new action ID can carry identical text.

The final outbox holds A-101 and A-102, both for T-42. Compare your output with observed-results.json. The sample database is removed when the lab exits.

02 / Inspect

Let SQLite enforce the action ID

The table declares action_id TEXT NOT NULL PRIMARY KEY. The insert targets that key. Its RETURNING clause yields a row when SQLite inserts one. The targeted conflict clause leaves other constraint errors, such as a null payload, visible to the caller.

INSERT INTO outbox (action_id, payload) VALUES (?, ?)
ON CONFLICT(action_id) DO NOTHING
RETURNING action_id;

Read enqueue() in queue_lab.py. It binds both values as parameters and consumes the insert result. When there is no returned row, it reads the saved payload for the same ID in the same transaction. An exact text match means replay in this exercise. A different payload means the caller should review the conflict. The calling code exits the transaction before recording the status. A separate check raises an exception before commit and verifies that the next attempt can insert the row.

03 / Make it your own

Choose what makes an action the same

  1. Try changing the third attempt from T-43 to T-42 and rerun the first script. The third status becomes replayed. Restore the fixture before running the checks again.
  2. Pick one action your agent can request. For a team inbox, that might be a draft reply for a particular workspace and ticket. Decide which fields must match on replay, including the destination if it affects the result.
  3. Have the caller assign the action ID once and carry it across retries. Decide what to do when the same ID arrives with changed inputs. If several callers share a database, scope the key to the owning tenant or workflow and apply the same scope to the lookup.

The practice README includes an optional prompt for reviewing a handoff design with an assistant.

Boundaries

Follow the write past the queue

The exercise checks one local database with sequential attempts. If a worker later sends a message and crashes before recording the result, the worker still needs a way to reconcile the send. Check whether the receiving service accepts a stable idempotency key and how long it retains that key. Keep replay records for the retry window you need. We tested neither a delivery worker nor an external service, concurrent load, a model, the optional prompt, or performance.

Primary sources / Checked November 9, 2026

Read the SQLite and Python contracts

Downloads / Practice files

Run the lab or share the field note

Explore more AI Anonymous field notes →

Share this post.

Found this useful? Pass it along. Download the artwork, add your own take, and tag @jabsystems.io so I can see your post.