fix: Sub-agents settings show blank and switched off when a limit is 0 (#33612)

Saving the Sub-agents admin tab could turn sub-agents off and clear their system prompt when one of the limits was still 0. Older releases accepted 0 there, also from the SUBAGENTS_MAX_* environment variables, but the tab now fails to load such a value and shows everything blank and switched off, so saving writes that blank state back. A limit of 0 now shows as empty, meaning no limit, which matches what sub-agents already do with a 0 while they run.

Fixes #33609
This commit is contained in:
Classic298 2026-11-03 12:28:38 +01:00 • committed by GitHub
parent d22c4449ca
commit f3ef8b9491
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -814,7 +814,7 @@ class SubagentsConfigForm(BaseModel):
)
@classmethod
def normalize_limit(cls, value):
return None if value == '' else value
return None if value in ('', 0) else value
@field_validator('SUBAGENTS_MAX_CONCURRENT', 'SUBAGENTS_MAX_ASYNC', mode='before')
@classmethod