Repository navigation
Fix the dashboard hang; make send pacing configurable; Gmail quota retries; logo beside the sign-off - #245
Open
PandasProperty wants to merge 6 commits into
Conversation
With channels.email.signature.logo set, an email that ends with persona.name on its own line now gets the logo next to the sign-off lines, with persona.company in them opening signature.link. On cold email the compliance footer (postal address and opt-out line) follows in smaller grey type instead of the logo hanging under the footer. The writer prompt asks for that two-line sign-off so every email qualifies. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: PandasProperty <anda.nenu@gmail.com>
A busy inbox's first full read can hit Gmail's per-user-per-minute quota; the 403 or 429 failed the read, which held every send that cycle. Such answers are now retried with backoff (about a minute in all, honouring Retry-After) before failing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: PandasProperty <anda.nenu@gmail.com>
The sender drained up to 8 approved emails a cycle a few seconds apart, which at 5 a day under a warmup ramp meant the whole day's cold email left in one minute. channels.email.max_sends_per_cycle (default 8, unchanged) sets it; 1 sends one email per heartbeat cycle. The sender always looks through at least the default page of due emails, so a few gate-blocked ones at the front of the queue can't use up a small cycle. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: PandasProperty <anda.nenu@gmail.com>
Every API call opened and closed its own aiosqlite connection on its own thread, and under that churn the dashboard process could lock up inside SQLite's unix VFS for good: every request pending in the browser until the process was killed. The dashboard and the heartbeat now keep one connection per database for the life of the process (storage.share_connections), handed out to one user at a time, reentrant for the task that holds it, rolled back and reset on the way out. One-shot commands and tests open connections as before. Worker threads are daemons and connections are stopped when their loop is collected, so test runs and short commands exit cleanly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: PandasProperty <anda.nenu@gmail.com>
Upstream's writer now signs every cold email itself with the sender's first name and rewrote prompts/writer.md, so the sign-off rule this branch added to the prompt is dropped. The signature renderer takes that one-line first name as the sign-off too (a closing paragraph opening with persona.name still counts, for operator email rules that write their own), with a test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: PandasProperty <anda.nenu@gmail.com>
Reading a busy inbox is one call per message. A read that timed out or dropped its connection on any one of them failed the whole read, and a failed read holds every send that cycle; on an inbox of several hundred messages a week, one such call per cycle held sends all day. A read did nothing on Gmail's side, so it is now repeated with the same backoff as a quota answer. A send is still never repeated, since it may have gone out. The log line names the exception type, since str() of a timeout is often empty. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: PandasProperty <anda.nenu@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four changes from running Sellbird day to day on a fresh Gmail mailbox under a warmup ramp. Each is its own commit.
Fixed: the dashboard hangs under its own requests
Every API call opened and closed its own aiosqlite connection on its own thread. Under that churn the dashboard process could lock up for good inside SQLite's unix VFS: a
sampleof the hung process showed 19 threads waiting on the VFS mutex (16 inunixOpen, 2 inunixClose) with no holder, and the browser showed every request pending until the process was killed. A write-lock probe over a full heartbeat cycle ruled out the heartbeat holding the database.The dashboard and the heartbeat now keep one connection per database for the life of the process (
storage.share_connections), handed to one user at a time, reentrant for the task that holds it, rolled back androw_factory-reset on the way out. One-shot commands and tests open connections as before. Worker threads are daemons and connections are stopped when their event loop is collected, so short commands and test runs exit cleanly. New tests intests/test_storage.py; the full suite also passes with sharing forced on, about 30% faster.Changed:
channels.email.max_sends_per_cycleThe sender drained up to 8 approved emails a cycle a few seconds apart, so at 5 a day under the ramp the whole day's cold email left in one minute. The new setting (default 8, unchanged) sets how many each inbox sends per heartbeat; 1 sends one per cycle. The due-email page is now at least the default size, so a few gate-blocked emails at the front of the queue can't use up a small cycle. Tests in
tests/test_sends_per_cycle.py.Fixed: Gmail quota answers and timed-out reads fail the reply read
A busy inbox's first full read can hit Gmail's per-user-per-minute quota; the 403/429 failed the read, which held every send that cycle. Those answers are now retried with backoff (about a minute in all, honouring
Retry-After) before failing. The same goes for a read whose connection times out or drops (httpx.HTTPError): reading a week of a busy inbox is one call per message, and one slow call out of several hundred failed the whole read every cycle, holding sends all day; it did nothing on Gmail's side, so it is now repeated with the same backoff. A send is still never repeated, since it may have gone out. The log line names the exception type (str() of a timeout is often empty). Tests intests/test_gmail_rate_limit.py.Changed: the logo sits beside the sign-off
With
signature.logoset, the logo sits next to the sign-off lines (the first name the writer now signs every cold email with, or a closing paragraph opening withpersona.namewhen operator email rules write their own),persona.companyin them openingsignature.link, and the cold-email compliance footer follows in smaller grey type instead of the logo hanging under the footer. The merge with main drops the sign-off rule this branch had added to the writer prompt, since the writer signs itself now. A mail-tester run of the rendered email through the Gmail pipeline scored 8.9/10, with the only deductions being the usual image-in-a-short-email rules.Test plan
pytestafter merging main: 3720 passed, 27 skippedmax_sends_per_cycle: 1🤖 Generated with Claude Code