mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
* chore: remove Atropos RL environments, tools, tests, skill, and tinker-atropos submodule Delete: - environments/ (43 files — base env, agent loop, tool call parsers, benchmarks) - rl_cli.py (standalone RL training CLI) - tools/rl_training_tool.py (all 10 rl_* tools) - tests: test_rl_training_tool, test_tool_call_parsers, test_managed_server_tool_support, test_agent_loop, test_agent_loop_vllm, test_agent_loop_tool_calling, test_terminalbench2_env_security - optional-skills/mlops/hermes-atropos-environments/ - tinker-atropos git submodule + .gitmodules * chore: remove RL/Atropos references from Python source - toolsets.py: remove rl toolset block + update comment - model_tools.py: remove rl_tools group + update async bridging comment - hermes_cli/tools_config.py: remove RL display entry, _DEFAULT_OFF_TOOLSETS, setup block, and rl_training post-setup handler - tools/budget_config.py: remove RL environment reference in docstring - tests/test_model_tools.py: remove rl_tools from expected groups - tests/run_agent/test_streaming_tool_call_repair.py: fix stale cross-reference * chore: remove rl/yc-bench extras and tinker-atropos refs from pyproject.toml - Remove rl extra (atroposlib, tinker, fastapi, uvicorn, wandb) - Remove yc-bench extra - Remove rl_cli from py-modules - Remove [tool.ty.src] exclude for tinker-atropos - Remove [tool.ruff] exclude for tinker-atropos - Regenerate uv.lock * chore: remove tinker-atropos from install/setup scripts - setup-hermes.sh: remove entire tinker-atropos submodule install block - scripts/install.sh: remove both tinker-atropos blocks (Termux + standard) - scripts/install.ps1: remove tinker-atropos block - nix/hermes-agent.nix: remove tinker-atropos pip install line * chore: remove RL references from cli-config.yaml.example * docs: remove Atropos/RL references from README, CONTRIBUTING, AGENTS.md * docs: remove RL/Atropos references from website - Delete: environments.md, rl-training.md, mlops-hermes-atropos-environments.md - sidebars.ts: remove rl-training and environments sidebar entries - optional-skills-catalog.md: remove hermes-atropos-environments row - tools-reference.md: remove entire rl toolset section - toolsets-reference.md: remove rl row + update example - integrations/index.md: remove RL Training bullet - architecture.md: remove environments/ from tree + RL section - contributing.md: remove tinker-atropos setup - updating.md: remove tinker-atropos install + stale submodule update * chore: remove remaining RL/Atropos stragglers - hermes_cli/config.py: remove TINKER_API_KEY + WANDB_API_KEY env var defs - hermes_cli/doctor.py: remove Submodules check section (tinker-atropos) - hermes_cli/setup.py: remove RL Training status check - hermes_cli/status.py: remove Tinker + WandB from API key status display - agent/display.py: remove both rl_* tool preview/activity blocks - website/docs: remove RL references from providers.md + env-variables.md - tests: remove TINKER_API_KEY from conftest, set_config_value, setup_script * chore: remove RL training section from .env.example
51 lines
1.9 KiB
Python
51 lines
1.9 KiB
Python
"""Configurable budget constants for tool result persistence.
|
|
|
|
Per-tool resolution: pinned > config overrides > registry > default.
|
|
"""
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Dict
|
|
|
|
# Tools whose thresholds must never be overridden.
|
|
# read_file=inf prevents infinite persist->read->persist loops.
|
|
PINNED_THRESHOLDS: Dict[str, float] = {
|
|
"read_file": float("inf"),
|
|
}
|
|
|
|
# Defaults matching the current hardcoded values in tool_result_storage.py.
|
|
# Kept here as the single source of truth; tool_result_storage.py imports these.
|
|
DEFAULT_RESULT_SIZE_CHARS: int = 100_000
|
|
DEFAULT_TURN_BUDGET_CHARS: int = 200_000
|
|
DEFAULT_PREVIEW_SIZE_CHARS: int = 1_500
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class BudgetConfig:
|
|
"""Immutable budget constants for the 3-layer tool result persistence system.
|
|
|
|
Layer 2 (per-result): resolve_threshold(tool_name) -> threshold in chars.
|
|
Layer 3 (per-turn): turn_budget -> aggregate char budget across all tool
|
|
results in a single assistant turn.
|
|
Preview: preview_size -> inline snippet size after persistence.
|
|
"""
|
|
|
|
default_result_size: int = DEFAULT_RESULT_SIZE_CHARS
|
|
turn_budget: int = DEFAULT_TURN_BUDGET_CHARS
|
|
preview_size: int = DEFAULT_PREVIEW_SIZE_CHARS
|
|
tool_overrides: Dict[str, int] = field(default_factory=dict)
|
|
|
|
def resolve_threshold(self, tool_name: str) -> int | float:
|
|
"""Resolve the persistence threshold for a tool.
|
|
|
|
Priority: pinned -> tool_overrides -> registry per-tool -> default.
|
|
"""
|
|
if tool_name in PINNED_THRESHOLDS:
|
|
return PINNED_THRESHOLDS[tool_name]
|
|
if tool_name in self.tool_overrides:
|
|
return self.tool_overrides[tool_name]
|
|
from tools.registry import registry
|
|
return registry.get_max_result_size(tool_name, default=self.default_result_size)
|
|
|
|
|
|
# Default config -- matches current hardcoded behavior exactly.
|
|
DEFAULT_BUDGET = BudgetConfig()
|