Marketing agent
A durable AI agent that drafts posts about What is the Style and waits for my approval
The agent writes the drafts, I press the button. A small AI agent that helps market What is the Style without spamming anyone.
What it is
The agent drafts posts and replies for Reddit, Bluesky and Mastodon. It watches what people say back on Bluesky and Mastodon, and when a new version of the app ships, it drafts posts about what changed from the commit messages since the last release.
Every draft reaches me on Telegram with Approve / Edit / Skip buttons. Every evening at 18:00 I get a digest with what was published, new replies and the drafts still waiting.
Intent
- Nothing is published without me. This is not only an instruction in the prompt. Only the host’s Telegram handler can mark a draft approved, and only for a message from my own chat. The model has no tool that approves. The publish tool refuses if the text is not exactly what I approved.
- Reddit is mine to post. The agent has no Reddit access at all. Reddit drafts come with a link to the submit page with the title and text filled in, and I post them myself. That keeps my account from being flagged as spam.
- It makes nothing up. Claims about the app may only come from one facts file and the app’s repo, which the agent can only read. No invented reviews, user numbers or features, and posts come from the developer and say so.
- Limits in code. At most five drafts a day, at most one post per subreddit per 14 days, and never the same text in two subreddits. A subreddit whose self-promotion rules I have not noted gets no posts.
- No other powers. No tools for voting, DMs, following, deleting or running shell commands.
How it works
The agent is built on pi-durable, a framework for durable agents. The point is that an agent that can publish must be able to crash at the worst possible moment without posting twice.
- Scheduled runs. The host submits a scan every three hours, the release watch once a day and the digest at 18:00. Each run has a fixed request id, so a restart never runs the same one twice. Each run gets its own conversation, so the context does not grow forever.
- One document with all state. Drafts, approvals, seen replies, limits, dedupe keys and the Telegram offset live in one typed document in SQLite. The process keeps nothing in memory that matters.
- One press is handled once. A Telegram button press is stored, submitted with the request id
tg:<update_id>, and only then is the offset moved. If the process dies in between, Telegram delivers the press again, and it is recognised. - Publish without double posts. An “attempt started” mark is committed before the call to the service. If the process dies mid-post, the agent refuses to retry and tells me, because the post may already exist.
- Crash test. An offline test runs the real supervisor, host, tools and SQLite against a fake Telegram and a scripted model. It kills the process with
kill -9at the dangerous moments and shows that each press leads to exactly one post.
Tech stack
- TypeScript on Node 24 with native type stripping, no build step
- pi-durable · pi-ai with Claude Haiku for scans and the digest and Claude Sonnet for drafts and chat
- SQLite store via pi-durable · Telegram Bot API with long polling · Bluesky and Mastodon APIs
- A small
run.shthat restarts the agent when it dies and starts inDRY_RUN - Runs in a locked-down dev container: internet access, but no access to the host, the LAN or other containers, and the app repo is mounted read-only