mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
The agent, drawn as itself (#12274)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - A new customer's first session ends in the tenant's agent arc: create an agent, connect a model, review > - Walking it turned up questions the arc had no business asking — a role picker using a vocabulary the customer has not been given, a model picker asking them to judge models they have not met — and chrome restating what they had just watched happen > - Each one costs a first-session customer attention at the exact moment they are deciding what this product is > - This pull request cuts the arc to what it must ask, and draws the agent as itself so the arc has a visible subject > - The benefit is three steps that each ask one thing, ending on an agent that is visibly ready ## Linked Issues or Issue Description No public issue exists. The changes come from walking the sign-up arc end to end. **What happened:** The agent step asks for a role from a fixed enum before asking for a name. The model step shows two "Recommended" badges (on both options), an "Adapter type" eyebrow, and a model picker. The review step lists a three-row checklist of work the customer just performed. The progress strip is a full-width segmented bar. **Expected behavior:** The agent step asks for a name. The model step offers the two harnesses and hides the rest behind advanced settings. The review step says the agent is ready. The strip counts three discrete steps. **Steps to reproduce:** 1. Sign up and enter the tenant wizard on the agent arc. 2. Observe the role select above the optional name field. 3. Continue to the model step: both options carry a "Recommended" badge, and a model picker sits below. 4. Continue to review: a checklist restates the organization name, agent, and model. **Additional context:** The brand pill assets (`pill-1-dormant.svg`, `pill-1-alive.svg`) are transcribed verbatim into a component rather than approximated. The role removal exposed a latent silent-failure path — see Risks. ## What Changed - `PillGuy` renders the brand pill in two states; the arc holds one instance, dormant through create and connect, alive on review. - The agent step asks for a name only. The name is required; the role picker is gone. - `DEFAULT_AGENT_ROLE` (`general`) backs every onboarding hire, and `agentRole` now defaults to it rather than empty. - The model step drops both "Recommended" badges, the "Adapter type" eyebrow, and the model picker; "More Agent Adapter Types" becomes "Advanced settings"; the sub-line becomes "Paperclip works with your existing subscription or API keys." - The review step drops its checklist; the heading becomes "Let's get started..." with "[name] is ready to work!". - The progress strip renders three left-aligned dots at the previous gap. - Five e2e specs and both wizard unit suites migrate off `#onboarding-agent-role`. ## Verification Run the tenant suite: ``` cd ui && npx vitest run ``` - 4398 tests pass across 474 files; `npx tsc --noEmit` clean. - Walked live in a local instance: agent step (dots, dormant pill, name placeholder), model step (no badges/eyebrow/picker, "Advanced settings"), review (pill alive, new copy, no checklist). - The retargeted role test asserts the hire payload carries `role: "general"` and the typed name — it is the test that catches the silent failure below. ## Risks - **A latent silent failure, now closed.** `handleGiveHeartbeat` returns early when `agentRole` is empty. With the picker removed and no default, Connect would have hired nobody and shown no error. The default closes it; the guard stays for any future path that clears the role. - **Behavioral change:** every onboarding hire is filed as `general` rather than a chosen role. The role remains editable in the app. - **Behavioral change:** the model is no longer chosen during onboarding. Every adapter offered here resolves its own default in `buildAdapterConfig`, and the model is changeable later. - **Assets:** the pill carries its own gradient fills and does not follow the theme. That is deliberate — the agent looks like itself on either ground. ## Model Used Claude Opus 5 (`claude-opus-5`) via Claude Code, with tool use and code execution. ## 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 - [x] My branch name describes the change and contains no internal Paperclip ticket id - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] 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: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
24d639abad
commit
eb86fcd498
13 files changed
+481
-350
No files matched your search
@@ -5,6 +5,17 @@ import { AGENT_ROLE_LABELS, type AgentRole } from "@paperclipai/shared";
|
||||
* title rather than a role label because it reads as a person on the very
|
||||
* first screen where the agent appears.
|
||||
*/
|
||||
/**
|
||||
* The role every onboarding hire is filed under.
|
||||
*
|
||||
* The arc asks for a name, not a role: someone naming their first agent is
|
||||
* describing what it should do, and the placeholder carries the range of
|
||||
* answers that fit. `general` is the honest filing for that — it claims
|
||||
* nothing the customer did not say — and the role can be set later, in the
|
||||
* app, where the agent's work gives the choice meaning.
|
||||
*/
|
||||
export const DEFAULT_AGENT_ROLE = "general" as const;
|
||||
|
||||
export const DEFAULT_AGENT_NAME = "Chief of staff";
|
||||
|
||||
/**
|
||||
|
||||
@@ -272,6 +272,43 @@ describe("resolveRouteOnboardingOptions — the agent step", () => {
|
||||
expect(resolved!.initialStep).not.toBe(ONBOARDING_MISSION_STEP);
|
||||
});
|
||||
|
||||
it("never resolves into the create wizard on a managed stack", () => {
|
||||
// POST /companies is a 403 floor on Cloud-managed stacks — a create wizard
|
||||
// there is a dead end wearing a form. A managed stack holds exactly one
|
||||
// company, so the useful reading of a bare or unmatched onboarding path is
|
||||
// that company's agent arc.
|
||||
const one = [{ id: "c1", issuePrefix: "PC1" }];
|
||||
expect(
|
||||
resolveRouteOnboardingOptions({
|
||||
pathname: "/onboarding",
|
||||
companies: one,
|
||||
cloudManaged: true,
|
||||
}),
|
||||
).toEqual({ initialStep: ONBOARDING_AGENT_STEP, companyId: "c1" });
|
||||
expect(
|
||||
resolveRouteOnboardingOptions({
|
||||
pathname: "/NOPE/onboarding",
|
||||
companyPrefix: "NOPE",
|
||||
companies: one,
|
||||
cloudManaged: true,
|
||||
}),
|
||||
).toEqual({ initialStep: ONBOARDING_AGENT_STEP, companyId: "c1" });
|
||||
});
|
||||
|
||||
it("opens nothing on a managed stack whose companies are not exactly one", () => {
|
||||
// Zero companies means the list is still loading or errored — offering
|
||||
// creation would 403; opening an arc would name nobody. Do neither.
|
||||
for (const companies of [[], [{ id: "c1", issuePrefix: "PC1" }, { id: "c2", issuePrefix: "PC2" }]]) {
|
||||
expect(
|
||||
resolveRouteOnboardingOptions({
|
||||
pathname: "/onboarding",
|
||||
companies,
|
||||
cloudManaged: true,
|
||||
}),
|
||||
).toBeNull();
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps sending an unmatched prefix to company creation", () => {
|
||||
expect(
|
||||
resolveRouteOnboardingOptions({
|
||||
|
||||
@@ -79,12 +79,26 @@ export function resolveRouteOnboardingOptions(params: {
|
||||
pathname: string;
|
||||
companyPrefix?: string;
|
||||
companies: OnboardingRouteCompany[];
|
||||
/**
|
||||
* Whether this instance is a Cloud-managed stack. Company creation lives on
|
||||
* Cloud there — POST /companies is a 403 floor — so a route that cannot name
|
||||
* an existing company must never open the create wizard: it would be a dead
|
||||
* end wearing a form. A managed stack holds exactly one company, so the
|
||||
* useful reading of a bare `/onboarding` is that company's agent arc.
|
||||
*/
|
||||
cloudManaged?: boolean;
|
||||
}): { initialStep: 1 | ExistingCompanyOnboardingStep; companyId?: string } | null {
|
||||
const { pathname, companyPrefix, companies } = params;
|
||||
const { pathname, companyPrefix, companies, cloudManaged } = params;
|
||||
|
||||
if (!isOnboardingPath(pathname)) return null;
|
||||
|
||||
const managedFallback = (): { initialStep: ExistingCompanyOnboardingStep; companyId?: string } | null =>
|
||||
companies.length === 1
|
||||
? { initialStep: onboardingStepForCompany(), companyId: companies[0]!.id }
|
||||
: null;
|
||||
|
||||
if (!companyPrefix) {
|
||||
if (cloudManaged) return managedFallback();
|
||||
return { initialStep: 1 };
|
||||
}
|
||||
|
||||
@@ -95,6 +109,7 @@ export function resolveRouteOnboardingOptions(params: {
|
||||
) ?? null;
|
||||
|
||||
if (!matchedCompany) {
|
||||
if (cloudManaged) return managedFallback();
|
||||
return { initialStep: 1 };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user