mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-09-11 14:38:38 +00:00
Adds scheduler.recursion_limit to config.yaml (default 1000, clamped by max_recursion_limit) so scheduled background runs can use a different recursion limit than the web UI. The value is read at dispatch time, so a YAML edit applies to the next scheduled run without a Gateway restart. Also logs a warning when the resolver falls back to the default or clamps the configured value.
27 lines
745 B
Python
27 lines
745 B
Python
"""Tests for SchedulerConfig schema."""
|
|
|
|
import pytest
|
|
from pydantic import ValidationError
|
|
|
|
from deerflow.config.scheduler_config import SchedulerConfig
|
|
|
|
|
|
def test_scheduler_config_defaults():
|
|
config = SchedulerConfig()
|
|
|
|
assert config.enabled is False
|
|
assert config.recursion_limit == 1000
|
|
|
|
|
|
def test_scheduler_config_accepts_positive_recursion_limit():
|
|
assert SchedulerConfig(recursion_limit=1).recursion_limit == 1
|
|
assert SchedulerConfig(recursion_limit=1000).recursion_limit == 1000
|
|
|
|
|
|
def test_scheduler_config_rejects_non_positive_recursion_limit():
|
|
with pytest.raises(ValidationError):
|
|
SchedulerConfig(recursion_limit=0)
|
|
|
|
with pytest.raises(ValidationError):
|
|
SchedulerConfig(recursion_limit=-5)
|