Files
PaperClipAI/doc/testing/onboarding-first-chat-test-drive.md
T
scotttongandScott Tong fb6632530d feat(onboarding): start the first chat with a welcome and choices (#23334)
## Thinking Path

> - Paperclip helps people assign and track work with AI agents.
> - Onboarding connects the first agent and opens its chat.
> - A new user needs a clear way to start a conversation.
> - A saved welcome can appear as soon as chat opens.
> - The standard question card lets the user pick a goal, a product
overview, or a task.
> - The connected model replies after the user sends the choice.

## Linked Issues or Issue Description

**Subsystem affected**

Onboarding, agent chat, and subscription sign-in.

**Problem or motivation**

New users can land in a chat before they know what to ask. The original
welcome depended on a model run, which could delay the first
interaction. Local Claude sign-in could lose its code field if the
browser reloaded the onboarding tab during authorization.

**Proposed solution**

Save a personalized welcome and a standard question card. Type the
welcome when the chat opens, then show the card above the composer. Use
the choice and any task description to guide the connected model. Resume
the local Claude sign-in attempt when the onboarding tab reloads.

**Alternatives considered**

A model-written welcome can vary, but it adds a model call before the
user has chosen what to do. The saved welcome gives the user the same
starting points each time.

**Roadmap alignment**

This improves the existing first-agent flow for local and Cloud-managed
instances.

Related PRs: #22433 covers clearing the organization name after Back.
#23326 adds the separate Cloud mobile-to-desktop handoff.

## What Changed

- Save the greeting and question card together. Reuse the saved chat on
entry and keep the transcript in order after a reload.
- Type the greeting in the chat and reveal the standard question card
above the composer. Honor reduced motion.
- Collect a task description before starting the first model turn for
the task option. Guide the first reply for each choice.
- Restore the original local Claude sign-in attempt when the onboarding
tab reloads. Show progress while it connects, and offer retry on a
failed or stalled code exchange.
- Update the organization name helper text and the onboarding
walkthrough tests.

## Verification

- See the first-chat test drive for manual steps and the credential-free
browser fixture.
- 659 focused Vitest tests passed, with one skipped. The UI and server
typechecks and the feature map validator passed.
- All 18 Chromium tests passed across the first-chat, onboarding,
sign-in resume, and mobile desktop handoff specs. Coverage includes the
saved greeting, chat ordering, question handoff, Claude code submission
and resume, and the Cloud-managed starter model path with scripted
replies.
- The published Cloud service and live subscriber credentials need
separate acceptance testing.

## Risks

- The greeting uses the existing conversation and interaction records.
No database migration is needed.
- Existing in-flight model greetings can finish through the previous
path.
- The Claude PTY change depends on the CLI's bracketed-paste support.
The runner preserves separate input writes for terminals that do not
announce support.

## Model Used

OpenAI Codex, GPT-6.2 Sol and GPT-6.2 Astra, with terminal and browser
tooling.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Scott Tong <1504818+scotttong@users.noreply.github.com>
2026-11-30 23:01:24 +00:00

3.2 KiB
Raw Blame History

First agent chat: manual test drive

Run this prototype from the first-chat greeting worktree, on a fresh loopback instance. Do not use your normal Paperclip database.

pnpm install --frozen-lockfile
PAPERCLIP_TELEMETRY_DISABLED=1 PORT=3812 pnpm dev:once --data-dir ./tmp/first-chat-preview

Open the /onboarding route in the local instance. If the local instance has not been set up, use the repository's normal local setup, or use the credential-free fixture below. Only enter model credentials on a trusted instance you control.

Fast and slow arrival

  1. Create a fresh organization and name the first agent. Connect a test model. On Review, leave the wizard open for a few seconds. There should be no welcome text or question card on that screen.
  2. Click Get started. Watch the chat surface as it opens. After a short beat, the welcome should type into its agent bubble, a few characters at a time. Once the last character is visible, the native question card should fade and rise separately. The composer stays available throughout.
  3. Verify that the choices appear in this order: Interview me about my goals, Tell me what Paperclip can do, and Help me accomplish a task.
  4. Pick Interview me about my goals and Continue. The answer should be recorded once and the agent should start the interview, not create a task. Reload. The transcript should still show the welcome, your selection, and the agent’s reply in that order, with one copy of each. The intro plays once.
  5. Create another organization and click Get started immediately. The welcome uses the name you entered. The app saves it and the card together, with zero agent runs. Select Help me accomplish a task. A text field appears. Entering a description keeps the agent idle. Clicking Continue sends the selection to the connected agent for its first reply.
  6. Repeat with the system's reduced-motion preference turned on. The greeting and card should appear in that order with motion disabled.

To inspect timing, open DevTools → Network and filter for onboarding/greeting. The first POST should happen on Review, before you click Get started. A second POST after chat paints is an idempotent retry.

Credential-free interactive fixture

Run from the repository root.

PAPERCLIP_TELEMETRY_DISABLED=1 PAPERCLIP_FIRST_CHAT_MANUAL=1   pnpm exec playwright test --config tests/e2e/playwright.config.ts   conference-room-typing-intro.spec.ts -g 'warms the welcome' --debug

The script starts a separate loopback app and opens a headed browser with scripted model sign-in and scripted replies after submission. It uses the actual wizard, built-in personalized greeting, saved thread, and question response handler. When Playwright pauses, use the browser to follow the steps above. All three choices have scripted replies. After choosing one, type a follow-up such as “build a website” to receive the scripted acknowledgment. Reload and check that the messages keep their order. The fixture stops when Playwright exits.

To run the automated fast-arrival and delayed/reduced-motion checks without the inspector, omit PAPERCLIP_FIRST_CHAT_MANUAL and --debug, and select both tests with -g 'warms the welcome|welcome request is pending'.