hermes-agent/environments/tool_call_parsers
maxpaperclips 35b2250b36 Fix RL training pipeline: context truncation, double-encoding, shaped rewards
agent_loop.py:
- Add _truncate_context() with 2-phase strategy (truncate tool results,
  then drop oldest middle messages while keeping assistant+tool pairs)
- Add max_context_tokens parameter
- Guard against double-encoded JSON tool arguments (model outputs
  string instead of dict)

hermes_base_env.py:
- Wire max_context_tokens=max_token_length through all 3 HermesAgentLoop
  construction sites

hermes_parser.py:
- Prevent double-encoding: when arguments are already a string, use as-is
  instead of json.dumps() which would double-encode

swe_smith_oracle_env.py:
- Shaped reward structure for cold-start training:
  0.0 (no tools) -> 0.05/call up to 0.3 -> 0.4 (install ok) -> 1.0 (tests pass)
- _build_scored_item() override: truncate tokens/masks from END to fit
  max_token_len instead of discarding entire groups

All changes are in environments/ only — no effect on TUI/CLI agent loop.
2026-02-13 22:21:32 +00: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 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_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
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 RL training pipeline: context truncation, double-encoding, shaped rewards 2026-02-13 22:21:32 +00: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 Add support for Atropos Agentic RL environments (requires branch tool_call_support in Atropos atm) 2026-02-07 09:17:16 +00: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