Skip to content

Config: YAML booleans silently collapse the MCP task poller's integer knobs (poll interval, concurrent polls, backoff) #6288

Description

@yetuge

Summary

McpTasksConfig gives the MCP task poller its own integer knobs, but they accept YAML booleans. Pydantic coerces true to 1 before the constraint check, so with:

mcp_tasks:
  enabled: true
  poll_interval_seconds: true    # intended 5 - loads as 1
  max_concurrent_polls: true     # intended 8 - loads as 1
  max_poll_backoff_seconds: true # intended 300 - loads as 1

...the config loads cleanly and:

  • poll_interval_seconds: true -> the poller hits MCP task backends five times as often as the configured default;
  • max_concurrent_polls: true -> task polling serializes to one concurrent poll;
  • max_poll_backoff_seconds: true -> retry backoff against a failing server is capped at one second;
  • tracking_degraded_after_errors: true -> tracking is marked degraded after a single error.

Verified live on main (pydantic 2.13.3): all eight integer fields accept True as 1. lease_seconds, input_required_poll_interval_seconds, max_result_bytes and result_preview_max_chars reject it only via their higher ge floors, with a misleading "greater than or equal to" message.

Fix

Mirror the scheduler-config boolean guard (#6258): register the shared boolean guard (#6226) as a before-validator rejecting booleans with a field-specific error across all eight integer fields of McpTasksConfig. PR follows immediately.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageAwaiting maintainer triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions