[Bug] Non-admin users cannot create agents in Community Edition (v4.7+) due to LICENSE_ENFORCEMENT_ENABLED default
Bug Description
In Onyx v4.7+, non-admin users in Community Edition deployments are unable to create agents. The "New Agent" button on /app/agents is greyed out, and submitting /app/agents/create fails with:
"Failed to create agent: You do not have the required permissions for this action." This occurs even when
ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=falseis explicitly configured.
Documentation & Expected Behavior
According to the Understanding Permissions Documentation:
"Community Edition has no group permission configuration, so Create Agents is available to everyone." Authenticated users in Community Edition should be auto-granted
Permission.ADD_AGENTSviaCE_UNGATED_PERMISSIONS.
Root Cause
env.templatedoes not defineLICENSE_ENFORCEMENT_ENABLED.- In
backend/onyx/utils/variable_functionality.py,_LICENSE_ENFORCEMENT_ENABLEDdefaults to"true". - In
set_is_ee_based_on_env_variable(), even ifENABLE_PAID_ENTERPRISE_EDITION_FEATURES=false, the fallbackelif _LICENSE_ENFORCEMENT_ENABLED:triggers and callsglobal_version.set_ee(). - Although the startup log states:
"Without a license this deployment behaves as Community Edition."
global_version.is_ee_version()now returnsTrue. - In
backend/onyx/auth/permissions.py:Becauseif not global_version.is_ee_version() and user.account_type != AccountType.ANONYMOUS: granted |= CE_UNGATED_PERMISSIONSis_ee_version()isTrue,CE_UNGATED_PERMISSIONS(add:agents) is never granted. - In
seed_default_groups.py, the defaultBasicgroup is seeded only with("Basic", "basic")which does not implyadd:agents. - Because default system groups are immutable (
assert_group_config_is_editable), admins cannot enable agent creation in the UI.
Workaround
Explicitly setting LICENSE_ENFORCEMENT_ENABLED=false in .env prevents global_version.set_ee() from being called and restores CE behavior.
Suggested Fix
Either:
- In
permissions.py, check whether the instance actually has a valid license / enterprise features enabled rather than solely checkingglobal_version.is_ee_version(). - Or, include
Permission.ADD_AGENTSin the default seed grants for theBasicgroup inseed_default_groups.py.
Source: onyx-dot-app/onyx