When use_vision is set to False, screenshots should not be sent to the
judge LLM. This is a privacy concern as websites may contain sensitive
data that users explicitly do not want shared with LLMs.
Changes:
- Add use_vision parameter to construct_judge_messages()
- Only encode and include screenshots when use_vision is not False
- Pass self.settings.use_vision from _judge_trace() to construct_judge_messages()
- Add comprehensive tests for all use_vision modes
Fixes#3726
- agent/views.py: Move RateLimitError import inside format_error() function
to avoid loading openai SDK (~800ms) at module level
- llm/messages.py: Replace openai.BaseModel with pydantic.BaseModel directly
to remove unnecessary openai dependency
- filesystem/file_system.py: Move reportlab imports inside sync_to_disk_sync()
to avoid ~40ms startup cost when PDF generation is not used
- utils.py: Convert OpenAIBadRequestError and GroqBadRequestError to lazy
loaders to avoid loading SDKs at module level
This improves import time for users who don't use OpenAI provider,
especially when using Anthropic, Google, or other providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously all grok models had vision disabled. Only grok-3 variants
(grok-3, grok-3-mini, grok-3-fast) and grok-code models don't support
vision. grok-2 and grok-4 models now correctly retain vision support.
This change ensures that sensitive data in action results is filtered before being included in state messages sent to the LLM. This prevents accidental leakage of private information. New tests are added to verify this functionality.
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>