Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(platform): show expert job titles on the pill and ask for one when raising (#14707)

Ubbe2548f83a9687
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db.py b/autogpt_platform/backend/backend/api/features/experts/experts_db.py
index 89cfbd7677..2ccf96a516 100644
--- a/autogpt_platform/backend/backend/api/features/experts/experts_db.py
+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db.py
@@ -453,7 +453,7 @@ async def list_expert_identities(user_id: str) -> list[ExpertIdentity]:
return await query_raw_with_schema(
"""
SELECT "id", "name", "avatarUrl" AS "avatar_url", "color", "role",
- "isArchived" AS "is_archived"
+ "jobTitle" AS "job_title", "isArchived" AS "is_archived"
FROM {schema_prefix}"Expert"
WHERE "ownerUserId" = $1 AND "isTemplate" = false
""",
@@ -1096,6 +1096,7 @@ async def create_raised_expert(
role: str | None,
voice_preferences: str | None,
*,
+ job_title: str | None = None,
avatar_url: str | None = None,
color: str | None = None,
tagline: str | None = None,
@@ -1117,6 +1118,7 @@ async def create_raised_expert(
name,
role,
voice_preferences,
+ job_title=job_title,
avatar_url=avatar_url,
color=color,
tagline=tagline,
@@ -1201,6 +1203,7 @@ async def _create_raised_expert_row(
role: str | None,
voice_preferences: str | None,
*,
+ job_title: str | None = None,
avatar_url: str | None,
color: str | None,
tagline: str | None = None,
@@ -1228,6 +1231,7 @@ async def _create_raised_expert_row(
"avatarUrl": avatar_url,
"color": color or "",
"role": role or "",
+ "jobTitle": job_title,
"tagline": tagline,
"identity": about or _raised_identity(name),
"voicePreferences": voice_preferences or "",
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
index c8f90bfa97..f4506bc5cd 100644
--- a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
@@ -786,9 +786,11 @@ async def test_raise_expert_persists_avatar_and_color(server: SpinTestServer):
avatar_url="https://storage.googleapis.com/bucket/nova.png",
color="sky-300",
tagline="Finds your leads and their decision-makers.",
+ job_title="Sales Development Rep",
)
assert raised.expert.avatar_url == "https://storage.googleapis.com/bucket/nova.png"
assert raised.expert.color == "sky-300"
+ assert raised.expert.job_title == "Sales Development Rep"
assert raised.expert.tagline == "Finds your leads and their decision-makers."
reloaded = await experts_db.get_expert(owner.id, raised.expert.id)
@@ -796,6 +798,7 @@ async def test_raise_expert_persists_avatar_and_color(server: SpinTestServer):
assert reloaded.avatar_url == "https://storage.googleapis.com/bucket/nova.png"
assert reloaded.color == "sky-300"
assert reloaded.tagline == "Finds your leads and their decision-makers."
+ assert reloaded.job_title == "Sales Development Rep"
@pytest.mark.asyncio(loop_scope="session")
@@ -1658,7 +1661,15 @@ def test_expert_identity_projection_columns_exist_in_schema():
model = re.search(r"^model Expert \{(.*?)^\}", schema, re.S | re.M)
assert model is not None, "Expert model not found in schema.prisma"
fields = set(re.findall(r"^\s{2}(\w+)", model.group(1), re.M))
- assert {"id", "name", "avatarUrl", "color", "role", "isArchived"} <= fields
+ assert {
+ "id",
+ "name",
+ "avatarUrl",
+ "color",
+ "role",
+ "jobTitle",
+ "isArchived",
+ } <= fields
assert {"ownerUserId", "isTemplate"} <= fields
diff --git a/autogpt_platform/backend/backend/api/features/experts/models.py b/autogpt_platform/backend/backend/api/features/experts/models.py
index ce6942784c..5533b761ff 100644
--- a/autogpt_platform/backend/backend/api/features/experts/models.py
+++ b/autogpt_platform/backend/backend/api/features/experts/models.py
@@ -128,6 +128,7 @@ class ExpertIdentity(BaseModel):
avatar_url: str | None
color: str | None = None
role: str
+ job_title: str | None = None
is_archived: bool
diff --git a/autogpt_platform/backend/backend/api/features/experts/routes.py b/autogpt_platform/backend/backend/api/features/experts/routes.py
index 3adaf52e06..5cbd349722 100644
--- a/autogpt_platform/backend/backend/api/features/experts/routes.py
+++ b/autogpt_platform/backend/backend/api/features/experts/routes.py
@@ -103,6 +103,7 @@ class AssignPodRequest(BaseModel):
class CreateRaisedExpertRequest(BaseModel):
name: str = Field(min_length=1, max_length=100)
role: str | None = Field(default=None, max_length=100)
+ job_title: str | None = Field(default=None, max_length=100)
avatar_url: str | None = Field(
default=None, max_length=EXPERT_AVATAR_URL_MAX_LENGTH
)
@@ -134,11 +135,11 @@ class CreateRaisedExpertRequest(BaseModel):
def check_avatar_url(cls, value: str | None) -> str | None:
return validate_avatar_url(value)
- @field_validator("color", "about")
+ @field_validator("job_title", "color", "about", mode="before")
@classmethod
- def strip_optional_text(cls, value: str | None) -> str | None:
- if value is None:
- return None
+ def strip_optional_text(cls, value: object) -> object:
+ if not isinstance(value, str):
+ return value
return value.strip() or None
@@ -221,6 +222,7 @@ async def create_raised_expert(
request.name,
request.role,
request.voice_preferences,
+ job_title=request.job_title,
avatar_url=request.avatar_url,
color=request.color,
about=request.about,
diff --git a/autogpt_platform/backend/backend/api/features/experts/routes_test.py b/autogpt_platform/backend/backend/api/features/experts/routes_test.py
index 4acfe445b9..88ea3b43ce 100644
--- a/autogpt_platform/backend/backend/api/features/experts/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/routes_test.py
@@ -373,6 +373,7 @@ def test_create_raised_expert_returns_expert(
"Otto",
None,
None,
+ job_title=None,
avatar_url=None,
color=None,
about=None,
@@ -409,6 +410,7 @@ def test_create_raised_expert_passes_role_voice_budget_and_attachments(
json={
"name": "Nova",
"role": "Research Assistant",
+ "job_title": " Market Research Analyst ",
"voice_preferences": "Warm and detailed.",
"weekly_budget": 250,
"attachments": [
@@ -429,6 +431,7 @@ def test_create_raised_expert_passes_role_voice_budget_and_attachments(
"Nova",
"Research Assistant",
"Warm and detailed.",
+ job_title="Market Research Analyst",
avatar_url=None,
color=None,
about=None,
@@ -444,6 +447,28 @@ def test_create_raised_expert_passes_role_voice_budget_and_attachments(
)
+def test_create_raised_expert_trims_job_title_before_length_check(
+ mocker: pytest_mock.MockerFixture,
+) -> None:
+ mock_create = mocker.patch(
+ "backend.api.features.experts.routes.experts_db.create_raised_expert",
+ new_callable=AsyncMock,
+ return_value=RaiseResult(
+ expert=_make_raised_expert(id="raised-3", name="Nova"),
+ failed_attachments=[],
+ ),
+ )
+ job_title = "j" * 100
+
+ response = client.post(
+ "/experts/raise",
+ json={"name": "Nova", "job_title": f" {job_title} "},
+ )
+
+ assert response.status_code == 200
+ assert mock_create.await_args.kwargs["job_title"] == job_title
+
+
def test_create_raised_expert_forwards_about(
mocker: pytest_mock.MockerFixture,
test_user_id: str,
@@ -468,6 +493,7 @@ def test_create_raised_expert_forwards_about(
"Nova",
None,
None,
+ job_title=None,
avatar_url=None,
color=None,
about="Always cites a source.",
@@ -519,6 +545,7 @@ def test_create_raised_expert_reports_attachment_installation_failure(
"Nova",
None,
None,
+ job_title=None,
avatar_url=None,
color=None,
about=None,
@@ -582,6 +609,7 @@ def test_create_raised_expert_passes_avatar_and_color(
"Nova",
None,
None,
+ job_title=None,
avatar_url="https://storage.googleapis.com/bucket/nova.png",
color="sky-300",
about=None,
@@ -657,6 +685,7 @@ def test_create_raised_expert_treats_blank_avatar_and_color_as_unset(
assert response.status_code == 200
assert mock_create.await_args.kwargs == {
+ "job_title": None,
"avatar_url": None,
"color": None,
"about": None,
@@ -862,6 +891,7 @@ def test_list_expert_identities_returns_lifetime_roster_projection(
"avatar_url": None,
"color": "orange-500",
"role": "Marketing Specialist",
+ "job_title": None,
"is_archived": True,
}
]
diff --git a/autogpt_platform/backend/backend/api/features/experts/seed.py b/autogpt_platform/backend/backend/api/features/experts/seed.py
index 6cdea43685..5bbcdd1b65 100644
--- a/autogpt_platform/backend/backend/api/features/experts/seed.py
+++ b/autogpt_platform/backend/backend/api/features/experts/seed.py
@@ -85,7 +85,7 @@ ROSTER: list[RosterEntry] = [
{
"name": "Maria",
"role": "SEO & Content",
- "job_title": "SEO Content Writer",
+ "job_title": "SEO Content Manager",
"tagline": "Takes a keyword from brief to publish-ready article, and reworks page copy to rank.",
"avatar_url": "/experts/maria.svg",
"bio": """I'm an SEO and content strategist — fifteen years across B2B SaaS and consumer brands — and I start with search intent, not keywords: what the person typing that phrase actually wants, and what shape of page gives it to them. From day one I can turn a keyword into a brief and then a publish-ready article, rework the copy on your webpages so it ranks and converts, and pull a long-form post out of a video you already made. Everything ships in clear, confident prose with the jargon stripped out.""",
diff --git a/autogpt_platform/backend/backend/copilot/tools/expert_change_test.py b/autogpt_platform/backend/backend/copilot/tools/expert_change_test.py
index 811717521e..0c1633e79d 100644
--- a/autogpt_platform/backend/backend/copilot/tools/expert_change_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/expert_change_test.py
@@ -46,6 +46,7 @@ _CONFIRM_MODULE = "backend.copilot.tools.confirm_expert_change"
_CHARTER = {
"name": "Otto",
"role": "Inbox triage",
+ "job_title": "Executive Assistant",
"tagline": "Sorts your morning inbox and drafts the routine replies.",
"color": "violet-300",
"avatar_glasses": "glasses",
@@ -585,6 +586,7 @@ class TestConfirm:
_CHARTER["name"],
_CHARTER["role"],
None,
+ job_title=_CHARTER["job_title"],
avatar_url=preview.preview.avatar_url,
color=_CHARTER["color"],
tagline=_CHARTER["tagline"],
diff --git a/autogpt_platform/backend/backend/copilot/tools/expert_proposal.py b/autogpt_platform/backend/backend/copilot/tools/expert_proposal.py
index 25cb4f950b..9397ed1b7a 100644
--- a/autogpt_platform/backend/backend/copilot/tools/expert_proposal.py
+++ b/autogpt_platform/backend/backend/copilot/tools/expert_proposal.py
@@ -380,6 +380,7 @@ async def _apply_raise(
preview.name,
preview.role or None,
preview.voice_preferences or None,
+ job_title=preview.job_title or None,
avatar_url=preview.avatar_url,
color=preview.color or None,
tagline=preview.tagline or None,
diff --git a/autogpt_platform/backend/backend/copilot/tools/models.py b/autogpt_platform/backend/backend/copilot/tools/models.py
index e2c3488da0..02753a92c5 100644
--- a/autogpt_platform/backend/backend/copilot/tools/models.py
+++ b/autogpt_platform/backend/backend/copilot/tools/models.py
@@ -593,6 +593,7 @@ class ExpertChangePreview(BaseModel):
kind: ExpertChangeKind
name: str
role: str = ""
+ job_title: str = ""
tagline: str = ""
about: str = ""
boundaries: str = ""
diff --git a/autogpt_platform/backend/backend/copilot/tools/raise_expert.py b/autogpt_platform/backend/backend/copilot/tools/raise_expert.py
index 8c67c0a236..2cf94e1268 100644
--- a/autogpt_platform/backend/backend/copilot/tools/raise_expert.py
+++ b/autogpt_platform/backend/backend/copilot/tools/raise_expert.py
@@ -71,6 +71,7 @@ class _RaiseParams(BaseModel):
name: str = Field(min_length=1, max_length=EXPERT_NAME_MAX_LENGTH)
role: str = Field(default="", max_length=EXPERT_NAME_MAX_LENGTH)
+ job_title: str = Field(default="", max_length=EXPERT_NAME_MAX_LENGTH)
tagline: str = Field(min_length=1, max_length=EXPERT_TAGLINE_MAX_LENGTH)
color: str = Field(default="", max_length=EXPERT_COLOR_MAX_LENGTH)
weekly_budget: int | None = Field(default=None, ge=0, le=WEEKLY_BUDGET_MAX_CREDITS)
@@ -99,12 +100,16 @@ class RaiseExpertTool(BaseTool):
"name": {
"type": "string",
"description": (
- "Personal first name, not a job title (use role for that)."
+ "Personal first name, not a job title (use job_title for that)."
),
},
"role": {
"type": "string",
- "description": "Short title for what they own.",
+ "description": "Short name for the area they own, e.g. 'SEO & Content'.",
+ },
+ "job_title": {
+ "type": "string",
+ "description": "What they would be called on a team, e.g. 'SEO Content Manager'.",
},
"tagline": {
"type": "string",
@@ -166,6 +171,7 @@ class RaiseExpertTool(BaseTool):
*,
name: str = "",
role: str = "",
+ job_title: str = "",
tagline: str = "",
color: str = "",
avatar_glasses: str = "",
@@ -215,6 +221,7 @@ class RaiseExpertTool(BaseTool):
# entries that ``escape_prompt_xml_tags`` cannot neutralise.
name=" ".join(name.split()),
role=" ".join(role.split()),
+ job_title=" ".join(job_title.split()),
tagline=" ".join(tagline.split()),
color=color,
weekly_budget=weekly_budget,
@@ -266,6 +273,7 @@ class RaiseExpertTool(BaseTool):
kind="raise",
name=params.name,
role=params.role,
+ job_title=params.job_title,
tagline=params.tagline,
color=params.color,
avatar_url=build_avatar_url(
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx
index dbc362a8e3..354a5cac3b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx
@@ -775,8 +775,8 @@ describe("ChatMessagesContainer — expert identity", () => {
const header = screen.getByTestId("expert-thread-header");
expect(within(header).getByText("Maria")).toBeDefined();
- expect(within(header).getByText(mariaExpert.role)).toBeDefined();
- expect(within(header).queryByText("Marketing Manager")).toBeNull();
+ expect(within(header).getByText("Marketing Manager")).toBeDefined();
+ expect(within(header).queryByText(mariaExpert.role)).toBeNull();
expect(within(header).getByRole("img", { name: "Maria" })).toBeDefined();
expect(screen.queryByTestId("expert-assistant-identity")).toBeNull();
});
@@ -872,12 +872,49 @@ describe("ChatMessagesContainer — expert identity", () => {
);
const header = screen.getByTestId("expert-thread-header");
- const chip = within(header).getByLabelText(`Maria — ${mariaExpert.role}`);
+ const chip = within(header).getByLabelText("Maria — Marketing Manager");
// A tooltip opens on focus as well as hover; an unfocusable trigger
// hides the role from keyboard users entirely.
expect(chip.getAttribute("tabindex")).toBe("0");
});
+
+ it("does not rewrite a job title that matches a special area", () => {
+ render(
+ <ChatMessagesContainer
+ messages={[assistantMessage]}
+ status="ready"
+ error={undefined}
+ isLoading={false}
+ expertIdentity={{
+ ...mariaIdentity,
+ jobTitle: "Social & Content Repurposing",
+ }}
+ />,
+ );
+
+ const header = screen.getByTestId("expert-thread-header");
+ expect(
+ within(header).getByText("Social & Content Repurposing"),
+ ).toBeDefined();
+ expect(within(header).queryByText("Social media")).toBeNull();
+ });
+
+ it("falls back to the default role when an expert has no title or area", () => {
+ render(
+ <ChatMessagesContainer
+ messages={[assistantMessage]}
+ status="ready"
+ error={undefined}
+ isLoading={false}
+ expertIdentity={{ ...mariaIdentity, role: null, jobTitle: null }}
+ />,
+ );
+
+ const header = screen.getByTestId("expert-thread-header");
+ expect(within(header).getByText("Head of AI")).toBeDefined();
+ expect(within(header).getByLabelText("Maria — Head of AI")).toBeDefined();
+ });
});
function RecipientPickerHarness() {
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx
index 3a6069a179..1680190673 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx
@@ -60,11 +60,13 @@ export function ThreadHeader({
// Otto's identity, which would be wrong for an expert session.
const isResolving = isResolvingExpertIdentity && !expertIdentity;
const name = expertIdentity?.name ?? "Otto";
- const role = expertIdentity
- ? getExpertRoleLabel(expertIdentity.role ?? "")
- : DEFAULT_EXPERT_ROLE;
+ const role = expertIdentity?.role ?? DEFAULT_EXPERT_ROLE;
+ const jobTitle = expertIdentity?.jobTitle;
+ const roleLabel = jobTitle || getExpertRoleLabel(role);
// Assistive tech gets a loading identity too, not Otto's.
- const identityLabel = isResolving ? "Loading expert" : `${name}, ${role}`;
+ const identityLabel = isResolving
+ ? "Loading expert"
+ : `${name}, ${roleLabel}`;
const isArtifactsEnabled = useGetFlag(Flag.ARTIFACTS);
// Only the copilot chat mounts the activity card. The builder and memory
// panels pass a live sessionId and aren't read-only, so without the host's
@@ -111,7 +113,12 @@ export function ThreadHeader({
<Skeleton className="h-3.5 w-16 rounded" />
) : (
<span className="min-w-0 max-w-[10rem]">
- <ExpertIdentityDetails name={name} role={role} size="compact" />
+ <ExpertIdentityDetails
+ name={name}
+ role={role}
+ jobTitle={jobTitle}
+ size="compact"
+ />
</span>
)}
{counters.map(({ icon, count, noun }) => (
@@ -159,7 +166,7 @@ export function ThreadHeader({
<div
tabIndex={0}
aria-label={
- isResolving ? identityLabel : `${name} — ${role}`
+ isResolving ? identityLabel : `${name} — ${roleLabel}`
}
className="flex min-w-0 items-center gap-2 rounded-full py-1 pl-1.5 pr-5"
>
@@ -172,7 +179,7 @@ export function ThreadHeader({
side="bottom"
className="bg-zinc-900 text-zinc-50 outline-none"
>
- {role}
+ {roleLabel}
</TooltipContent>
)}
</Tooltip>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
index 8de8ac6364..dc9e376fb2 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
@@ -463,7 +463,11 @@ export function ChatSidebar() {
<ExpertSessionGroup
key={groupKey}
groupKey={groupKey}
- role={group.expertId ? expert?.role : "Head of AI"}
+ role={
+ group.expertId
+ ? expert?.jobTitle || expert?.role
+ : "Head of AI"
+ }
label={
group.expertId ? (expert?.name ?? "Expert") : "Otto"
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts
index be73684580..5f5a6095f4 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts
@@ -15,6 +15,7 @@ export interface ExpertIdentity {
avatarUrl: string | null;
color?: string | null;
role: string | null;
+ jobTitle?: string | null;
isArchived: boolean;
readOnlyReason: ExpertReadOnlyReason | null;
}
@@ -97,6 +98,7 @@ export function useExpertMap() {
avatarUrl: expert.avatar_url ?? null,
color: expert.color ?? null,
role: expert.role,
+ jobTitle: expert.job_title ?? null,
isArchived: expert.is_archived,
readOnlyReason: expert.is_archived ? ("fired" as const) : null,
}));
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
index 326ee93914..37557250db 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
@@ -232,6 +232,28 @@ describe("Marketplace ExpertsSection", () => {
expect(within(card).queryByText("Content strategy")).toBeNull();
});
+ test("shows the job title on the card's pill, and the area when there is none", async () => {
+ server.use(
+ getListExpertTemplatesMockHandler([
+ { ...mariaTemplate, job_title: "SEO Content Manager" },
+ { ...mariaTemplate, id: "template-max", name: "Max", role: "Sales" },
+ ]),
+ getListExpertsMockHandler([]),
+ );
+
+ render(<MainMarkeplacePage />);
+
+ const maria = await screen.findByRole(
+ "link",
+ { name: /Maria/ },
+ { timeout: 5_000 },
+ );
+ expect(within(maria).getByText("SEO Content Manager")).toBeDefined();
+ expect(within(maria).queryByText("Marketing Strategist")).toBeNull();
+ const max = screen.getByRole("link", { name: /Max/ });
+ expect(within(max).getByText("Sales")).toBeDefined();
+ });
+
test("shows no skills row on a card without Hub skills", async () => {
server.use(
getListExpertTemplatesMockHandler([
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx
index 4750ecaca3..b1221f5b37 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx
@@ -42,7 +42,11 @@ export function ExpertCard({ expert, isHired }: Props) {
/>
<div>
- <ExpertIdentityDetails name={expert.name} role={expert.role} />
+ <ExpertIdentityDetails
+ name={expert.name}
+ role={expert.role}
+ jobTitle={expert.job_title}
+ />
<ExpertTagline tagline={expert.tagline} compact />
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx
index 161cfc6e3d..acc2d01cde 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx
@@ -23,6 +23,7 @@ export function ExpertPageHeader({ expert, actions }: Props) {
<ExpertIdentityDetails
name={expert.name}
role={expert.role}
+ jobTitle={expert.job_title}
size="page"
/>
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx
index 9599cc90a9..82f6bd8a3e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx
@@ -61,6 +61,7 @@ function seedAtAvatar(name = "Maria", color: string | null = "violet-300") {
step: "avatar",
hasStarted: true,
role: "marketer",
+ jobTitle: "Marketing Manager",
name,
color,
avatarUrl: null,
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
index b9ff1ba095..a5d498c4cd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
@@ -11,7 +11,12 @@ import userEvent from "@testing-library/user-event";
import { HttpResponse, http } from "msw";
import { afterEach, beforeEach, expect, test, vi } from "vitest";
import RaisePage from "../page";
-import { loadDraft, saveDraft, VOICE_SKIPPED_LABEL } from "../helpers";
+import {
+ EMPTY_DRAFT,
+ loadDraft,
+ saveDraft,
+ VOICE_SKIPPED_LABEL,
+} from "../helpers";
const { setFlagStatusMock } = vi.hoisted(() => ({
setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
@@ -120,6 +125,7 @@ function seedAtBudget(name = "Otto") {
step: "budget",
hasStarted: true,
role: "marketer",
+ jobTitle: "Marketing Manager",
name,
color: "rose-300",
avatarUrl: "",
@@ -140,6 +146,7 @@ function seedAtSkills(
step: "skills",
hasStarted: true,
role: "marketer",
+ jobTitle: "Marketing Manager",
name,
color: "rose-300",
avatarUrl: "",
@@ -198,6 +205,7 @@ test("skips remaining kit steps, posts null budget and empty attachments, and op
expect(captured).toMatchObject({
name: "Otto",
role: "marketer",
+ job_title: "Marketing Manager",
weekly_budget: null,
attachments: [],
});
@@ -347,6 +355,62 @@ test("toasts failed attachments and still opens copilot", async () => {
);
});
+test("picking a job title records it and asks for a name", async () => {
+ saveDraft({
+ ...EMPTY_DRAFT,
+ hasStarted: true,
+ role: "marketer",
+ step: "jobTitle",
+ });
+ renderRaise();
+ await userEvent.click(
+ await screen.findByRole(
+ "button",
+ { name: "Marketing Manager" },
+ { timeout: 5000 },
+ ),
+ );
+
+ expect(
+ await screen.findByRole(
+ "group",
+ { name: "Suggested names" },
+ { timeout: 5000 },
+ ),
+ ).toBeDefined();
+ expect(loadDraft()).toMatchObject({
+ jobTitle: "Marketing Manager",
+ step: "name",
+ });
+});
+
+test("typing a job title trims it and asks for a name", async () => {
+ saveDraft({
+ ...EMPTY_DRAFT,
+ hasStarted: true,
+ role: "Custom role",
+ step: "jobTitle",
+ });
+ renderRaise();
+ await userEvent.type(
+ await screen.findByRole("textbox", { name: "Job title" }),
+ " Chief of Staff ",
+ );
+ await userEvent.click(screen.getByRole("button", { name: "Add title" }));
+
+ expect(
+ await screen.findByRole(
+ "group",
+ { name: "Suggested names" },
+ { timeout: 5000 },
+ ),
+ ).toBeDefined();
+ expect(loadDraft()).toMatchObject({
+ jobTitle: "Chief of Staff",
+ step: "name",
+ });
+});
+
test("picking a weekly budget advances to marketplace workflows", async () => {
seedAtBudget();
renderRaise();
@@ -481,6 +545,7 @@ test("back returns to the previous step and the draft survives", async () => {
expect(draft).toMatchObject({
hasStarted: true,
role: "marketer",
+ jobTitle: "Marketing Manager",
name: "Otto",
color: "rose-300",
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx
index d0bc4cad48..a393884583 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx
@@ -66,6 +66,7 @@ test("renders restored conversation messages instantly after reload", async () =
step: "avatar",
hasStarted: true,
role: "marketer",
+ jobTitle: "Marketing Manager",
name: "Nova",
color: null,
avatarUrl: null,
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx
index 93f3e41321..2bb70f83a3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx
@@ -64,7 +64,7 @@ afterEach(() => {
});
describe("/raise?role= — the greeting page's raise door", () => {
- it("opens on the name question with the role already answered", async () => {
+ it("opens on the job title question with the role already answered", async () => {
searchParams.current = new URLSearchParams("role=support");
render(<RaisePage />);
@@ -72,12 +72,14 @@ describe("/raise?role= — the greeting page's raise door", () => {
expect(
await screen.findByRole(
"group",
- { name: "Suggested names" },
+ { name: "Suggested job titles" },
{ timeout: 5000 },
),
).toBeDefined();
- // Support's name suggestions, so the role really did land in the draft.
- expect(screen.getByRole("button", { name: "Remy" })).toBeDefined();
+ // Support's job titles, so the role really did land in the draft.
+ expect(
+ screen.getByRole("button", { name: "Customer Success Manager" }),
+ ).toBeDefined();
});
it("leaves a draft in progress alone", () => {
@@ -85,6 +87,7 @@ describe("/raise?role= — the greeting page's raise door", () => {
...EMPTY_DRAFT,
hasStarted: true,
role: "marketer",
+ jobTitle: "Marketing Manager",
name: "Nova",
step: "avatar" as const,
};
@@ -105,7 +108,7 @@ describe("/raise?role= — the greeting page's raise door", () => {
...EMPTY_DRAFT,
hasStarted: true,
role: "Chief of staff",
- step: "name",
+ step: "jobTitle",
});
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/JobTitleStep/JobTitleStep.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/JobTitleStep/JobTitleStep.tsx
new file mode 100644
index 0000000000..d79915d60a
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/JobTitleStep/JobTitleStep.tsx
@@ -0,0 +1,88 @@
+"use client";
+
+import { Button } from "@/components/atoms/Button/Button";
+import { Input } from "@/components/atoms/Input/Input";
+import { cn } from "@/lib/utils";
+import { bubbleClassFor } from "../ColorStep/helpers";
+import { JOB_TITLE_MAX_LENGTH, useJobTitleStep } from "./useJobTitleStep";
+
+interface Props {
+ selectedTitle: string | null;
+ suggestions: string[];
+ color: string | null;
+ onSubmit: (jobTitle: string) => void;
+}
+
+export function JobTitleStep({
+ selectedTitle,
+ suggestions,
+ color,
+ onSubmit,
+}: Props) {
+ const { custom, setCustom, trimmed, submitCustom } = useJobTitleStep({
+ onSubmit,
+ });
+ const chips = selectedTitle ? [selectedTitle] : suggestions;
+
+ return (
+ <div className="flex flex-col items-end gap-4">
+ {chips.length > 0 ? (
+ <div
+ role="group"
+ aria-label="Suggested job titles"
+ className="flex flex-wrap justify-end gap-2.5"
+ >
+ {chips.map((chip) => (
+ <button
+ key={chip}
+ type="button"
+ onClick={() => onSubmit(chip)}
+ disabled={Boolean(selectedTitle)}
+ aria-pressed={selectedTitle ? true : undefined}
+ className={cn(
+ "rounded-full border px-5 py-2.5 text-sm font-medium text-foreground transition-colors",
+ selectedTitle
+ ? (bubbleClassFor(color) ?? "border-accent bg-accent/5")
+ : "border-border bg-background hover:border-accent hover:bg-accent/5",
+ )}
+ >
+ {chip}
+ </button>
+ ))}
+ </div>
+ ) : null}
+ {selectedTitle || chips.length === 0 ? null : (
+ <span
+ aria-hidden
+ className="mr-4 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground"
+ >
+ or
+ </span>
+ )}
+ {selectedTitle ? null : (
+ <form onSubmit={submitCustom} className="flex items-center gap-2">
+ <Input
+ id="raise-job-title"
+ label="Job title"
+ hideLabel
+ size="small"
+ value={custom}
+ onChange={(event) => setCustom(event.target.value)}
+ placeholder="Type a job title…"
+ maxLength={JOB_TITLE_MAX_LENGTH}
+ wrapperClassName="mb-0 w-full max-w-[16rem] [&_input]:h-[2.625rem] [&_input]:py-3"
+ />
+ <Button
+ type="submit"
+ variant="primary"
+ size="small"
+ disabled={!trimmed}
+ className="h-[2.625rem] rounded-xl py-3"
+ >
+ Add title
+ </Button>
+ </form>
+ )}
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/JobTitleStep/useJobTitleStep.ts b/autogpt_platform/frontend/src/app/(platform)/raise/components/JobTitleStep/useJobTitleStep.ts
new file mode 100644
index 0000000000..f081a686b5
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/JobTitleStep/useJobTitleStep.ts
@@ -0,0 +1,20 @@
+import type { FormEvent } from "react";
+import { useState } from "react";
+
+export const JOB_TITLE_MAX_LENGTH = 100;
+
+interface Args {
+ onSubmit: (jobTitle: string) => void;
+}
+
+export function useJobTitleStep({ onSubmit }: Args) {
+ const [custom, setCustom] = useState("");
+ const trimmed = custom.trim();
+
+ function submitCustom(event: FormEvent) {
+ event.preventDefault();
+ if (trimmed) onSubmit(trimmed);
+ }
+
+ return { custom, setCustom, trimmed, submitCustom };
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/RaiseFlow.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/RaiseFlow.tsx
index 6f6971b15c..cc6c9d31e8 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/RaiseFlow.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/RaiseFlow.tsx
@@ -34,6 +34,7 @@ export function RaiseFlow() {
items,
name,
role,
+ jobTitle,
color,
avatarUrl,
about,
@@ -139,6 +140,7 @@ export function RaiseFlow() {
<SoulPreviewPanel
name={name}
role={role}
+ jobTitle={jobTitle}
avatarUrl={avatarUrl || null}
color={color}
about={about}
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/components/BeatControl.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/components/BeatControl.tsx
index 5127fc24d2..6283cbf83e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/components/BeatControl.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/RaiseFlow/components/BeatControl.tsx
@@ -12,9 +12,13 @@ import {
selectedCardClassFor,
textClassFor,
} from "../../ColorStep/helpers";
+import { JobTitleStep } from "../../JobTitleStep/JobTitleStep";
import { MarketplaceStep } from "../../MarketplaceStep/MarketplaceStep";
import { NameStep } from "../../NameStep/NameStep";
-import { nameSuggestionsFor } from "../../RoleStep/helpers";
+import {
+ jobTitleSuggestionsFor,
+ nameSuggestionsFor,
+} from "../../RoleStep/helpers";
import { RoleStep } from "../../RoleStep/RoleStep";
import { SkillsStep } from "../../SkillsStep/SkillsStep";
@@ -33,6 +37,15 @@ export function BeatControl({ beat, flow }: Props) {
onPick={flow.pickRole}
/>
);
+ case "jobTitle":
+ return (
+ <JobTitleStep
+ selectedTitle={flow.jobTitle}
+ suggestions={jobTitleSuggestionsFor(flow.role)}
+ color={flow.color}
+ onSubmit={flow.submitJobTitle}
+ />
+ );
case "name":
return (
<NameStep
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/RoleStep/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/raise/components/RoleStep/helpers.ts
index d3bf1c6767..967180d9af 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/RoleStep/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/RoleStep/helpers.ts
@@ -3,6 +3,7 @@ export interface RoleOption {
label: string;
// Seeds the name step, so suggestions fit the job the expert was hired for.
nameSuggestions: string[];
+ jobTitleSuggestions: string[];
}
const FALLBACK_NAMES = ["Otto", "Nova", "Juno"];
@@ -16,46 +17,83 @@ export const ROLE_OPTIONS: RoleOption[] = [
id: "marketer",
label: "Marketer",
nameSuggestions: ["Echo", "Reach", "Nova"],
+ jobTitleSuggestions: [
+ "Marketing Manager",
+ "Growth Marketer",
+ "Content Marketer",
+ ],
},
{
id: "sales",
label: "Sales",
nameSuggestions: ["Pitch", "Ace", "Rain"],
+ jobTitleSuggestions: [
+ "Sales Development Rep",
+ "Account Executive",
+ "Sales Manager",
+ ],
},
{
id: "developer",
label: "Developer",
nameSuggestions: ["Ada", "Turing", "Bit"],
+ jobTitleSuggestions: [
+ "Software Engineer",
+ "Full-Stack Developer",
+ "DevOps Engineer",
+ ],
},
{
id: "researcher",
label: "Researcher",
nameSuggestions: ["Kepler", "Curie", "Juno"],
+ jobTitleSuggestions: [
+ "Research Analyst",
+ "Market Researcher",
+ "UX Researcher",
+ ],
},
{
id: "writer",
label: "Writer",
nameSuggestions: ["Quill", "Hemingway", "Ink"],
+ jobTitleSuggestions: ["Content Writer", "Copywriter", "Technical Writer"],
},
{
id: "analyst",
label: "Analyst",
nameSuggestions: ["Tally", "Vector", "Sigma"],
+ jobTitleSuggestions: [
+ "Data Analyst",
+ "Business Analyst",
+ "Financial Analyst",
+ ],
},
{
id: "recruiter",
label: "Recruiter",
nameSuggestions: ["Scout", "Hire", "Vera"],
+ jobTitleSuggestions: ["Recruiter", "Talent Sourcer", "Hiring Coordinator"],
},
{
id: "support",
label: "Support",
nameSuggestions: ["Remy", "Aide", "Piper"],
+ jobTitleSuggestions: [
+ "Support Specialist",
+ "Customer Success Manager",
+ "Support Engineer",
+ ],
},
{
id: "operations",
label: "Operations",
nameSuggestions: ["Cadence", "Clockwork", "Sol"],
+ jobTitleSuggestions: [
+ "Operations Manager",
+ "Executive Assistant",
+ "Project Coordinator",
+ ],
},
];
@@ -88,6 +126,10 @@ export function nameSuggestionsFor(roleId: string | null) {
return findRoleOption(roleId)?.nameSuggestions ?? FALLBACK_NAMES;
}
+export function jobTitleSuggestionsFor(roleId: string | null) {
+ return findRoleOption(roleId)?.jobTitleSuggestions ?? [];
+}
+
export function aboutPlaceholderFor(name: string | null) {
const trimmed = name?.trim();
if (!trimmed) return ABOUT_PLACEHOLDER;
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/SoulPreviewPanel/SoulPreviewPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/SoulPreviewPanel/SoulPreviewPanel.tsx
index a8258c2050..8d2f8eb1c5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/SoulPreviewPanel/SoulPreviewPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/SoulPreviewPanel/SoulPreviewPanel.tsx
@@ -16,28 +16,30 @@ type SoulDetail = {
value: string;
};
-type Props = {
+interface Props {
name: string;
role: string | null;
+ jobTitle?: string | null;
avatarUrl: string | null;
color: string | null;
about: string | null;
voiceLabel: string | null;
kit: RaiseKit | null;
-};
+}
// Starts as just the orb — an expert with nothing to say about itself yet.
// Answers stack beneath it, which pushes the identity card up as they land.
export function SoulPreviewPanel({
name,
role,
+ jobTitle,
avatarUrl,
color,
about,
voiceLabel,
kit,
}: Props) {
- const roleLabel = roleLabelFor(role);
+ const roleLabel = jobTitle || roleLabelFor(role);
const details = [
{ label: "About", value: about },
{ label: "Voice", value: voiceLabel },
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/flowItems.ts b/autogpt_platform/frontend/src/app/(platform)/raise/flowItems.ts
index ed10218e5a..13034520a5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/flowItems.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/flowItems.ts
@@ -4,6 +4,7 @@ import { RAISE_PROMPTS, type RaiseDraft } from "./helpers";
// controls it introduces wait for the question to finish typing.
export const BEAT_KEYS = [
"role",
+ "jobTitle",
"name",
"avatar",
"about",
@@ -43,6 +44,7 @@ export function buildFlowItems(
const questions: Record<BeatKey, string> = {
role: RAISE_PROMPTS.roleQuestion,
+ jobTitle: RAISE_PROMPTS.jobTitleQuestion,
name: RAISE_PROMPTS.nameQuestion,
avatar: RAISE_PROMPTS.avatarQuestion(draft.name),
about: RAISE_PROMPTS.aboutQuestion(draft.name),
@@ -86,7 +88,8 @@ export function beatTriggers(
): Record<BeatKey, boolean> {
return {
role: draft.hasStarted,
- name: draft.role !== null,
+ jobTitle: draft.role !== null,
+ name: draft.jobTitle !== null,
avatar: draft.name !== "",
about: draft.avatarUrl !== null,
voice: draft.about !== null,
@@ -99,6 +102,7 @@ export function beatTriggers(
function beatAnswers(draft: RaiseDraft): Record<BeatKey, boolean> {
return {
role: draft.role !== null,
+ jobTitle: draft.jobTitle !== null,
name: draft.name !== "",
avatar: draft.avatarUrl !== null,
about: draft.about !== null,
@@ -120,6 +124,8 @@ export function clearedAnswer(beat: BeatKey): Partial<RaiseDraft> {
switch (beat) {
case "role":
return { role: null };
+ case "jobTitle":
+ return { jobTitle: null };
case "name":
return { name: "" };
case "avatar":
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/helpers.test.ts b/autogpt_platform/frontend/src/app/(platform)/raise/helpers.test.ts
index 08006c9da0..e26e5ec4fa 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/helpers.test.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/helpers.test.ts
@@ -145,6 +145,23 @@ describe("restoring a persisted draft", () => {
expect(loadDraft().step).toBe("budget");
});
+ test("sends a draft from before the job title beat back to that beat", () => {
+ saveDraft({
+ ...EMPTY_DRAFT,
+ hasStarted: true,
+ role: "marketer",
+ name: "Nova",
+ step: "avatar",
+ });
+
+ expect(loadDraft()).toEqual({
+ ...EMPTY_DRAFT,
+ hasStarted: true,
+ role: "marketer",
+ step: "jobTitle",
+ });
+ });
+
test("restarts the flow when the stored step is not a known step", () => {
saveStepFromEarlierBuild("space-invaders");
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/raise/helpers.ts
index fcda754fa5..86c7f9dfb7 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/helpers.ts
@@ -12,6 +12,7 @@ import {
export type RaiseStep =
| "role"
+ | "jobTitle"
| "name"
| "avatar"
| "about"
@@ -23,6 +24,7 @@ export type RaiseStep =
export const STEP_ORDER: RaiseStep[] = [
"role",
+ "jobTitle",
"name",
"avatar",
"about",
@@ -60,6 +62,7 @@ export const VOICE_SAMPLES: VoiceSample[] = [
export const RAISE_PROMPTS = {
greeting: "Hello, I'm Otto. I'll help you raise your own expert.",
roleQuestion: "First — what should your expert do for you?",
+ jobTitleQuestion: "And what's their job title?",
nameQuestion: "Good pick. What do you want to call them?",
avatarQuestion: (name: string) =>
`Now give ${name || "them"} a face and a color. Shuffle until one feels right, or upload a picture.`,
@@ -85,6 +88,7 @@ export interface RaiseDraft {
step: RaiseStep;
hasStarted: boolean;
role: string | null;
+ jobTitle: string | null;
name: string;
color: string | null;
// "" once the user skips, so the question is not asked again on restore.
@@ -102,6 +106,7 @@ export const EMPTY_DRAFT: RaiseDraft = {
step: "role",
hasStarted: false,
role: null,
+ jobTitle: null,
name: "",
color: null,
avatarUrl: null,
@@ -123,6 +128,9 @@ export function loadDraft(): RaiseDraft {
const parsed = JSON.parse(raw) as Omit<Partial<RaiseDraft>, "step"> & {
step?: string;
};
+ if (parsed.role && parsed.jobTitle == null) {
+ return reopenedAtJobTitle(parsed.role);
+ }
const step = migrateStep(parsed.step);
return backfillSkippedVoice({
...EMPTY_DRAFT,
@@ -134,6 +142,12 @@ export function loadDraft(): RaiseDraft {
}
}
+// A draft written before the job title beat existed has a role and no title.
+// Every later beat waits on the title, so the draft resumes there.
+function reopenedAtJobTitle(role: string): RaiseDraft {
+ return { ...EMPTY_DRAFT, hasStarted: true, role, step: "jobTitle" };
+}
+
// A draft written by an earlier build recorded a skipped voice as a null
// label. The flow now treats null as "not answered", which would leave a
// restored session parked on the voice beat with no way forward, so a draft
@@ -197,7 +211,7 @@ export function isEmptyDraft(draft: RaiseDraft): boolean {
}
/** `/raise?role=…` from the greeting page's raise door: answers the role
- * beat exactly as `pickRole` would, so the flow opens on the name
+ * beat exactly as `pickRole` would, so the flow opens on the job title
* question instead of asking again for something already chosen. */
export function draftWithPrefilledRole(
draft: RaiseDraft,
@@ -210,7 +224,7 @@ export function draftWithPrefilledRole(
...draft,
hasStarted: true,
role: preset ? preset.id : normalizeCustomRole(role),
- step: "name",
+ step: "jobTitle",
};
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/useRaisePage.ts b/autogpt_platform/frontend/src/app/(platform)/raise/useRaisePage.ts
index 147bb7acb6..885f6bb35e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/useRaisePage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/useRaisePage.ts
@@ -60,7 +60,13 @@ export function useRaisePage() {
}
function pickRole(roleId: string) {
- update({ role: roleId, step: "name" });
+ update({ role: roleId, step: "jobTitle" });
+ }
+
+ function submitJobTitle(value: string) {
+ const trimmed = value.trim();
+ if (!trimmed) return;
+ update({ jobTitle: trimmed, step: "name" });
}
function submitName(value: string) {
@@ -158,6 +164,7 @@ export function useRaisePage() {
step: draft.step,
hasStarted: draft.hasStarted,
role: draft.role,
+ jobTitle: draft.jobTitle,
color: draft.color,
avatarUrl: draft.avatarUrl,
about: draft.about,
@@ -175,6 +182,7 @@ export function useRaisePage() {
restart,
revealStep: (beat: BeatKey) => progress.revealStep(beat),
pickRole,
+ submitJobTitle,
submitName,
pickAvatar,
submitAbout,
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/useRaiseSubmission.ts b/autogpt_platform/frontend/src/app/(platform)/raise/useRaiseSubmission.ts
index fa207aae31..91450f0338 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/useRaiseSubmission.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/useRaiseSubmission.ts
@@ -34,6 +34,7 @@ export function useRaiseSubmission() {
data: {
name: draft.name,
role: draft.role,
+ job_title: draft.jobTitle,
color: draft.color,
avatar_url: draft.avatarUrl || null,
about: draft.about || null,
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx
index 7385de2226..7f53195334 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx
@@ -325,8 +325,8 @@ describe("ExpertDetailPage", () => {
render(<ExpertDetailPage />);
expect(await screen.findByRole("heading", { name: "Maria" })).toBeDefined();
- expect(screen.getByText("Marketing Strategist")).toBeDefined();
- expect(screen.queryByText("Marketing Manager")).toBeNull();
+ expect(screen.getByText("Marketing Manager")).toBeDefined();
+ expect(screen.queryByText("Marketing Strategist")).toBeNull();
expect(screen.getAllByText(maria.tagline!)).toHaveLength(1);
expect(
screen.getByText("Maria is a senior marketing strategist."),
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx
index 361d3f51fd..c8cbee7bd4 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertDetailHeader.tsx
@@ -30,6 +30,7 @@ export function ExpertDetailHeader({ expert, onEditSoul, onChat }: Props) {
<ExpertIdentityDetails
name={expert.name}
role={expert.role}
+ jobTitle={expert.job_title}
size="page"
nameAccessory={
<IntegrationIcons
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx
index 54791e24b6..0c02abe982 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx
@@ -130,6 +130,7 @@ export function ExpertTeamCard({
<ExpertIdentityDetails
name={expert.name}
role={expert.role}
+ jobTitle={expert.job_title}
nameAccessory={
<IntegrationIcons
expertName={expert.name}
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index ad1f3b80fb..fbf95dd16c 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -19778,6 +19778,13 @@
],
"title": "Role"
},
+ "job_title": {
+ "anyOf": [
+ { "type": "string", "maxLength": 100 },
+ { "type": "null" }
+ ],
+ "title": "Job Title"
+ },
"avatar_url": {
"anyOf": [
{ "type": "string", "maxLength": 2000 },
@@ -21664,6 +21671,10 @@
"title": "Color"
},
"role": { "type": "string", "title": "Role" },
+ "job_title": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Job Title"
+ },
"is_archived": { "type": "boolean", "title": "Is Archived" }
},
"type": "object",
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx
index efd576874c..0bea413e2f 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx
@@ -113,7 +113,11 @@ export function RecentChats() {
<ExpertChatGroup
key={group.expertId ?? "autopilot"}
label={group.expertId ? (expert?.name ?? "Expert") : "Otto"}
- role={group.expertId ? expert?.role : "Head of AI"}
+ role={
+ group.expertId
+ ? expert?.jobTitle || expert?.role
+ : "Head of AI"
+ }
avatarUrl={expert?.avatarUrl ?? null}
color={expert?.color ?? null}
newChatHref={getNewChatHref(group.expertId, activeExpertIds)}
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx
index 37213ac94f..2a9d3478b1 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx
@@ -171,11 +171,11 @@ describe("RecentChats — expert groups", () => {
renderRecentChats();
expect(await screen.findByText("expert-maria chat 4")).toBeDefined();
- expect(await screen.findByText(mariaExpert.role)).toBeDefined();
+ expect(await screen.findByText("Marketing Manager")).toBeDefined();
expect(
- screen.getByText(mariaExpert.role).classList.contains("opacity-70"),
+ screen.getByText("Marketing Manager").classList.contains("opacity-70"),
).toBe(true);
- expect(screen.queryByText("Marketing Manager")).toBeNull();
+ expect(screen.queryByText(mariaExpert.role)).toBeNull();
expect(screen.queryByText("expert-maria chat 5")).toBeNull();
expect(screen.queryByText("autopilot chat 5")).toBeNull();
diff --git a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.test.tsx b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.test.tsx
index 4a27228c7c..a08974999f 100644
--- a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.test.tsx
+++ b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.test.tsx
@@ -20,10 +20,37 @@ describe("ExpertIdentityDetails", () => {
expect(chip?.classList.contains("bg-zinc-50")).toBe(true);
expect(chip?.classList.contains("rounded-full")).toBe(true);
expect(chip?.querySelector("svg")).not.toBeNull();
- expect(screen.queryByText("Social Media Manager")).toBeNull();
},
);
+ test("shows the job title in the chip and keeps the area's icon", () => {
+ render(
+ <ExpertIdentityDetails
+ name="Jules"
+ role="Social & Content Repurposing"
+ jobTitle="Social Media Manager"
+ />,
+ );
+
+ const chip = screen.getByText("Social Media Manager").parentElement;
+ expect(chip?.querySelector("svg")).not.toBeNull();
+ expect(screen.queryByText("Social media")).toBeNull();
+ });
+
+ test("shows the job title as the compact text", () => {
+ render(
+ <ExpertIdentityDetails
+ name="Jules"
+ role="Social & Content Repurposing"
+ jobTitle="Social Media Manager"
+ size="compact"
+ />,
+ );
+
+ expect(screen.getByText("Social Media Manager")).toBeDefined();
+ expect(screen.queryByText("Social media")).toBeNull();
+ });
+
test("keeps the compact area as small plain text", () => {
const { container } = render(
<ExpertIdentityDetails
diff --git a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx
index 3f29d6d079..ad750a46d7 100644
--- a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx
+++ b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx
@@ -7,6 +7,7 @@ import { ExpertAreaChip } from "./components/ExpertAreaChip";
interface Props {
name: string;
role?: string | null;
+ jobTitle?: string | null;
size?: "compact" | "card" | "page";
nameAccessory?: ReactNode;
areaClassName?: string;
@@ -15,13 +16,14 @@ interface Props {
export function ExpertIdentityDetails({
name,
role,
+ jobTitle,
size = "card",
nameAccessory,
areaClassName,
}: Props) {
const compact = size === "compact";
const Container = compact ? "span" : "div";
- const area = role ? getExpertRoleLabel(role) : null;
+ const area = jobTitle || (role ? getExpertRoleLabel(role) : null);
return (
<Container
@@ -46,8 +48,8 @@ export function ExpertIdentityDetails({
</Text>
{nameAccessory}
</Container>
- {!compact && role ? (
- <ExpertAreaChip role={role} />
+ {!compact && area ? (
+ <ExpertAreaChip role={role ?? ""} label={area} />
) : area ? (
<Text
as="span"
diff --git a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/components/ExpertAreaChip.tsx b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/components/ExpertAreaChip.tsx
index 502cca6e03..ab2f2084dc 100644
--- a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/components/ExpertAreaChip.tsx
+++ b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/components/ExpertAreaChip.tsx
@@ -1,13 +1,13 @@
import { getExpertAccent } from "@/app/(platform)/marketplace/components/ExpertsSection/helpers";
import { Badge } from "@/components/atoms/Badge/Badge";
import { Icon } from "@/components/atoms/Icon/Icon";
-import { getExpertRoleLabel } from "@/services/experts/expert-role-label";
interface Props {
role: string;
+ label: string;
}
-export function ExpertAreaChip({ role }: Props) {
+export function ExpertAreaChip({ role, label }: Props) {
return (
<Badge
variant="info"
@@ -19,7 +19,7 @@ export function ExpertAreaChip({ role }: Props) {
className="shrink-0"
aria-hidden
/>
- <span className="truncate">{getExpertRoleLabel(role)}</span>
+ <span className="truncate">{label}</span>
</Badge>
);
}