ccd32a9f0b
validate_platform_toolsets() accumulated a single valid_count across every platform, so the "zero valid toolsets" safety net was suppressed as soon as any one platform carried a valid toolset. A platform wiped to [] — the active one, typically cli — therefore produced no warning at all. resolve_enabled_toolsets() honours that empty list verbatim ([] is a list, so the platform-default fallback is skipped), leaving the agent with zero tool schemas. The model then has nothing to call and emits the tool call as assistant text with finish_reason=stop: no error, no warning, no log entry. That is the silent-failure mode this module was written to prevent (#38798). Note the asymmetry this leaves intact: a malformed *string* value is not a list, so it falls back to the platform default and fails open (#78103); an empty list fails closed. The fail-closed resolution is deliberate (the explicit_empty_ selection contract in tools_config.py, and #82010 wants it persistable), so this only adds the missing warning and does not change resolution semantics. Fixes #89050 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>