Merge pull request #1656 from andyst-dev/fix/agents-rules-discovery