feat: add offload_job tool — systemd-run isolation for heavy workloads - #15873
feat: add offload_job tool — systemd-run isolation for heavy workloads#15873realsigridjin wants to merge 3 commits into
Conversation
New tool that runs memory-heavy/long-running shell commands (benchmarks, model inference, indexing) under systemd-run --user units instead of as children of hermes-gateway.service. Prevents OOM-killing the gateway. - tools/offload_job_tool.py: start/status/tail/list/cancel actions - tools/terminal_tool.py: gateway-local offload guardrail patterns - toolsets.py: register offload_job in core + terminal toolsets - tests/tools/test_offload_job_tool.py: fallback, list, cancel, systemd tests
2eb1b72 to
af9a9f8
Compare
Subagents created via delegate_task previously did not inherit the parent's fallback_model / _fallback_chain configuration. This meant that when the primary provider (e.g. Claude) hit rate limits, child agents would fail instead of falling back to the configured backup provider (e.g. Kimi). Pass the parent's fallback configuration through the AIAgent constructor so _try_activate_fallback() works for subagents too. Co-Authored-By: Claude
- Cross-platform home dir via dirs crate (no hardcoded paths) - Auto workspace discovery from ~/.openclaw/workspace* - Google Drive upload via rclone integration - SQLite-safe backups (sqlite3 .backup) - Compressed tar.zst archives - Subcommands: backup, restore, list, upload, auto, setup - Config file support at ~/.config/hbackup/config.toml
|
Thanks for the detailed PR — closing with reasoning. Scope. Three unrelated changes in one PR: the offload_job tool, a delegate_task fallback_model inheritance fix, and a ~1000-line Rust hbackup CLI under Stale against main — silently reverts #16177. The branch is 84 commits behind. The terminal_tool.py changes delete Core design: duplicates existing infra. Refusal heuristic is too aggressive. hbackup. A Rust CLI with its own Cargo.toml, README, Google Drive uploader, and cron guide, but no Salvageable piece. The delegate_tool.py change — children inheriting the parent's fallback_model chain — is a reasonable 2-line fix on its own. If you'd like to re-submit that as a standalone PR against current main, happy to review. Closing the rest. |
Summary
New tool that runs memory-heavy/long-running shell commands (benchmarks, model inference, indexing) under
systemd-run --userunits instead of as children ofhermes-gateway.service. Prevents OOM-killing the gateway.Changes
tools/offload_job_tool.pysystemd-run --userfor isolation; subprocess fallback. Metadata persisted in~/.hermes/offload_jobs/.tests/tools/test_offload_job_tool.pytools/terminal_tool.py_GATEWAY_OFFLOAD_PATTERNSand_gateway_local_offload_guidance()— refuses heavy commands (benchmarks, GPU workloads) when running insidehermes-gateway.service, redirecting tooffload_jobtool instead.toolsets.pyoffload_jobin_HERMES_CORE_TOOLSandterminaltoolset.Why
hermes-gateway.serviceoffload_jobstarts those commands under a separate user systemd unit, preserving gateway availabilityTesting
pytest tests/tools/test_offload_job_tool.py— 5 tests covering fallback, list, cancel, systemd pathScope
Minimal, focused change. No modifications to agent loop, no breaking changes to existing tools.