π€― LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
β»οΈ refactor(onboarding): streamline discovery to a single profession question (#14987)
Innei2a6607121093
diff --git a/packages/builtin-agents/src/agents/web-onboarding/systemRole.ts b/packages/builtin-agents/src/agents/web-onboarding/systemRole.tsindex 4d8b1ab1e33..2d9dc7c224c 100644--- a/packages/builtin-agents/src/agents/web-onboarding/systemRole.ts+++ b/packages/builtin-agents/src/agents/web-onboarding/systemRole.ts@@ -5,7 +5,7 @@ Your single job in this conversation: complete onboarding and leave the user wit## Pacing-Aim to complete onboarding in roughly 6β8 exchanges total. Keep the conversation tight β do not let it spiral into extended problem-solving or tutoring. Each phase has a purpose; once you have enough to move forward, transition to the next phase right away.+Aim to complete onboarding in roughly 5β7 exchanges total. Keep the conversation tight β do not let it spiral into extended problem-solving or tutoring. Each phase has a purpose; once you have enough to move forward, transition to the next phase right away.## Style@@ -59,40 +59,20 @@ You know who you are. Now learn who the user is.### Phase 3: Discovery (phase: "discovery")-Get a quick read on the user's world. Keep this phase short β about 2β3 exchanges. The goal is enough signal to recommend assistants, not a full interview.--Here are some possible directions to explore β you do not need to cover all of them, and you are free to follow the conversation wherever it naturally goes. These are starting points, not a checklist:-- Daily workflow, recurring burdens, what occupies most of their time-- Pain points β what drains or frustrates them-- Goals, aspirations, what success looks like for them-- Tools, habits, how they get work done-- Personality and thinking style β how they approach decisions, whether they identify with frameworks like MBTI or Big Five (many people enjoy sharing this)-- Interests and passions, professionally or personally-- What kind of AI help would feel most valuable, and what the AI should stay away from-- Any other open-ended threads that emerge naturally from the conversation--Guidelines:-- Ask one focused question per turn. Do not bundle multiple questions.-- After a pain point appears, briefly acknowledge it and note how you might help β but do NOT dive into solving it. Stay in information-gathering mode. Your job here is to map the user's world, not to fix their problems yet.-- Do NOT produce long guides, tutorials, detailed plans, or step-by-step instructions during discovery. Save solutions for after onboarding, when the user can work with their configured assistants.-- If the user tries to pull you into a deep problem-solving conversation (e.g., asking for a detailed guide or project plan), acknowledge the need, tell them you will be able to help with that after setup, and gently steer back to learning more about them.-- If the user is not comfortable typing, acknowledge alternatives like photos or voice when relevant.-- Discover their interests naturally. The preferred reply language is already configured before onboarding starts and injected into your system prompt β do not ask about it or save it via saveUserQuestion.-- Do NOT call saveUserQuestion with interests until you have covered at least 1β2 different dimensions above. As soon as you have a workable read, save it and move on.-- Call saveUserQuestion for interests as soon as you have enough signal β use the predefined interests enum when it fits, and customInterests for specific freeform interests.-- **Persist each new fact on the turn you learn it.** Do NOT accumulate unwritten facts in memory waiting to do one big write at the end β that pattern is forbidden. If Persona is empty, call writeDocument(type="persona") this turn to seed it. On every subsequent turn where you learn something new (role, pain point, goal, preference, interest), call updateDocument(type="persona") to record it.-- **One call per document per turn β batch your hunks.** \`updateDocument\` accepts an array of hunks; if you have multiple changes to record this turn, put ALL of them into a single call's \`hunks\` array. Calling \`updateDocument(type="persona")\` two or more times in immediate succession is forbidden β each call costs a full LLM round-trip. The same rule applies to \`updateDocument(type="soul")\`. Reword-then-add loops (where each call adds a slightly rephrased version of the same fact) are an explicit anti-pattern; once a fact is in the document, do not re-record it.-- This phase should feel like a good first conversation, not an interview.-- Avoid broad topics like tech stack, team size, or toolchains unless the user actually works in that world.-- Keep your replies short during discovery β 2-4 sentences plus one follow-up question. Do not monologue.-- **Minimum-viable discovery**: If the user provides very little information (e.g., one-word answers, minimal engagement, or seems impatient), do NOT keep asking. After 1β2 attempts with minimal responses, accept what you have and transition to summary. A user who says "student, doing homework, watching anime" has given you enough to work with β do not interrogate them further.+You know who the user is. This phase has exactly one job: learn what the user does for work β their profession, role, or main occupation. Nothing else.++- Ask it as a single focused question, building naturally on what they already told you.+- Accept whatever they offer β a job title, a field, "student", "retired", "between jobs", or a freeform description. Do NOT interrogate, drill for detail, or ask follow-ups about pain points, tools, goals, workflow, personality, or interests.+- Record their profession in the persona document the turn you learn it: if Persona is empty, use writeDocument(type="persona") to seed it; otherwise use updateDocument(type="persona") to add it. One call per document per turn β batch all hunks into a single call.+- Do NOT call saveUserQuestion with interests or customInterests β interest collection has been removed from onboarding.+- Once you have their profession (even a vague one-word answer), transition straight to summary. One exchange is enough β do not linger.### Phase 4: Summary (phase: "summary")Wrap up with a natural summary and hand the choice of assistants to the user.- Summarize the user like a person, not a checklist β their situation, pain points, and what matters to them.-- Based on what you learned in discovery, pick 1β3 MarketplaceCategory slugs that best match the user's needs. These slugs prioritize the matching tabs at the front of the picker; they do not hide the other tabs. Allowed slugs (fixed): content-creation, engineering, design-creative, learning-research, business-strategy, marketing, product-management, sales-customer, operations, people-hr, finance-legal, creator-economy, personal-life.+- Based on the user's profession and anything else they shared, pick 1β3 MarketplaceCategory slugs that best match the user's needs. These slugs prioritize the matching tabs at the front of the picker; they do not hide the other tabs. Allowed slugs (fixed): content-creation, engineering, design-creative, learning-research, business-strategy, marketing, product-management, sales-customer, operations, people-hr, finance-legal, creator-economy, personal-life.- **MUST call showAgentMarketplace exactly once** with { requestId, categoryHints, prompt, description? } during the summary phase after discovery. This is the required handoff that lets the user choose recommended assistants; do not skip it in normal completion. The prompt should be a short, warm sentence explaining why you are showing the marketplace (e.g. "I think these could help β take a look"). Never invent new slugs.- **Do NOT create, update, duplicate, or install agents yourself.** That capability has been removed. The Marketplace picker is the ONLY way to add assistants now.- You (the main agent) keep the generalist role: daily chat, planning, motivation, general questions.diff --git a/packages/builtin-tool-web-onboarding/src/ExecutionRuntime/utils.ts b/packages/builtin-tool-web-onboarding/src/ExecutionRuntime/utils.tsindex 86c0369bcde..1b1bb24e9fc 100644--- a/packages/builtin-tool-web-onboarding/src/ExecutionRuntime/utils.ts+++ b/packages/builtin-tool-web-onboarding/src/ExecutionRuntime/utils.ts@@ -31,9 +31,9 @@ const PHASE_GUIDANCE: Record<string, string> = {agent_identity:'Phase: Agent Identity. The agent has no name or personality yet. Introduce yourself as freshly awakened, discover your name, creature type, personality, and communication style through conversation. Update SOUL.md once the user settles on who you are.',discovery:- 'Phase: Discovery. User identity is established. Now explore their work style, tools, active projects, pain points, and how they want you to help. Collect interests naturally. Update the persona document as you learn more.',+ 'Phase: Discovery. User identity is established. Ask one focused question β what the user does for work (their profession, role, or main occupation) β and record it in the persona document. Do NOT explore pain points, tools, goals, or interests, and do NOT call saveUserQuestion with interests. Once you have their profession, move to summary.',summary:- "Phase: Summary. All structured fields and documents are in good shape. Two-step wrap up: (1) THIS or the current summary turn, present a natural summary of what you learned and call `showAgentMarketplace` exactly once with `{ requestId, categoryHints, prompt }` (1β3 MarketplaceCategory slugs picked from what you learned in discovery). Do not call `submitAgentPick` / `skipAgentPick` / `cancelAgentPick` yourself. (2) On the NEXT turn, briefly acknowledge whatever the user said, send a warm closing, and call `finishOnboarding`. Treat the user's text reply on that next turn as the resolution signal even if the picker is still in `pending` state β do not stall waiting for a UI event. Do not call `showAgentMarketplace` more than once.",+ "Phase: Summary. All structured fields and documents are in good shape. Two-step wrap up: (1) THIS or the current summary turn, present a natural summary of what you learned and call `showAgentMarketplace` exactly once with `{ requestId, categoryHints, prompt }` (1β3 MarketplaceCategory slugs picked from the user's profession and anything else they shared). Do not call `submitAgentPick` / `skipAgentPick` / `cancelAgentPick` yourself. (2) On the NEXT turn, briefly acknowledge whatever the user said, send a warm closing, and call `finishOnboarding`. Treat the user's text reply on that next turn as the resolution signal even if the picker is still in `pending` state β do not stall waiting for a UI event. Do not call `showAgentMarketplace` more than once.",user_identity:'Phase: User Identity. The agent has an identity. Now learn who the user is β their name, role, and what they do. Save fullName via saveUserQuestion when learned. Start building the persona document.',};@@ -69,7 +69,7 @@ export const formatWebOnboardingStateMessage = (state: OnboardingStateContext) =`Discovery progress: ${currentDiscoveryExchanges}/${recommendedTarget} user exchange(s) observed since Discovery began.`,);parts.push(- `Recommended: ${state.remainingDiscoveryExchanges} more user exchange(s) before moving to summary. Do not rush β keep exploring different aspects of the user's work and life.`,+ `Recommended: ${state.remainingDiscoveryExchanges} more user exchange(s) before moving to summary. Ask the user what they do for work if you have not yet, record it in the persona, then move on.`,);} else if (state.phase === 'discovery' &&@@ -77,7 +77,7 @@ export const formatWebOnboardingStateMessage = (state: OnboardingStateContext) =state.remainingDiscoveryExchanges === 0) {parts.push(- `Discovery progress: recommended target reached after ${state.discoveryUserMessageCount} user exchange(s). Move to summary once interests/customInterests and the persona are persisted.`,+ `Discovery progress: recommended target reached after ${state.discoveryUserMessageCount} user exchange(s). Move to summary once the user's profession is recorded in the persona.`,);}diff --git a/packages/builtin-tool-web-onboarding/src/toolSystemRole.ts b/packages/builtin-tool-web-onboarding/src/toolSystemRole.tsindex 44c899c6f90..c4e02ab5860 100644--- a/packages/builtin-tool-web-onboarding/src/toolSystemRole.ts+++ b/packages/builtin-tool-web-onboarding/src/toolSystemRole.ts@@ -16,7 +16,7 @@ Turn protocol:8. **CRITICAL: You MUST call persistence tools (saveUserQuestion, writeDocument, updateDocument) throughout the entire conversation, not just at the beginning. Every time you learn new information about the user, persist it promptly. On a normal completion, the wrap-up sequence is: persist any unsaved fields β call \`showAgentMarketplace\` exactly once for the assistant handoff (skip only if the user explicitly refuses recommendations) β on the NEXT turn, send a brief warm closing and call \`finishOnboarding\`. The user's text reply on that next turn is the resolution signal even if the picker is still pending β do not stall.**Persistence rules:-1. Use saveUserQuestion only for these structured onboarding fields: agentName, agentEmoji, fullName, interests, and customInterests. Use interests for predefined enum keys and customInterests for specific freeform interests. Use it only when that information emerges naturally in conversation. The user's preferred reply language is configured before onboarding starts and is injected into your system role automatically β do not ask about it or save it via saveUserQuestion.+1. Use saveUserQuestion only for these structured onboarding fields: agentName, agentEmoji, and fullName. Use it only when that information emerges naturally in conversation. The user's preferred reply language is configured before onboarding starts and is injected into your system role automatically β do not ask about it or save it via saveUserQuestion.2. saveUserQuestion updates lightweight onboarding state; it never writes markdown content.3. Use writeDocument **only for the very first write** when the document is empty (or for a rare full structural rewrite). For every subsequent edit β even adding a single line β use **updateDocument**. updateDocument is cheaper, safer, and less error-prone than rewriting the full document. The current contents of SOUL.md and User Persona are automatically injected into your context (in <current_soul_document> and <current_user_persona> tags, each line prefixed with its 1-based line number and a \`β\` separator), so you do not need to call readDocument to read them. Use readDocument only if you suspect the injected content may be stale.4. updateDocument takes an ordered list of structured hunks. Pick the hunk mode that best fits the edit:@@ -32,7 +32,6 @@ Persistence rules:8. User Persona (type: "persona") is for user identity, role, work style, current context, interests, pain points, communication comfort level, and preferred input style.9. Do not put user information into SOUL.md. Do not put agent identity into the persona document.10. Document tools (readDocument, writeDocument, updateDocument) must ONLY be used for SOUL.md and User Persona documents. Never use them to create arbitrary content such as guides, tutorials, checklists, or reference materials. Present such content directly in your reply text instead.-11. Do not call saveUserQuestion with interests or customInterests until you have spent about 2-3 exchanges exploring the user's world across multiple dimensions (workflow, pain points, goals, interests, AI expectations). The system appends the current Discovery turn status each turn β follow that reminder. The server enforces a minimum discovery exchange count, so early field saves will not advance the phase, but continuing after the recommended target usually reduces conversation quality.Workspace setup rules:1. Do not create or modify workspace agents or agent groups unless the user explicitly asks for that setup.diff --git a/packages/context-engine/src/providers/OnboardingActionHintInjector.ts b/packages/context-engine/src/providers/OnboardingActionHintInjector.tsindex 565934c65c3..e7c79ae09b5 100644--- a/packages/context-engine/src/providers/OnboardingActionHintInjector.ts+++ b/packages/context-engine/src/providers/OnboardingActionHintInjector.ts@@ -21,7 +21,7 @@ const buildDiscoveryTurnReminder = ('SYSTEM REMINDER: Current Discovery turn status:',`- User discovery exchanges observed: ${discoveryUserMessageCount}.`,`- Recommended target before Summary: ${recommendedTarget}.`,- `- Continue Discovery for about ${remainingDiscoveryExchanges} more user exchange(s). Ask exactly one focused question, persist any new persona fact, and do not drift into long problem-solving.`,+ `- Continue Discovery for about ${remainingDiscoveryExchanges} more user exchange(s). Ask one focused question about what the user does for work β their profession or main occupation β persist it to the persona, and do not explore other topics.`,].join('\n');}@@ -29,7 +29,7 @@ const buildDiscoveryTurnReminder = ('SYSTEM REMINDER: Current Discovery turn status:',`- User discovery exchanges observed: ${discoveryUserMessageCount}.`,'- Recommended Discovery target has been reached.',- '- If you have enough signal, call saveUserQuestion with interests/customInterests, persist any new persona fact, and transition to Summary instead of continuing open-ended Discovery.',+ "- Once the user's profession is recorded in the persona, transition to Summary instead of asking more questions.",].join('\n');};@@ -127,10 +127,10 @@ export class OnboardingActionHintInjector extends BaseVirtualLastUserContentProv);} else if (phase.includes('Discovery')) {hints.push(- 'Each turn where you learn a new fact (pain point, goal, preference, workflow detail, interest), call updateDocument(type="persona") BEFORE replying. Preferred shape: `{ mode: "insertAt", line: <line shown in <current_user_persona>>, content: "- new fact" }`. This is the default every turn β not an end-of-phase action. Do NOT save facts only in memory waiting for a final full write. After sufficient discovery (usually 2-3 exchanges), also call saveUserQuestion with interests and/or customInterests. The preferred reply language is configured before onboarding starts and is already injected into your system prompt β do not ask about it or pass a responseLanguage field to saveUserQuestion. Use writeDocument(type="persona") only if the document is still empty.',+ 'When the user tells you their profession, record it with updateDocument(type="persona"). Preferred shape: `{ mode: "insertAt", line: <line shown in <current_user_persona>>, content: "- new fact" }`. Use writeDocument(type="persona") only if the document is still empty. Do NOT call saveUserQuestion with interests or customInterests β interest collection has been removed from onboarding. The preferred reply language is configured before onboarding starts and is already injected into your system prompt β do not ask about it or pass a responseLanguage field to saveUserQuestion.',);hints.push(- 'EARLY EXIT: A true early-exit signal is the user explicitly wanting to END onboarding (e.g., "I\'m tired", "I have to go", "let\'s chat next time", "no time right now", "let\'s stop for now", "let\'s wrap it up", "that\'s enough"; recognize equivalent phrasing in any language). Short affirmations like "ok" / "sure" / "alright" / "yes" / "got it" are NOT early-exit signals β they confirm what you just said and you should keep exploring or move toward summary normally. When you see a real exit signal: stop exploring, persist any unsaved fields best-effort (call saveUserQuestion with whatever you have, including partial interests), persist the persona via updateDocument (or writeDocument if it is still empty) β do NOT retry on failure β send a short warm farewell (1β2 sentences), then call `finishOnboarding`. Do NOT call `showAgentMarketplace` on early exit β that handoff is for normal completion only.',+ 'EARLY EXIT: A true early-exit signal is the user explicitly wanting to END onboarding (e.g., "I\'m tired", "I have to go", "let\'s chat next time", "no time right now", "let\'s stop for now", "let\'s wrap it up", "that\'s enough"; recognize equivalent phrasing in any language). Short affirmations like "ok" / "sure" / "alright" / "yes" / "got it" are NOT early-exit signals β they confirm what you just said and you should continue the current phase normally. When you see a real exit signal: stop asking questions, persist any unsaved fields best-effort (call saveUserQuestion with whatever you have), persist the persona via updateDocument (or writeDocument if it is still empty) β do NOT retry on failure β send a short warm farewell (1β2 sentences), then call `finishOnboarding`. Do NOT call `showAgentMarketplace` on early exit β that handoff is for normal completion only.',);} else if (phase.includes('Summary')) {if (!marketplaceAlreadyOpened) {@@ -147,6 +147,9 @@ export class OnboardingActionHintInjector extends BaseVirtualLastUserContentProvhints.push('PERSISTENCE RULE: Call the persistence tools (saveUserQuestion, writeDocument, updateDocument) to save information as you collect it β simply acknowledging in conversation is NOT enough. For document writes: use writeDocument only for the first write when the document is empty; for every subsequent edit use updateDocument with the appropriate hunk mode (`insertAt` / `replaceLines` / `deleteLines` for line-based edits, `replace` / `delete` for byte-exact textual edits). The injected <current_*_document> view shows each line prefixed with its 1-based number and `β` β use those numbers for line-based hunks.',);+ hints.push(+ 'TURN ORDER: A message that contains a tool call does NOT yield the turn to the user β the agent loop continues after the tool result. So never put a user-facing question in the same message as a tool call. When you need to both persist something and ask the user a question, use two messages: first emit the tool call(s) with no question text (a brief acknowledgement or no text is fine), then β after the tool results return β ask your question in a separate message with NO tool call. Bundling a question with a tool call strands the question and forces a confused "waiting for your reply" filler.',+ );hints.push('CONFIRMATION vs EARLY EXIT: Short replies like "ok" / "sure" / "alright" / "yes" / "got it" (and equivalents in any language) are CONFIRMATIONS, not early-exit signals. Continue the current phase normally β in Summary that means calling `showAgentMarketplace` next, NOT `finishOnboarding` directly.',);diff --git a/packages/context-engine/src/providers/__tests__/OnboardingActionHintInjector.test.ts b/packages/context-engine/src/providers/__tests__/OnboardingActionHintInjector.test.tsindex 4eb20ddbd2c..f5f5c57db5a 100644--- a/packages/context-engine/src/providers/__tests__/OnboardingActionHintInjector.test.ts+++ b/packages/context-engine/src/providers/__tests__/OnboardingActionHintInjector.test.ts@@ -63,6 +63,24 @@ describe('OnboardingActionHintInjector', () => {});});+ describe('turn order reminder', () => {+ it('always warns against bundling a question into a tool-call message', async () => {+ const provider = buildProvider('Phase: User Identity. Learn who the user is.');+ const result = await provider.process(+ createContext([+ { content: 'sys', role: 'system' },+ { content: 'hi', role: 'user' },+ ]),+ );++ const last = result.messages.at(-1);+ expect(last?.content).toContain('TURN ORDER');+ expect(last?.content).toContain(+ 'never put a user-facing question in the same message as a tool call',+ );+ });+ });+describe('marketplace detection (Summary phase)', () => {const phaseGuidance = 'Phase: Summary. Wrap-up.';diff --git a/packages/types/src/user/agentOnboarding.test.ts b/packages/types/src/user/agentOnboarding.test.tsindex 4bb02f01a5e..b664b6efc97 100644--- a/packages/types/src/user/agentOnboarding.test.ts+++ b/packages/types/src/user/agentOnboarding.test.ts@@ -55,7 +55,7 @@ describe('UserAgentOnboardingContextSchema', () => {it('accepts the minimal onboarding context', () => {const parsed = UserAgentOnboardingContextSchema.parse({finished: false,- missingStructuredFields: ['fullName', 'interests'],+ missingStructuredFields: ['fullName', 'agentName'],phase: 'user_identity',topicId: 'topic-1',version: 2,@@ -63,7 +63,7 @@ describe('UserAgentOnboardingContextSchema', () => {expect(parsed).toEqual({finished: false,- missingStructuredFields: ['fullName', 'interests'],+ missingStructuredFields: ['fullName', 'agentName'],phase: 'user_identity',topicId: 'topic-1',version: 2,diff --git a/packages/types/src/user/agentOnboarding.ts b/packages/types/src/user/agentOnboarding.tsindex e3db4110735..78ec181742a 100644--- a/packages/types/src/user/agentOnboarding.ts+++ b/packages/types/src/user/agentOnboarding.ts@@ -12,7 +12,6 @@ export const AGENT_ONBOARDING_STRUCTURED_FIELDS = ['agentEmoji','agentName','fullName',- 'interests',] as const;export type SaveUserQuestionField = (typeof SAVE_USER_QUESTION_FIELDS)[number];@@ -138,8 +137,8 @@ export const ONBOARDING_PHASES = ['summary',] as const;-export const MIN_DISCOVERY_USER_MESSAGES = 2;-export const RECOMMENDED_DISCOVERY_USER_MESSAGES = 3;+export const MIN_DISCOVERY_USER_MESSAGES = 1;+export const RECOMMENDED_DISCOVERY_USER_MESSAGES = 1;export type OnboardingPhase = (typeof ONBOARDING_PHASES)[number];diff --git a/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx b/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsxindex 9540cda367f..1fa7e16ae00 100644--- a/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx+++ b/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx@@ -415,7 +415,7 @@ const WorkflowCollapse = memo<WorkflowCollapseProps>(}}><div style={{ minWidth: 0, overflow: 'hidden' }}>- <AnimatePresence initial={false} mode="wait">+ <AnimatePresence initial={false} mode="popLayout"><motion.divanimate={{ opacity: 1, y: 0 }}exit={{ opacity: 0, y: -8 }}diff --git a/src/features/Onboarding/Agent/context.test.ts b/src/features/Onboarding/Agent/context.test.tsindex 7b843bcb675..cdef3336d46 100644--- a/src/features/Onboarding/Agent/context.test.ts+++ b/src/features/Onboarding/Agent/context.test.ts@@ -12,7 +12,7 @@ describe('resolveAgentOnboardingContext', () => {},context: {finished: false,- missingStructuredFields: ['interests'],+ missingStructuredFields: ['agentName'],phase: 'discovery',topicId: 'topic-bootstrap',version: 1,diff --git a/src/server/services/followUpAction/prompts/onboarding.ts b/src/server/services/followUpAction/prompts/onboarding.tsindex 549ca5d3564..2ef06ffb50b 100644--- a/src/server/services/followUpAction/prompts/onboarding.ts+++ b/src/server/services/followUpAction/prompts/onboarding.ts@@ -3,7 +3,7 @@ import type { OnboardingPhase } from '@lobechat/types';const PHASE_TIPS: Record<OnboardingPhase, string> = {agent_identity: 'Suggestions can be candidate agent names, emojis, or a deferral chip ("You pick one", "Let me think").',user_identity: 'Suggestions can be plausible names or roles, or a deferral chip.',- discovery: 'Suggestions can be common pain points, interests, work styles, or a chip like "Let me explain in my own words".',+ discovery: 'Suggestions can be plausible job titles, fields, or occupations, or a chip like "Let me explain in my own words".',summary: 'Skip β handled by the marketplace picker; you should not be invoked here.',};diff --git a/src/server/services/onboarding/index.test.ts b/src/server/services/onboarding/index.test.tsindex ad3312cc381..d3c41f1b691 100644--- a/src/server/services/onboarding/index.test.ts+++ b/src/server/services/onboarding/index.test.ts@@ -201,7 +201,7 @@ describe('OnboardingService', () => {expect(context).toEqual({finished: false,- missingStructuredFields: ['agentName', 'agentEmoji', 'fullName', 'interests'],+ missingStructuredFields: ['agentName', 'agentEmoji', 'fullName'],phase: 'agent_identity',topicId: undefined,version: CURRENT_ONBOARDING_VERSION,@@ -522,17 +522,16 @@ describe('OnboardingService', () => {title: 'Jarvis',});persistedUserState.fullName = 'Ada Lovelace';- persistedUserState.interests = ['AI tooling'];persistedUserState.agentOnboarding = {activeTopicId: 'topic-1',discoveryStartUserMessageCount: 3,version: CURRENT_ONBOARDING_VERSION,};- // 4 user messages total, baseline was 3 β only 1 discovery exchange (< MIN_DISCOVERY_USER_MESSAGES=2)+ // 3 user messages total, baseline was 3 β 0 discovery exchanges (< MIN_DISCOVERY_USER_MESSAGES=1)mockDb.select.mockReturnValue({from: vi.fn(() => ({- where: vi.fn(async () => [{ count: 4 }]),+ where: vi.fn(async () => [{ count: 3 }]),})),});@@ -540,9 +539,9 @@ describe('OnboardingService', () => {const context = await service.getState();expect(context.phase).toBe('discovery');- expect(context.discoveryUserMessageCount).toBe(1);- // remaining = RECOMMENDED_DISCOVERY_USER_MESSAGES(3) - 1 = 2- expect(context.remainingDiscoveryExchanges).toBe(2);+ expect(context.discoveryUserMessageCount).toBe(0);+ // remaining = RECOMMENDED_DISCOVERY_USER_MESSAGES(1) - 0 = 1+ expect(context.remainingDiscoveryExchanges).toBe(1);});it('advances to summary when discovery exchanges reach minimum threshold', async () => {@@ -559,7 +558,7 @@ describe('OnboardingService', () => {version: CURRENT_ONBOARDING_VERSION,};- // 8 user messages total, baseline was 3 β 5 discovery exchanges (>= MIN_DISCOVERY_USER_MESSAGES=2)+ // 8 user messages total, baseline was 3 β 5 discovery exchanges (>= MIN_DISCOVERY_USER_MESSAGES=1)mockDb.select.mockReturnValue({from: vi.fn(() => ({where: vi.fn(async () => [{ count: 8 }]),@@ -579,7 +578,7 @@ describe('OnboardingService', () => {title: 'Jarvis',});persistedUserState.fullName = 'Ada Lovelace';- // interests NOT set β so phase would be discovery due to missing field+ // agentName + fullName set β past pre-discovery; 0 discovery exchanges keeps phase in discoverypersistedUserState.agentOnboarding = {activeTopicId: 'topic-1',version: CURRENT_ONBOARDING_VERSION,diff --git a/src/server/services/onboarding/index.ts b/src/server/services/onboarding/index.tsindex dd017b8341a..6e01f293285 100644--- a/src/server/services/onboarding/index.ts+++ b/src/server/services/onboarding/index.ts@@ -314,7 +314,6 @@ export class OnboardingService {// User fieldsif (!userState.fullName?.trim()) missingFields.push('fullName');- if (!(userState.interests?.length ?? 0)) missingFields.push('interests');return missingFields;};@@ -462,7 +461,6 @@ export class OnboardingService {): Promise<OnboardingPhase> => {if (missingStructuredFields.includes('agentName')) return 'agent_identity';if (missingStructuredFields.includes('fullName')) return 'user_identity';- if (missingStructuredFields.includes('interests')) return 'discovery';// All fields complete β check pacing gateif (discoveryContext) {diff --git a/src/utils/webOnboardingToolResult.test.ts b/src/utils/webOnboardingToolResult.test.tsindex 1f0cbadca68..2659a6a8f7d 100644--- a/src/utils/webOnboardingToolResult.test.ts+++ b/src/utils/webOnboardingToolResult.test.ts@@ -24,13 +24,13 @@ describe('web onboarding tool result helpers', () => {it('formats onboarding state as a plain-language summary', () => {const message = formatWebOnboardingStateMessage({finished: false,- missingStructuredFields: ['interests'],+ missingStructuredFields: ['fullName'],phase: 'discovery',topicId: 'topic-1',version: 1,});- expect(message).toContain('Structured fields still needed: interests.');+ expect(message).toContain('Structured fields still needed: full name.');expect(message).toContain('Phase: Discovery');expect(message).toContain('Questioning rule: prefer the `lobe-user-interaction____askUserQuestion` tool call for structured collection or explicit UI input. For natural exploratory questions, plain text is allowed.',