Can you make to a public thread can also be marked as anyone without an account can reply
Public thread anyone can reply to
Plan: add a second, opt-in flag on public threads — anyone can reply — so a thread that's already public can also take replies from visitors without an account.
threads.anyone_can_replyboolean (drizzle/0007, default false). Only meaningful whilepublicis true; making a thread sign-in-only clears it.PATCH /api/threads/[id]accepts{ public?, anyoneCanReply? }(creator or workspace owner, samecanManageThreadrule). SettinganyoneCanReply: trueon a private thread is a 400.POST /api/threads/[id]/postslets an anonymous request through when the thread is public + anyone-can-reply. Guest posts getauthor_user_id = null,author_name= an optional display name (sanitised, ≤40 chars, default "guest") andmeta.guest = true. Guests can never tick Ask Claude, attach images, or start/fork threads; body capped at 4k chars.- Thread page: anonymous visitors get a slim guest Composer (name field + textarea, no run/model/attach controls). Guest posts render with a "guest" badge; the agent prompt marks them
guest="true"so Claude knows the author is unverified. ThreadVisibilitygains a second control next to "public": "sign in to reply · let anyone reply" (two-tap, like going public) / "anyone can reply · require sign-in".
No webhooks, no notification changes. I'll screenshot the meta line + guest composer with a static mockup.
threadide@f308f04Done — PR #57, branch thread/b5d355e8, commit f308f04.
What you get
A public thread can now also be marked anyone can reply. Visitors with no account then see a slim guest composer (optional name + textarea) and can post plain replies; everything else (new threads, Ask Claude, fork, image uploads) still needs a session.
In the thread's meta line (creator or workspace owner only), next to the existing public/sign-in-only switch:
sign in to reply · let anyone reply→ two-tap (red confirm, 4s), like going publicanyone can reply · require sign-in to reply→ one tap back- Switching the thread back to sign-in only also turns guest replies off (server side), so a private thread can never accept anonymous posts.
Everyone else sees public · anyone can reply as plain text. Guest posts carry a dashed GUEST badge and the name is self-declared; Claude's prompt tags them guest="true" so it doesn't treat an anonymous "osebo" as you.
How it's built
- DB:
threads.anyone_can_replyboolean, default false (drizzle/0007_anyone_can_reply.sql+ journal). Runs on the prod build when the PR merges, like 0006 did. - API:
PATCH /api/threads/[id]takes{ public?, anyoneCanReply? }(samecanManageThreadrule);anyoneCanReply: trueon a private thread → 400.setThreadPublicbecamesetThreadVisibilityinlib/data.ts. - Posting:
POST /api/threads/[id]/postsno longer hard-requires a session. With none,requireThreadGuestWriter(lib/session.ts) lets it through only when public + anyone-can-reply (401 otherwise). Guest posts:author_user_id NULL,author_name= sanitised name (lib/guest.ts: ≤40 chars,<>stripped, defaultguest),meta.guest = true, body ≤4k, askClaude/attachments rejected with 403.addHumanPostre-checks all of this so a route bug can't let a guest start a run. - UI:
Composerhas aguestprop (name field persisted in localStorage, no run/model/attach controls, "Post as guest"); it now also shows the API error under the form instead of silently failing — useful when an owner flips the flag off mid-draft.ThreadVisibilitygrew the second control. CSS:.badge.guest,.guest-nameinput,.compose-error.
Not covered / worth knowing
- No rate-limiting or captcha on guest posts — the thread owner is the spam control (flip it off). If a public thread gets abused, add a per-IP limit in the posts route.
- Guest replies still run through the triage decider and get embedded like any human post, so Claude can retrieve them as context later (tagged as guest).
- Verified with
tsconly (no DB/OAuth in the sandbox); the screenshot is a static mockup on the real stylesheet.
And this will work in replies with Claude?
Yes — with one deliberate limit. On the current branch (f308f04):
What works for guests + Claude
- Claude sees guest replies. They're regular human posts in the thread, so every run reads them in the transcript (
lib/context.ts), taggedguest="true"so Claude knows the author is an anonymous visitor and not a verified member. - Claude can answer a guest. Any member clicks Ask Claude (or Fork) on the guest's post — the existing per-post run route (
…/posts/[postId]/run) works on guest posts like any other; the triage tier was already computed when the guest posted. - Guests see Claude reply live. The SSE stream (
/api/threads/[id]/events) usesrequireThreadReadable, which lets anonymous visitors in on public threads, so the "Claude is working…" strip and the new post appear for them without reloading. - Guest posts also get embedded + decider-triaged like normal, so Claude can retrieve them as context in other threads later (still tagged guest).
What doesn't (on purpose)
- A guest can't trigger a run themselves — the guest composer has no Ask Claude checkbox and the API 403s
askClaudewithout a session (addHumanPostre-checks this too). Reason: a run is ~45 min of sandbox + model time on your GitHub token, with push access to your repos; opening that to anyone on the internet with no account and no rate limit is a spam/cost hole. So today: guest asks → a member presses Ask Claude → Claude replies, visible to the guest.
Want guests to summon Claude directly? If so, tell me which shape and I'll add it on this branch:
- Owner toggle — a third switch, "guests can ask Claude", off by default, only on public + anyone-can-reply threads. Plus a per-thread guest-run cap (e.g. max N guest-triggered runs per hour, one in flight at a time) so a drive-by can't drain the budget.
- Auto-run on every guest post when that toggle is on (no checkbox for guests — they just reply and Claude answers), same caps.
Or leave it member-gated as it is, in which case PR #57 is ready to merge as-is.
There’s no ask Claude check for anon repliers
Taking this as "add it": guests on a public + anyone-can-reply thread get an Ask Claude checkbox too (no extra owner toggle — turning on "anyone can reply" is the opt-in).
Guard rails, since a run spends the workspace owner's GitHub token + ~45 min of sandbox:
- server accepts guest
askClaudeonly when the thread is public + anyone-can-reply and has a workspace; - per thread: at most one guest-triggered run in flight and ≤3 guest-triggered runs per hour → 429 with a readable message shown under the composer;
- guests still get no model picker, no attachments, no fork/new-thread.
Touches app/api/threads/[id]/posts/route.ts, lib/data.ts (addHumanPost + a guestRunBudget check), lib/session.ts comments, components/composer.tsx. Will push to the same branch and open a follow-up PR.
threadide@c8215cdAdded — PR #58 on thread/b5d355e8, commit c8215cd (follows #57, which has merged).
What changed
On a public thread marked anyone can reply, a visitor without an account now sees the Ask Claude checkbox in the guest composer (button reads "Post as guest & run"). No extra toggle: switching on "anyone can reply" is the opt-in. Guests still get no model picker, no image attachments, and can't fork or start threads; the per-post Ask Claude / Fork buttons stay members-only because those routes need a session.
Guard rails (a run spends your GitHub token + up to ~45 min of sandbox)
guestRunBudget() in lib/data.ts, checked in the posts route and re-checked in addHumanPost:
- at most one guest-triggered run in flight per thread;
- at most 3 guest-triggered runs per rolling hour per thread (
GUEST_RUNS_PER_HOURinlib/guest.ts); - otherwise the API answers 429 with a plain-English reason, which the composer shows under the form (the reply isn't saved, so the guest can untick Ask Claude and post anyway).
"Guest-triggered" = jobs whose trigger post hasmeta.guest, so member runs don't eat the guest budget and vice versa. Threads without a workspace still can't run Claude for anyone.
Files
app/api/threads/[id]/posts/route.ts (guest askClaude path), lib/data.ts (guestRunBudget, addHumanPost check), lib/guest.ts (constant), app/threads/[id]/page.tsx (canAskClaude includes guests, new canRunPosts for PostView), components/composer.tsx, lib/session.ts (comments only).
Verified with tsc; no DB in the sandbox so the SQL for the budget query (count with filter (where …) over jobs ⋈ posts) is untested live — it's standard Postgres but worth one guest run after deploy. If 3/hour turns out too tight or too loose it's a single constant.
