Repository navigation
Say when the hour's AI drafts are used up, in plain words - #572
Conversation
The Magic Compose page showed the shared rate limit's message, "too many requests — wait 700s and retry". It now reads the error's bucket and wait: "You've used this hour's AI drafts. Try again in 12 minutes, or fill it in by hand.", with a link to the manual form. A 429 from the AI provider has no bucket and reads "The AI service is busy. Try again in a minute." consumeRateLimit and the API's error stay as they are. The bucket name moves to src/lib/magic-compose/limits.ts, which has no imports, so the page can read it without pulling server code into its JavaScript. Part of #570. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
… AI provider The page said the site sends nothing to an AI vendor by itself, which isn't true when the operator turns on AI drafting: Magic Compose sends the organizer's description to the provider the operator configured. That sentence now names the exception, and Third parties says what goes, what doesn't, and that filling the signup in by hand avoids it. Part of #570. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
Second review of this PR:
- The provider's own 429 is now recognised by the route's
llmErrorCode rather than by a missing bucket, so any other rate limit
keeps its own message. When the provider asks for more than a minute,
the page says how long ("Try again in 10 minutes."), rather than
inviting a retry that spends another draft on a refusal.
- The rate-limit module keeps the bucket name written out instead of
importing it from Magic Compose; the test that compares the two can
now fail.
- The privacy page said nothing about participants goes to the AI
provider. What the organizer types goes as typed, so it now says to
leave out what they wouldn't want the provider to see, and that
nothing else about them, their signups or the people on them goes
with it.
Part of #570.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
The sentence about AI drafting ended a line with {INSTANCE_NAME}, and
JSX drops the line break after an expression, so the page read
"OpenSignup sends" run together ("…(local)sends nothing"). Found by
running the page.
Part of #570.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
Brings in #525 and #526. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
Brings in #568. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
Brings in #579, #613 and #614. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
Brings in #646, #663 and #671. No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
Tophat: each PR on its own, and the privacy pageI ran each head of this stack alone locally with
Checked on #572:
Checked on #573's API alone: a questions reply gives 200 with One fixBump the privacy page's "Last updated". #572, #573 and #575 all edit Generated by Claude Code |
This stack changes what the privacy page says about AI drafting here and in the two PRs after it, but the page still showed 24 October, the date main already had, so a reader couldn't tell it changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks
|
Thanks for running each head on its own. Fixed: the privacy page's "Last updated" now reads 27 October 2026 (a049c58). I set it here, in the first of the three PRs that change the page, so it's right whichever one lands first; the merges carry it up to #573 and #575. If the stack lands on a later day, the date can move to the merge day then.
Generated by Claude Code |
From a review of this PR: - scripts/email-preview.ts parsed the request target with `new URL()`, which throws on `//[` and took the server down. It now splits on `?`. It also listens on every interface again, as react-email's preview did, so a phone or a browser outside a container can open it. - The magic-link sample had no `code`, a variant production never sends, so the code block was neither previewed nor checked. It now has one, and the render check looks for it. - Each sample now carries the strings its render must contain, so adding a template is one edit in scripts/lib/email-samples.ts. - worker-render.test.ts checks that `email:dev` uses the worker's tsx flags, which is what its "renders as the worker sends it" relies on. - The global `next` override goes. It only kept react-email 3's own Next.js in line, and pnpm applies overrides to direct dependencies too, so it would have overruled a hand-made bump of `next`. The lockfile still resolves next 15.5.28. Also merges main (Magic Compose questions, #572-#688). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GLSJgi5BBQ8kdiDBG6Cbq
Part of #570, the first of six stacked PRs. It's independent of the rest and safe to merge on its own.
The problem
The fix
details.bucketanddetails.retryAfterSecondsand says "You've used this hour's AI drafts. Try again in 12 minutes, or fill it in by hand." "fill it in by hand" links to the manual form. It says "1 minute", not "1 minutes", and drops the server's "wait Ns and retry".llmErrorCode: 'rate_limited') reads "The AI service is busy. Try again in a minute." When the provider asks for longer, it names the wait ("Try again in 10 minutes."), so the page doesn't invite a retry that spends another draft on a refusal. Any other rate limit keeps its own message.consumeRateLimitand the API's error are as before. The wording lives insrc/components/magic-compose/draft-errors.ts.src/lib/magic-compose/limits.ts, which has no imports.rate-limit.tskeeps its own copy, written out, and a test keeps the two equal.Tests
draft-errors.test.tscovers:MagicComposeRoot.test.tsxrenders the page with a stubbedfetch:pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.Tophat
This branch on its own, against a local fake OpenAI-compatible endpoint:
Running the page found one bug, fixed in 0783930: the privacy sentence ran the site name into the next word ("OpenSignup (local)sends").
Reviews
A second review (
/code-review), fixed in 98bdac7:The owner's tophat, fixed in a049c58: the privacy page's "Last updated" hadn't moved.
Left as is:
Size
/app/signups/newstays within its 114 kB budget here.main(through #683) is merged in.The stack
Each PR is based on the one before. Nothing asks questions until #577; merge #576, #577 and #688 together.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UW9ZpEu4MWkeqTv2Qe14ks