Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

refactor: Remove 'enabled' field from AgentConfig and related components

wizardchen6687e81b967f
diff --git a/frontend/src/api/system/index.ts b/frontend/src/api/system/index.ts
index 8ec25f816..134d18e50 100644
--- a/frontend/src/api/system/index.ts
+++ b/frontend/src/api/system/index.ts
@@ -24,7 +24,6 @@ export interface PlaceholderDefinition {
}
export interface AgentConfig {
- enabled: boolean
max_iterations: number
reflection_enabled: boolean
allowed_tools: string[]
diff --git a/frontend/src/views/settings/AgentSettings.vue b/frontend/src/views/settings/AgentSettings.vue
index b80d1ae2d..4a1d9a6f3 100644
--- a/frontend/src/views/settings/AgentSettings.vue
+++ b/frontend/src/views/settings/AgentSettings.vue
@@ -821,7 +821,6 @@ const isAgentReady = computed(() => {
})
const buildAgentConfigPayload = (overrides: Partial<AgentConfig> = {}): AgentConfig => ({
- enabled: isAgentReady.value,
max_iterations: localMaxIterations.value,
reflection_enabled: false,
allowed_tools: localAllowedTools.value,
diff --git a/internal/handler/tenant.go b/internal/handler/tenant.go
index a938b09c0..249213551 100644
--- a/internal/handler/tenant.go
+++ b/internal/handler/tenant.go
@@ -233,7 +233,6 @@ func (h *TenantHandler) ListTenants(c *gin.Context) {
// AgentConfigRequest represents the request body for updating agent configuration
type AgentConfigRequest struct {
- Enabled bool `json:"enabled"`
MaxIterations int `json:"max_iterations"`
ReflectionEnabled bool `json:"reflection_enabled"`
AllowedTools []string `json:"allowed_tools"`
@@ -311,7 +310,6 @@ func (h *TenantHandler) GetTenantAgentConfig(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": gin.H{
- "enabled": tenant.AgentConfig.Enabled,
"max_iterations": tenant.AgentConfig.MaxIterations,
"reflection_enabled": tenant.AgentConfig.ReflectionEnabled,
"allowed_tools": tenant.AgentConfig.AllowedTools,
@@ -338,19 +336,13 @@ func (h *TenantHandler) updateTenantAgentConfigInternal(c *gin.Context) {
}
// Validate configuration
- if req.Enabled {
- if req.MaxIterations <= 0 || req.MaxIterations > 30 {
- c.Error(errors.NewAgentInvalidMaxIterationsError())
- return
- }
- if req.Temperature < 0 || req.Temperature > 2 {
- c.Error(errors.NewAgentInvalidTemperatureError())
- return
- }
- if len(req.AllowedTools) == 0 {
- c.Error(errors.NewAgentMissingAllowedToolsError())
- return
- }
+ if req.MaxIterations <= 0 || req.MaxIterations > 30 {
+ c.Error(errors.NewAgentInvalidMaxIterationsError())
+ return
+ }
+ if req.Temperature < 0 || req.Temperature > 2 {
+ c.Error(errors.NewAgentInvalidTemperatureError())
+ return
}
// Get existing tenant
@@ -365,7 +357,6 @@ func (h *TenantHandler) updateTenantAgentConfigInternal(c *gin.Context) {
}
tenant.AgentConfig = &types.AgentConfig{
- Enabled: req.Enabled,
MaxIterations: req.MaxIterations,
ReflectionEnabled: req.ReflectionEnabled,
AllowedTools: req.AllowedTools,
diff --git a/internal/types/agent.go b/internal/types/agent.go
index 0b68fa270..fb2464d66 100644
--- a/internal/types/agent.go
+++ b/internal/types/agent.go
@@ -10,7 +10,6 @@ import (
// AgentConfig represents the full agent configuration (used at tenant level and runtime)
// This includes all configuration parameters for agent execution
type AgentConfig struct {
- Enabled bool `json:"enabled"` // Whether agent mode is enabled
MaxIterations int `json:"max_iterations"` // Maximum number of ReAct iterations
ReflectionEnabled bool `json:"reflection_enabled"` // Whether to enable reflection
AllowedTools []string `json:"allowed_tools"` // List of allowed tool names