mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 01:24:30 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Onboarding creates a company, names its first agent, and then connects the agent to an AI provider > - A plugin can manage an execution environment that its driver prepares for each agent (`requiresAgent`). The agent's lifecycle starts that preparation when the agent's setup draft exists > - Onboarding created the setup draft when the connect step opened, after the agent was named > - The preparation can be slow, and a subscription sign-in in that environment waits for it > - This pull request creates the setup draft in the naming step, so the preparation overlaps naming > - The benefit is a shorter wait before sign-in when the default environment is plugin-managed ## Linked Issues or Issue Description Refs #23312. **What existing behavior does this improve?** The onboarding naming step and the connect step for a new company. **Current behavior** The wizard creates the first agent's provisional setup draft when the connect step opens. A plugin-managed execution environment starts its preparation for the agent only then. A subscription sign-in in that environment waits for the full preparation (see #23312). **Proposed behavior** The wizard creates the same provisional setup draft when the naming step opens for a company with no agents. The preparation runs while the user names the agent. **Reason and benefit** The preparation does not depend on the provider choice. A later configuration change prepares the same environment again, which is fast because the environment already exists. The user waits less before sign-in. ## What Changed - The naming step creates the provisional setup draft as soon as a company with no agents exists. The draft is the same record the connect step created before: a provisional adapter, `setupAdapterPending`, and the role label as a placeholder name. - The naming step saves the typed name to the draft after a 400 ms pause in typing. The connect step saves it at once, as before. - A company that has agents keeps the old path, so the connect step's same-name reuse still applies. A failed early create also falls back to the connect step. The wizard tries the early create once per company. - When the connect step restores a provisional draft (source still pending), the wizard keeps its own name, role and appearance when it has a name. A name typed after a reload in the naming step is newer than the draft's name. - The `create-company path` e2e test now expects the draft when the naming step opens. A new e2e test covers the early draft, the saved name, a reload in the naming step, and that the connect step adopts the same record. ## Verification - `pnpm typecheck` in `ui/`: no errors. - `PAPERCLIP_PLAYWRIGHT_CHANNEL=chrome npx playwright test --config tests/e2e/playwright.config.ts tests/e2e/onboarding-early-setup.spec.ts tests/e2e/onboarding.spec.ts -g "naming step creates|create-company path"`: 2 tests pass. - The new `onboarding-early-setup` test fails without the wizard change: it times out while it waits for the draft in the naming step. - I did not measure the time saved on a live plugin-managed execution environment. It is about the time the user spends in the naming step. ## Risks - A user who stops onboarding in the naming step leaves a setup draft. In a plugin-managed execution environment, that draft also keeps its prepared environment. Before this change, the same happened to a user who stopped in the connect step. - The draft's name is the role label until the first save in the naming step. A reload in the first 400 ms after typing can lose those characters. The wizard keeps the name that is typed after the reload. - No migration and no API change. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool use (code search, shell, tests) in Claude Code. ## 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 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>