hermes-agent/environments/tool_call_parsers
aaronagent 1909877e6e fix: cap image download size at 50 MB, validate tool call parser fields
vision_tools.py: _download_image() loads the full HTTP response body into
memory via response.content (line 190) with no Content-Length check and no
max file size limit.  An attacker-hosted multi-gigabyte file causes OOM.
Add a 50 MB hard cap: check Content-Length header before download, and
verify actual body size before writing to disk.

hermes_parser.py: tc_data["name"] at line 57 raises KeyError when the LLM
outputs a tool call JSON without a "name" field.  The outer except catches
it silently, causing the entire tool call to be lost with zero diagnostics.
Add "name" field validation before constructing the ChatCompletionMessage.

mistral_parser.py: tc["name"] at line 101 has the same KeyError issue in
the pre-v11 format path.  The fallback decoder (line 112) already checks
"name" correctly, but the primary path does not.  Add validation to match.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 02:03:20 -07:00
..
__init__.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
deepseek_v3_1_parser.py fix: add missing re.DOTALL to DeepSeek V3.1 parser (same bug as V3) 2026-03-06 04:41:47 -08:00
deepseek_v3_parser.py fix: support multiple parallel tool calls in DeepSeek V3 parser (#989) 2026-03-15 03:55:24 +01:00
glm45_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
glm47_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
hermes_parser.py fix: cap image download size at 50 MB, validate tool call parser fields 2026-04-11 02:03:20 -07:00
kimi_k2_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
llama_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
longcat_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
mistral_parser.py fix: cap image download size at 50 MB, validate tool call parser fields 2026-04-11 02:03:20 -07:00
qwen3_coder_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00
qwen_parser.py Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00:00