Repository navigation
Description
Tracking issue for reducing clicks-to-activation in the /setup onboarding wizard, plus the defects found in a full cold-start walkthrough on prod (2026-08-06). The wizard shipped #1888 → #1895 (2026-07-23 → 2026-07-28) and works end-to-end today — a brand-new account reached a measured catalog and an enabled weekly task in ~7 minutes. The problem is no longer breakage, it's drop-off: 12 signups since the wizard went live, 0 activated.
Definition of "fully onboarded" (Sweets, 2026-08-06): an account has both a measured catalog and a recurring task. Task creation should be automatic — no explicit click — to raise activation rate.
Decision — cadence is monthly, anchored to creation time (Sweets, 2026-08-06). The auto-created task runs once per month, on the same date and time it was created — a task created 2026-08-14 at 15:20 UTC gets
20 15 14 * *. This supersedes the shipped wizard's weekly default (0 9 * * 1, verified on the walkthrough account), which was hardcoded to Monday 9am regardless of when the user onboarded. Row 1 therefore changes the default cron and all "every Monday" copy, not just the click.
Goal
A new signup reaches catalog-measured + recurring-task-enabled without clicking a task-creation button. Today /setup/tasks renders a Get this every Monday? prompt with Yes, every Monday / Not now; the task row in scheduled_actions is only written after that click, and the schedule is hardcoded weekly-Monday-9am. Target end state: the task is created as part of the first-report run, on a monthly cron anchored to the creation date/time, with the prompt demoted to an undo/opt-out affordance rather than a gate.
Secondary: remove the friction found alongside it — wrong empty-state copy on the first screen, a raw agent-log wall during report generation, and an error toast on cold load.
PRs (updated 2026-08-06)
| PR | Item | State |
|---|---|---|
| chat#TBD | Auto-create the recurring task on first-report completion — monthly cron anchored to creation date/time (m H D * *); demote the confirm prompt to opt-out |
⏳ not started |
| chat#TBD | Fix /setup/artists zero-artist copy (Add another artist → Add your first artist; disabled primary CTA) |
⏳ not started |
| chat#TBD | Replace raw bash/tool-log stream on /setup/tasks with progress states |
⏳ not started |
| chat#TBD | Fix An error occurred, please try again! toast on every page load — GET /api/accounts/undefined/credits 400s twice |
⏳ not started |
| chat#TBD | Render ask_user_question in the chat UI + wire addToolResult reply path |
⏳ not started |
| api#TBD | Default multiSelect in the ask_user_question schema so first calls stop being rejected |
⏳ not started |
| api#TBD | Record accountId + rejection reason in logEmailAttempt on the rejected path |
⏳ not started |
| chat#TBD | Instrument /setup step transitions so drop-off is measurable per step |
⏳ not started |
Merge sequencing: rows 2–4 are independent and can land in any order. Row 1 depends on the cadence decision above. Row 5 depends on row 6 (fix the schema before building the UI against it). Row 7 is independent and should land first of the api rows — it is the prerequisite for diagnosing the delivery failures in the "Delivery" bucket.
What shipped (context)
The wizard is four steps under app/setup/: artists → socials → valuation → tasks. Shipped across four PRs, 2026-07-23 → 2026-07-28:
- #1888
a2d8cf8b— add/setuppages for welcome-email links - #1887
7168ac66— retire/onboarding/*into/setup/* - #1890
830b6eb7— converge home onto/setupat the derived step - #1895
d0913d1e— end setup on the catalog valuation
Cohort since the wizard went live (Privy signups joined to scheduled_actions, internal/test addresses excluded):
| Cutoff | Signups | With enabled task |
|---|---|---|
| since 2026-07-23 (wizard live) | 12 | 0 |
| since 2026-07-28 (on home) | 5 | 0 |
For contrast, historical activation: of 48 real customers who ever created a task, 17 did it within 7 days of signup. The last same-week activation was info@justpushplay.co.uk on 2026-03-23.
Done
-
Verify the wizard works end-to-end on prod from a cold start.
✅ Verified 2026-08-06 onchat.recoupable.dev, brand-new Privy accountsweetman+aug520261141@recoupable.com(account8ea115ef-14b4-4b2a-b6e1-405e0a89cdb6).
Cleared storage, confirmed logged out on bothrecoupable.devandchat.recoupable.dev, signed up via Privy OTP, then walked all four steps. Spotify search returned the correct artist (Del Water Gap, 319.3K followers) as the first result; 1 social profile matched; valuation returned $2.1M (range $1.4M–$2.9M, 67 tracks measured); the first weekly report generated and emailed successfully;Yes, every Mondaycreated the task.
Verified inscheduled_actions:title="Weekly Catalog Report: Del Water Gap",schedule="0 9 * * 1",enabled=true. Three distinct emails sent, no duplicates:Welcome to Recoup(00:52:03),Your catalog valuation is ready(00:53:08),Del Water Gap - Weekly Streaming Report(00:56:01, Resend67aa2cf3-8a39-4533-8099-dd7b5385d9a7). Test task subsequently disabled viaPATCH /api/tasks {enabled:false}. -
Rule out "the April migration deleted the task tool" as the cause of the activation gap.
✅ Verified 2026-08-06.create_taskis live on the production MCP server —tools/listagainsthttps://api.recoupable.dev/mcpwith a validrecoup_sk_key returns 36 tools includingcreate_task,update_task,delete_task, correctly schema'd. The tool was never lost in the #1697lib/tools/deletion; task creation via API works.
Open — activation (reduce clicks)
-
Auto-create the recurring task when the first report finishes, monthly on the creation date/time. (row 1)
- Why:
/setup/tasksgates task creation behindGet this every Monday?→Yes, every Monday. The user has already clickedSet up your weekly reportto get there and waited ~4 minutes for the report — the second confirmation asks them to opt in to the thing they just asked for. Per the 2026-08-06 decision, catalog + recurring task is the definition of onboarded, so the click is pure funnel loss. The schedule is also currently hardcoded to Monday 9am (0 9 * * 1) regardless of when the user onboards. - Fix:
- On successful first-report completion, create the
scheduled_actionsrow automatically — no click. - Derive the cron from creation time:
m H D * *whereD/H/mare the day-of-month, hour, and minute the task was created. Created 2026-08-14 15:20 UTC →20 15 14 * *. - Replace the prompt with a confirmation + undo (
Runs monthly on the 14th · Change / Turn off). - Update all "every Monday" / "weekly report" copy on
/setup/tasksand the valuation CTA to the monthly wording. - Ensure
Skip for nowstill exits without creating a task.
- On successful first-report completion, create the
- Done when: a fresh account that completes
/setup/taskshas anenabled=truerow inscheduled_actionswith zero clicks after the CTA; itsschedulematches the creation timestamp's day/hour/minute; and the confirmation UI turns it off in one click. - Edge case to decide: creation on the 29th/30th/31st. A literal
0 9 31 * *only fires in 7 months of the year, and29/30skip February — so an account onboarding late in the month would silently get a task that rarely (or never, for Feb 30/31) runs. Options: clampDto 28, or clamp to the last valid day of each month at run time. Pick one before implementing; do not ship the naive value.
- Why:
-
Fix the zero-artist empty state on
/setup/artists. (row 2)- Why: with an empty roster the screen reads
No artists on your roster yet. Add your first artist below…but the button underneath saysAdd another artist(there is no first one) and the primary CTA saysThis is my artist, continuewhile disabled (there is no artist). The copy was written for the pre-populated case. It self-corrects once an artist is added — but the broken version is the literal first screen a new account sees. - Fix: branch the empty state — button
Add your first artist, and either hide the primary CTA or relabel it untilartists.length > 0. - Done when: a fresh account at
/setup/artistssees no copy referring to an artist that doesn't exist, and no disabled primary CTA.
- Why: with an empty roster the screen reads
-
Replace the raw agent-log stream on
/setup/taskswith progress states. (row 3)- Why: after
Set up your weekly report, the user watches ~4 minutes of raw tool output — repeatedbash/Data processedblocks interleaved with"Let me check the response structure more carefully:"and"Let me use curl to get track data:". This is the highest-intent moment in the funnel rendered as a debug console. Strongest candidate for the 12→0 drop-off. - Fix: map agent steps to user-facing progress (
Measuring 36 albums…,Gathering audience metrics…,Building your report…), keep the raw log behind aShow detailsdisclosure. - Done when: no raw
bashinvocation or tool-name text is visible on/setup/tasksby default, and the step indicator advances at least 3 times during generation.
- Why: after
-
Fix the
An error occurred, please try again!toast that fires on every page load. (row 4) — affects all customers, not just new signups- Why: reported by Sweets 2026-08-06 as happening "every time I land on the home page of the chat app". Confirmed on both paths: logged-out cold load (storage cleared, reproduced 2026-08-05 and 2026-08-06) and authenticated load — polled the DOM at 250ms intervals on a signed-in load of
chat.recoupable.devand the toast was present from 0ms through 2250ms (10 consecutive samples). It is not an onboarding-only bug; every customer eats it on every visit. - Root cause (traced 2026-08-06): the page fires
GET https://api.recoupable.dev/api/accounts/**undefined**/creditsand gets a 400 — twice per load (once before and once afterPOST /api/accountsresolves). The account id in the path is the literal stringundefined.- The only builder for that URL is
lib/recoup/getAccountCredits.tsL21, whose sole caller ishooks/useCredits.ts. - That hook has a guard —
enabled: authenticated && !!userData?.account_id— so a genuinelyundefinedvalue would disable the query. The guard passing while the URL rendersundefinedmeansuserData.account_idis the string"undefined", which is truthy. Theas stringcast on L18 hides it from the type checker.
- The only builder for that URL is
- Fix: 1) Find where
userData.account_idis assigned the string"undefined"(suspect a template-literal or storage round-trip in the account-bootstrap path aroundproviders/UserProvder.tsx/POST /api/accounts) and stop producing it. 2) Harden theuseCreditsguard to reject non-UUID values rather than relying on truthiness, and drop theas stringcast. 3) Confirm the failed credits fetch is what surfaces the toast, and make a credits failure non-blocking regardless. - Done when: a hard reload of
chat.recoupable.dev— logged in and logged out — shows zero/api/accounts/undefined/creditsrequests in the network panel and no error toast at any point during load.
- Why: reported by Sweets 2026-08-06 as happening "every time I land on the home page of the chat app". Confirmed on both paths: logged-out cold load (storage cleared, reproduced 2026-08-05 and 2026-08-06) and authenticated load — polled the DOM at 250ms intervals on a signed-in load of
-
Instrument
/setupstep transitions. (row 8)- Why: 12 signups since the wizard shipped and 0 activated, but there is no per-step data — we cannot tell whether people bounce at the artist search, the 4-minute report wait, or the final prompt. Every fix above is currently a hypothesis.
- Fix: emit an event per step entry/exit (
setup_artists_viewed,setup_tasks_report_started,setup_tasks_report_completed,setup_task_created,setup_skippedwith the step it was skipped from). - Done when: a funnel query returns counts per step for a date range, and the biggest single drop is identifiable.
Open — free-form chat path to task creation
The wizard routes around this, but a user who asks for a recurring report in chat instead of via /setup hits a dead end.
-
Render
ask_user_questionin the chat UI and wire the reply path. (row 5)- Why:
apioffersask_user_questionto the agent wheneverinteractiveis true, which defaults to true (api/lib/agent/buildAgentTools.tsL43-58). The file's own docblock states the contract: "no server execute; chat UI fulfills it and the next workflow turn sees the answer in messages." The chat repo has zero references toask_user_question, and zero toaddToolResult/onToolCall(the AI SDK mechanism for answering client-side tools).components/VercelChat/ToolComponents.tsxdispatches on 26 tool names; this is not one of them, and there is no fallback branch. The tool can never be fulfilled. - Reproduced 2026-08-06 on prod against a fresh account (
agent+aug5onboardprobe@recoupable.com) viaPOST /api/chatwith the prompt "Send me a weekly email report about my catalog every Monday morning." Trace:skill✓ →ask_user_question(input error) →ask_user_question(accepted) →error: "Tool result is missing for tool call toolu_01QWzbNjEsshfcvPEZ1hhyuX."×4 → turn dies. Final statetasks: [];create_taskwas never called. - Fix: add a renderer for
ask_user_questioninToolComponents.tsxand submit the selection back viaaddToolResultso the next workflow turn sees the answer. - Done when: in chat, asking for a recurring report produces an answerable question UI, and answering it results in an
enabled=truerow inscheduled_actions.
- Why:
-
Default
multiSelectin theask_user_questionschema. (row 6)- Why: in the same trace the model's first
ask_user_questioncall was rejected withtool-input-errorfor omitting the requiredmultiSelectfield; it self-corrected on retry. A required boolean with an obvious default costs a round trip on every question. - Fix: give
multiSelecta default offalsein the tool's input schema so omission is valid. - Done when: a question payload without
multiSelectvalidates, and the retry disappears from traces.
- Why: in the same trace the model's first
Open — delivery (separate concern, blocks diagnosis)
- Record
accountIdand the rejection reason inlogEmailAttempt. (row 7)- Why:
email_send_logshows 434 sent / 891 rejected over 2026-07-22 → 2026-08-05, but every rejected row hasaccount_id = NULLand no error — because the reject path logsattempt = { status: "rejected" }with neither field (api/lib/emails/sendEmailHandler.tsL59;EmailAttemptLoginapi/lib/emails/logEmailAttempt.ts). The NULL is an artifact of the logging code, not a signal. We currently cannot determine why a single one of the 891 failed. - Rejects cluster in daily bursts at ~10:00–10:08 UTC. Sample window 2026-07-30 09:55–10:20 UTC: 60 attempts, 0 sent, 60 rejected, first at
10:00:10, last at10:07:38— multiple different customers' tasks failing together, none delivered. Interleaved with the real payloads are the agent's own probes (test,auth test,auth test 2,auth test 3,ping,Auth probe), i.e. the sandbox agent reverse-engineering a failing endpoint and burning credits doing it. - Two candidates ruled out by reading the code: recipient case-sensitivity is handled (
assertRecipientsAllowed.tsL31-33 lowercases both sides), and missingtois not a failure —tois optional insendEmailBodySchemaand defaults to the account's own address. - Fix: pass
accountId(when auth resolved) and a reason code / first Zod issue intologEmailAttempton the rejected path; add a column or reuseraw_bodysidecar for the reason. - Done when: a new rejected row in
email_send_logcarries a non-null reason, and the 10:00 UTC cluster can be attributed to a specific failure class.
- Why:
Architecture decisions
create_taskis server-side and healthy; the gap is UI. The MCP server exposescreate_taskcorrectly andPOST /api/tasksworks. Every activation failure traced in this issue is a client-side gap (a missing renderer, a gating button, a log wall) — not a missing capability. Fixes belong inchat, notapi, except rows 6 and 7.ask_user_questionis a client-fulfilled tool by design. It intentionally has no serverexecuteso only a streaming UI can answer it, and it is withheld from headless runs (interactive: false) precisely because it would hang. That design is sound; the bug is that the interactive client was never built. Do not "fix" this by giving it a server execute.- The wizard deliberately bypasses
ask_user_question./setup/tasksuses purpose-built buttons rather than the generic question tool. Keep it that way — the wizard's conversion path should not depend on generic agent tooling.
Source references
- Wizard pages:
chat/app/setup/{artists,socials,valuation,tasks} - Tool dispatch:
chat/components/VercelChat/ToolComponents.tsx - Agent tool assembly:
api/lib/agent/buildAgentTools.ts,api/lib/chat/setupToolsForRequest.ts - Email logging:
api/lib/emails/{sendEmailHandler,logEmailAttempt,validateSendEmailBody,assertRecipientsAllowed}.ts - Prior onboarding tracker: chat#1889 / chat#1911
Test debris from the 2026-08-06 walkthrough (not auto-cleaned): accounts 8ea115ef-14b4-4b2a-b6e1-405e0a89cdb6 (sweetman+aug520261141@…, task disabled) and fd1c6962-5fb7-4ee8-9dc7-b15b7d7ff534 (agent+aug5onboardprobe@…, no tasks), plus their auto-provisioned repos recoupable/8ea115ef-… and recoupable/fd1c6962-… — repo deletion needs a token with delete_repo scope.
Activity
sidneyswift commentedon Nov 6, 2026
The cold-load error toast is fixed (#1950), and the empty roster step now reads "Add your first artist".
The ask_user_question schema already defaults multiSelect to false; re-check whether that row is still real.
Still open: the task is not auto-created (onboarding still asks to confirm and schedules weekly on Mondays), chat has no UI for ask_user_question, rejected sends log no reason (same gap as #1949), and step instrumentation.
Let the schedule step see the live task state
sidneyswift commentedon Nov 8, 2026
Status: the recurring task is now created without a click (live).
Shipped in #2392, #2393 and #2394 (production
e22f99a):/setup/tasksschedules it monthly, on the creation date and time (Sweets' 2026-08-06 decision; confirmed by Sidney 2026-11-06). The 29th–31st become the 28th so it runs every month. With no browser timezone, the cron is built in UTC to match the API.Still open from this issue:
ask_user_question.