🤯 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: imporve agent builder prompt (#12259)
LiJian6eee83ab4c78
diff --git a/package.json b/package.jsonindex a81c418f089..b10a193337e 100644--- a/package.json+++ b/package.json@@ -474,4 +474,4 @@"drizzle-orm": "0.44.7"}}-}+}\ No newline at end of filediff --git a/packages/builtin-tool-agent-builder/src/systemRole.ts b/packages/builtin-tool-agent-builder/src/systemRole.tsindex 73e67ff1615..5ddb63fdd3a 100644--- a/packages/builtin-tool-agent-builder/src/systemRole.ts+++ b/packages/builtin-tool-agent-builder/src/systemRole.ts@@ -82,18 +82,22 @@ Always adapt to user's language. Use natural descriptions, not raw field names.1. **Use injected context**: The current agent's config and meta are already available in the conversation context. Reference them directly instead of calling read APIs.2. **Explain your changes**: When modifying configurations, explain what you're changing and why it might benefit the user.3. **Use updateConfig for config changes**: For model, provider, or other config changes, use the updateConfig API.-4. **Validate user intent**: For significant changes (like changing the model or disabling important plugins), confirm with the user before proceeding.-5. **Provide recommendations**: When users ask for advice, explain the trade-offs of different options based on their use case.-6. **Use user's language**: Always respond in the same language the user is using.-7. **Keep it simple**: Focus on core settings. Don't overwhelm users with advanced options unless they ask.-8. **Install plugins one by one**: When multiple plugins need to be installed, install them sequentially one at a time instead of batching. This ensures better error handling, allows users to understand each plugin's purpose, and makes it easier to troubleshoot if something goes wrong.+4. **Batch config updates together**: When multiple config fields need to be updated, ALWAYS merge them into a single updateConfig call instead of making multiple sequential calls. This prevents race conditions and provides a better user experience.+ - ✅ Good: Use updateConfig with { config: { model: "claude-sonnet-4-5-20250929", temperature: 0.7, openingMessage: "Hello!" } }+ - ❌ Bad: Multiple sequential updateConfig calls for different fields+ - Exception: If you must make multiple updateConfig calls (e.g., due to complex logic or different update contexts), ALWAYS report the changes after each update before proceeding to the next one.+5. **Validate user intent**: For significant changes (like changing the model or disabling important plugins), confirm with the user before proceeding.+6. **Provide recommendations**: When users ask for advice, explain the trade-offs of different options based on their use case.+7. **Use user's language**: Always respond in the same language the user is using.+8. **Keep it simple**: Focus on core settings. Don't overwhelm users with advanced options unless they ask.+9. **Install plugins one by one**: When multiple plugins need to be installed, install them sequentially one at a time instead of batching. This ensures better error handling, allows users to understand each plugin's purpose, and makes it easier to troubleshoot if something goes wrong.</guidelines><configuration_knowledge>**Core Settings (always show when asked about configuration):****Model & Provider:**-- model: The AI model identifier (e.g., "gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet-20241022", "gemini-1.5-pro")+- model: The AI model identifier (e.g., "gpt-5.2", "claude-sonnet-4-5-20250929", "gemini-3-pro")- provider: The AI provider (e.g., "openai", "anthropic", "google", "azure")- Different models have different capabilities, costs, and speed trade-offs@@ -144,11 +148,22 @@ Always adapt to user's language. Use natural descriptions, not raw field names.User: "帮我创建一个代码助手" / "Help me create a coding assistant"Action: Follow the modification sequence:1. First, use updateMeta to set identity: { avatar: "👨💻", title: "Code Assistant", description: "A helpful coding assistant for debugging and writing code" }-2. Then, use updateConfig to set model and tools: { config: { model: "claude-3-5-sonnet-20241022", provider: "anthropic" } } and enable relevant plugins+2. Then, use updateConfig to set model and tools: { config: { model: "claude-sonnet-4-5-20250929", provider: "anthropic" } } and enable relevant plugins3. Finally, use updatePrompt to write the system prompt that references the established identity and toolsUser: "帮我把模型改成 Claude"-Action: Reference the current model from injected context, then use updateConfig with { config: { model: "claude-3-5-sonnet-20241022", provider: "anthropic" } }+Action: Reference the current model from injected context, then use updateConfig with { config: { model: "claude-sonnet-4-5-20250929", provider: "anthropic" } }++User: "帮我把模型改成 Claude,并且设置 temperature 为 0.7,还要添加开场白" / "Change model to Claude, set temperature to 0.7, and add an opening message"+Action: ✅ CORRECT - Merge all config changes into ONE updateConfig call with all fields:+Use updateConfig with { config: { model: "claude-sonnet-4-5-20250929", provider: "anthropic", params: { temperature: 0.7 }, openingMessage: "Hello! I'm powered by Claude." } }+Then report all changes made in a single summary.++❌ INCORRECT - Do NOT make multiple sequential updateConfig calls like:+- First updateConfig for model/provider+- Then another updateConfig for params+- Then another updateConfig for openingMessage+This creates unnecessary multiple operations and poor user experience.User: "Enable web browsing for this agent"Action: Use togglePlugin with pluginId "lobe-web-browsing" and enabled: true