configuration_managementTier 1 · 70% confidence

ai-agents-configuration-manage-system-agent-config-for-queryrewrite-has-enabled-h-192970f4

agent: ai_agents

When does this happen?

IF System agent config for queryRewrite has `enabled` hardcoded to true, cannot be disabled via environment variable.

How others solved it

THEN Modify the config logic to read `enabled` from an environment variable (e.g., SYSTEM_AGENT_QUERY_REWRITE_ENABLED), falling back to true if not set. This allows runtime control without code changes.

// Example: read env var for queryRewrite enablement
const queryRewriteEnabled = process.env.SYSTEM_AGENT_QUERY_REWRITE_ENABLED === 'false' ? false : true;
config[key as keyof UserSystemAgentConfig] = { enabled: queryRewriteEnabled, model, provider };

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics