- Home
- Skills
- Agents & Orchestration
- email-threading-gate
Works with the AI tools you already use
Email Threading Gate
Prevent Gmail thread splitting and encoding corruption with a strict pre-send validation gate.
$27.39
email-threading-gate
Example session with this skill installed
- Read your context and instructions
- Compiled the email-threading-gate
[threading_gate] E4: immediate parent is own send (sender@example.com). Resolving subject from References chain.
[threading_gate] E4: resolved original_subject='Important Thread — Details' from References anchor anchor_id
AssertionError
Threading gate: Reply subject mismatch after stripping Re:/Fwd:.
Outgoing (stripped): 'Important Thread -- Details'
Original (stripped): 'Important Thread — Details'
Do not normalize a reply subject -- normalization changes the conversation key and splits the thread.
Telegram alert fired
⛔ Threading gate STOP: Threading gate: Reply subject mismatch after stripping Re:/Fwd:.
Outgoing (stripped): 'Important Thread -- Details'
Original (stripped): 'Important Thread — Details'
Do not normalize a reply subject -- normalization changes the conversation key and splits the thread.
(Same reply with the original em-dash subject intact: gate returns None, no alert, send proceeds.)
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
The problem
Automated Gmail workflows often fail silently when message threads split due to subject encoding mojibake or using the wrong In-Reply-To source. These threading errors are difficult to debug after the fact and unprofessional for recipients.
What it does
- Enforces a single choke point before outbound API calls to prevent invalid sends.
- Detects and blocks subject encoding corruption like em-dash normalization and latin-1 mojibake bigrams.
- Verifies In-Reply-To provenance against the sending account's own mailbox; when the immediate parent is your agent's own send, resolves the true subject through the References chain instead of trusting the caller.
- Fires immediate Telegram alerts for precondition failures or degraded service states.
- Gracefully handles "Fresh Send" modes while maintaining type and mojibake safety checks.
Frameworks & tools
Python 3.11+, google-api-python-client, and google-auth. Designed specifically for Google Workspace with Domain-Wide Delegation (DWD).
Why this beats prompting it yourself
The checks in this gate grew out of documented production failures: a latin-1 subject mangle that forked a client thread despite correct In-Reply-To headers; a cross-account thread ID that 404'd; an em-dash retyped as a double hyphen that split a 27-message thread three times in one evening; and a degraded mode that silently skipped its own subject check for two days because one caller omitted one parameter. Each incident is documented in the included PROVENANCE.md, dated, and mapped to the test that now catches it.
The suite collects 38 cases across ten test files; a standard run reports 36 passed and 2 skipped (the two live cross-namespace Gmail tests, which run only when credentials are configured). It includes replays of the actual failing inputs through the production call path. This is not threading logic an LLM guessed at; it is the scar tissue of a production fleet that runs a real company, packaged.
Use cases
- Preventing automated support responses from splitting into multiple threads.
- Auditing outbound sales sequences for subject line encoding integrity.
- Ensuring internal bot notifications correctly thread under the specific trigger email.
- Standardizing email send safety across multiple service accounts or apps.
Known limitations
Gmail-specific by design, targeting the Gmail API thread model and RFC 2822 headers. The Telegram alert hook is a documented swap-point: it defaults to the OpenClaw CLI and swaps cleanly for your own alert channel.
About the builder
Built by Tradeplier: a licensed Massachusetts builder running a $1M/yr construction company on an agent back office, in production since April 2026. We file the bugs we find upstream: six issues on openclaw/openclaw to date, four rated diamond lobster by the project. If this skill breaks in your fleet, the incident becomes a test and you get the fix. The full audit story behind all three, including the part where the audit caught these packages themselves, is at https://www.tradeplier.com/audit-story/
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 1 month ago
- Passed all security checks, Safe to install