mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 20:09:33 +01:00
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - In the `free_inference_1` onboarding flow, `OnboardingWizard` skips
Step 4 ("Connect a model") and hires the first agent directly on starter
inference when the user submits Step 3.
> - However, Step 3's early-setup effect still auto-created a
provisional `General` draft agent (`pauseReason: "setup"`, `adapterType:
"process"`) as soon as Step 3 mounted, even though Step 4 login is never
used in `free_inference_1`.
> - If the user reloaded or navigated to the Dashboard before submitting
Step 3, that orphaned `pauseReason: "setup"` draft prevented onboarding
from re-opening and caused `Dashboard.tsx` to show "All agents in this
organization are paused — nothing will run."
> - This pull request skips Step 3 early-setup draft creation while
`free_inference_1` is active (or while the onboarding variant/status
queries are still pending) and filters out unfinished `pauseReason:
"setup"` drafts and terminated agents in
`Dashboard.derivePausedAgentBanner` and `hasNoAgents`.
> - The benefit is a clean `free_inference_1` onboarding experience with
no orphaned paused drafts and accurate Dashboard empty-state banners.
## Linked Issues or Issue Description
**Subsystem affected**
`ui/` — React + Vite board UI
**Problem or motivation**
When a Cloud workspace is assigned to `free_inference_1`, opening Step 3
of `OnboardingWizard` immediately created an unfinished `General` draft
agent (`pauseReason: "setup"`, `adapterType: "process"`) meant only for
Step 4 provider login. Navigating to `/dashboard` before clicking "Start
chatting" left that orphaned draft in place and triggered the "All
agents in this organization are paused — nothing will run." warning
banner.
**Proposed solution**
- Add `shouldSkipEarlyOnboardingSetupDraft` in
`ui/src/lib/cloud-trial-gate.ts` and gate `OnboardingWizard`'s Step 3
early-setup effect on `!shouldSkipEarlyOnboardingSetupDraft({
isFreeInferenceOnboarding, onboardingVariantPending })`.
- Update `derivePausedAgentBanner` and `hasNoAgents` in
`ui/src/pages/Dashboard.tsx` to ignore unfinished `pauseReason: "setup"`
drafts and `terminated` agents.
- Add unit tests in `ui/src/pages/Dashboard.test.ts` and
`ui/src/components/CloudTrialGate.test.tsx`.
**Alternatives considered**
- Deleting the setup draft on wizard unmount was ruled out because
browser reloads or tab closes do not reliably run unmount cleanup, and
`free_inference_1` never needs a Step 3 setup draft in the first place.
## What Changed
- `ui/src/lib/cloud-trial-gate.ts`: Added
`shouldSkipEarlyOnboardingSetupDraft`.
- `ui/src/components/OnboardingWizard.tsx`: Tracked
`onboardingVariantPending` (`onboardingSessionPending` /
`cloudTrialStatusPending`) and gated the Step 3 early-setup draft
creation effect so `free_inference_1` never creates a provisional
`General` (`pauseReason: "setup"`) draft.
- `ui/src/pages/Dashboard.tsx`: Excluded `pauseReason: "setup"` drafts
and `terminated` agents from `derivePausedAgentBanner` and
`hasNoAgents`.
- `ui/src/pages/Dashboard.test.ts` &
`ui/src/components/CloudTrialGate.test.tsx`: Added unit test coverage.
## Verification
- `pnpm --filter @paperclipai/ui typecheck` (0 errors)
- `pnpm exec vitest run ui/src/pages/Dashboard.test.ts
ui/src/components/CloudTrialGate.test.tsx
ui/src/lib/onboarding-auto-open.test.ts` (24/24 passed)
## Risks
- Low risk: `baseline` onboarding behavior is unchanged once
`onboardingSession` resolves (a cached session query already loaded by
the app shell), and `Dashboard` still shows the all-paused banner
whenever real hired agents are paused.
## Model Used
- Google Gemini (Antigravity agentic coding environment with tool use
and local Vitest + TypeScript verification)
## 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
- [ ] All Paperclip CI gates are green
- [ ] 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: Paperclip <noreply@paperclip.ing>