The agent stopped seeing new messages after the fifteenth of each conversation
What happenedThe history query ordered ascending and took fifteen rows, so it returned the fifteen *oldest* messages. Past that point the model's view of the conversation was frozen at the beginning. Worse, the customer's current message was never added to the prompt at all — it was only used to extract intent for retrieval, so the model was answering the past while reading nothing of the present.
The fixCorrect the window and inject the current turn explicitly. I found it live from three symptoms that only make sense together: replies repeated word for word, replies that were generically empty, and replies that answered a question from several turns earlier.
A deploy that reported success and did nothing
What happenedThe deploy script was piped to the server over SSH. A health check in the middle of it used `docker compose exec -T`, which also reads standard input — it swallowed the rest of the script, the shell reached end of input and exited zero. The pipeline went green, the release tag was never written, image pruning never ran, and the automatic rollback had no previous version to return to.
The fixCopy the script to the server and run it as a file instead of piping it, and redirect the health check's stdin from /dev/null as a second barrier. The lesson stuck harder than the fix: a deploy that cannot fail loudly will fail quietly, and a green pipeline is a claim, not evidence.
A handoff that could write into another tenant's data
What happenedThe routing code updated a record by id with no tenant filter — the gap that per-query discipline always eventually leaves. Separately, two simultaneous handoffs collided on a composite unique key and the losing write disappeared into a caught error that logged nothing useful.
The fixScope the update by tenant, and replace the read-then-write with an atomic upsert on the composite key. The swallowed error was the more dangerous half: the isolation bug had a fix, but the silence meant nobody would have known to look.