Skip to content

Self-improving AI Employees for everyone

feat(settings): user toggle for auto-add-skill on tool connect

trohitga40ae4774d25
diff --git a/client/src/components/ui/SettingsPanel.tsx b/client/src/components/ui/SettingsPanel.tsx
index 017d0778..cac08c41 100644
--- a/client/src/components/ui/SettingsPanel.tsx
+++ b/client/src/components/ui/SettingsPanel.tsx
@@ -225,6 +225,16 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
disabled={isSaving}
/>
</Row>
+ <Row
+ label="Auto-add Skill for Connected Tools"
+ description="When a tool node is connected to an AI agent, automatically enable the matching skill in the agent's Master Skill (creating one if needed). Disconnecting the tool disables the skill."
+ >
+ <Switch
+ checked={settings.autoAddSkillForTools}
+ onCheckedChange={(checked) => handleChange('autoAddSkillForTools', checked)}
+ disabled={isSaving}
+ />
+ </Row>
</Section>
{/* Auto-save */}
diff --git a/client/src/components/ui/settingsPanel/schema.ts b/client/src/components/ui/settingsPanel/schema.ts
index 398b56fb..b1fa9081 100644
--- a/client/src/components/ui/settingsPanel/schema.ts
+++ b/client/src/components/ui/settingsPanel/schema.ts
@@ -19,6 +19,7 @@ export const workflowSettingsSchema = z.object({
memoryWindowSize: z.number().int().min(1).max(100).default(100),
compactionRatio: z.number().min(0.1).max(0.9).default(0.5),
maxProcesses: z.number().int().min(1).max(50).default(10),
+ autoAddSkillForTools: z.boolean().default(true),
});
export type WorkflowSettings = z.infer<typeof workflowSettingsSchema>;
@@ -40,6 +41,7 @@ export function fromServerRow(row: Record<string, any> | null | undefined): Work
memoryWindowSize: row.memory_window_size,
compactionRatio: row.compaction_ratio,
maxProcesses: row.max_processes,
+ autoAddSkillForTools: row.auto_add_skill_for_tools,
});
}
@@ -57,5 +59,6 @@ export function toServerRow(s: WorkflowSettings): Record<string, any> {
memory_window_size: s.memoryWindowSize,
compaction_ratio: s.compactionRatio,
max_processes: s.maxProcesses,
+ auto_add_skill_for_tools: s.autoAddSkillForTools,
};
}
diff --git a/server/core/database.py b/server/core/database.py
index c3af8323..8ae658a2 100644
--- a/server/core/database.py
+++ b/server/core/database.py
@@ -129,6 +129,12 @@ class Database:
))
logger.info("Added default_llm_model column to user_settings")
+ if "auto_add_skill_for_tools" not in columns:
+ await conn.execute(text(
+ "ALTER TABLE user_settings ADD COLUMN auto_add_skill_for_tools BOOLEAN DEFAULT 1"
+ ))
+ logger.info("Added auto_add_skill_for_tools column to user_settings")
+
# Migrate token_usage_metrics table - add cost columns
result = await conn.execute(text("PRAGMA table_info(token_usage_metrics)"))
columns = {row[1] for row in result.fetchall()}
@@ -1555,6 +1561,7 @@ class Database:
"onboarding_step": settings.onboarding_step,
"default_llm_provider": settings.default_llm_provider,
"default_llm_model": settings.default_llm_model,
+ "auto_add_skill_for_tools": settings.auto_add_skill_for_tools,
"created_at": settings.created_at.isoformat() if settings.created_at else None,
"updated_at": settings.updated_at.isoformat() if settings.updated_at else None
}
@@ -1598,6 +1605,8 @@ class Database:
existing.default_llm_provider = settings_data["default_llm_provider"]
if "default_llm_model" in settings_data:
existing.default_llm_model = settings_data["default_llm_model"]
+ if "auto_add_skill_for_tools" in settings_data:
+ existing.auto_add_skill_for_tools = settings_data["auto_add_skill_for_tools"]
else:
# Create new settings
existing = UserSettings(
@@ -1614,6 +1623,7 @@ class Database:
onboarding_step=settings_data.get("onboarding_step", 0),
default_llm_provider=settings_data.get("default_llm_provider"),
default_llm_model=settings_data.get("default_llm_model"),
+ auto_add_skill_for_tools=settings_data.get("auto_add_skill_for_tools", True),
)
session.add(existing)
diff --git a/server/models/database.py b/server/models/database.py
index 7f5bc285..a79780c4 100644
--- a/server/models/database.py
+++ b/server/models/database.py
@@ -259,6 +259,7 @@ class UserSettings(SQLModel, table=True):
onboarding_step: int = Field(default=0) # Last completed onboarding step (for resuming)
default_llm_provider: Optional[str] = Field(default=None, max_length=50) # Global default AI provider
default_llm_model: Optional[str] = Field(default=None, max_length=200) # Global default AI model
+ auto_add_skill_for_tools: bool = Field(default=True) # When a tool node connects to an AI agent's input-tools, auto-enable the matching skill
created_at: datetime = Field(
default_factory=lambda: datetime.now(timezone.utc),
sa_column=Column(DateTime(timezone=True), server_default=func.now())