Rl capabilities && File Operator Tools#15
Conversation
- Updated `.env.example` to include Tinker and WandB API keys for reinforcement learning training. - Enhanced `model_tools.py` to clarify configuration options and streamline the RL training process. - Expanded `README.md` with detailed instructions for setting up RL training using Tinker and WandB. - Modified `hermes_cli` files to integrate RL training tools and ensure proper configuration checks. - Improved `rl_training_tool.py` to reflect changes in training parameters and configuration management.
- Added the tinker-atropos submodule for enhanced RL training capabilities. - Updated model_tools.py to reorder RL function definitions and improve descriptions. - Modified rl_cli.py to include checks for the tinker-atropos setup and provide user guidance. - Adjusted toolsets.py and __init__.py to reflect changes in RL function availability. - Enhanced rl_training_tool.py to manage training processes directly without a separate API server.
- Modified `model_tools.py` to update default model IDs and add new RL function `rl_test_inference`. - Enhanced `README.md` with installation instructions for submodules and updated API key usage. - Improved `rl_cli.py` to load configuration from `~/.hermes/config.yaml` and set terminal working directory for RL tools. - Updated `run_agent.py` to handle empty string arguments as empty objects for better JSON validation. - Refined installation scripts to ensure submodules are cloned and installed correctly, enhancing setup experience.
… streaming - Added unique run ID generation for WandB tracking during test inference. - Enabled WandB usage for test tracking and updated command-line arguments accordingly. - Implemented real-time output streaming for process execution, improving log visibility and debugging. - Enhanced error handling to display last few lines of stderr for better troubleshooting.
- Introduced file manipulation capabilities in `model_tools.py`, including functions for reading, writing, patching, and searching files. - Added a new `file` toolset in `toolsets.py` and updated distributions to include file tools. - Enhanced `setup-hermes.sh` and `install.sh` scripts to check for and optionally install `ripgrep` for faster file searching. - Implemented a new `file_operations.py` module to encapsulate file operations using shell commands. - Updated `doctor.py` and `install.ps1` to check for `ripgrep` and provide installation guidance if not found. - Added fuzzy matching and patch parsing capabilities to improve file manipulation accuracy and flexibility.
🔍 자동 분석 결과이슈 요약리더보드 시스템 — 주간/월간/지역별 순위로 경쟁 유도 + 보상 제공 기술 구현 고려사항백엔드 (Phoenix/Ash)
iOS (SwiftUI)
우선순위 제안
관련existing 코드
🤖 HanNyang Auto Resolver |
* fix: cross-platform terminal/browser support and build fixes - Use platform-aware default shell (zsh on macOS, bash on Linux/Windows) instead of hardcoding /bin/zsh everywhere - Mark Playwright packages as external in Vite to fix chromium-bidi bundle errors during dev - Copy pty-helper.py to dist/server/assets/ on build so production server can find it - Fix browser launch guard to check `context` instead of `browser` (which is always null with launchPersistentContext) - Exclude unused diagnostics.ts stub from route tree - Update README with Playwright install step and Extra section Co-Authored-By: Claude Opus 4.6 <[email protected]> * docs: add Ubuntu/Debian prerequisites for Tauri desktop build Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
Previously hermes-api.ts helper functions (hermesGet, hermesPost, hermesPatch, hermesDeleteReq, streamChat) sent no Authorization header, causing 401 'Invalid API key' errors when the gateway has API_SERVER_KEY configured. Also exports BEARER_TOKEN from gateway-capabilities.ts so hermes-api.ts can import and reuse it for auth headers. Co-authored-by: mgnyc11 <[email protected]>
|
已合并到 PR #45 |
1 similar comment
|
已合并到 PR #45 |
…ameter + schema property' (NousResearch#15) from fix/terminal-notify-on-complete into main
Rl capabilities && File Operator Tools
Fixes 12 remaining MEDIUM issues from the deep audit (19 total, 7 fixed in Round 12): design_agent: - NousResearch#15: add asyncio.wait_for(300s) around LLM API call to prevent infinite hangs - NousResearch#17: replace 2x hardcoded 'claude-opus-4-8' with shared DEFAULT_MODEL constant qa_agent / validate_agent: - NousResearch#20,NousResearch#22,NousResearch#23: already fixed in Round 12 (verified — dynamic timeout/threshold values used) memory.py: - NousResearch#24: frontmatter parser uses regex r'^---$' instead of str.split('---',2), preventing false splits on content containing '---' (SQL, markdown tables) - NousResearch#25: parse and preserve 'description' field from frontmatter in metadata, fixing write→load roundtrip data loss profiles.py: - NousResearch#26: ProfileConfig now frozen=True (immutable dataclass per coding standards) deploy_agent: - NousResearch#31: replace 2x sync subprocess.run with asyncio.create_subprocess_exec - fix 5x .decode() → .decode('utf-8', errors='replace') for Windows CJK safety - remove unused import subprocess db.py: - NousResearch#27: add class docstring explaining RLock + _unlocked pattern - NousResearch#28: FK constraints already in DDL (verified PRAGMA foreign_keys=ON active) - NousResearch#29: add _ensure_connection() with PRAGMA integrity_check(1) + auto-reconnect on 4 critical methods (create_task, get_task, claim_task, submit_result) - extract _create_connection() static method for reuse by reconnect Tests: 79 passed, 0 failed
Three remaining findings from the code review.
#12 — hermes_cli/superagent.py: _strip_fences only handled a SINGLE
leading-and-trailing ``` envelope. Common model failure mode
is 'Here is the plan you asked for:\\n```yaml\\nfanout: 2\\n
...\\n```\\nLet me know.' — the leading prose means
stripped.startswith('```') is False so the function returned
the whole text unchanged, then yaml.safe_load choked → exit 2.
Fix: regex-based extraction with _FENCE_BLOCK_RE that pulls
the YAML body out of fenced blocks even when there's prose on
either side. Falls back to the simple-strip path for fence-
only output (preserves existing behaviour).
#13 — hermes_cli/web_server.py: /ready was BOTH side-effecting AND
racy. (a) Called path.parent.mkdir(parents=True, exist_ok=
True) on every probe — k8s polls every few seconds, so a
read-only mount surfaced PermissionError every hit and a
writeable mount got directories repeatedly recreated. (b)
The .readiness_probe storage check used a shared filename;
two concurrent k8s probes (liveness + readiness simultaneous)
could race, one's unlink raising FileNotFoundError → false
'not_ready' on a healthy node.
Fix: (a) audit_log probe just reports parent.exists(); never
mutates. (b) storage probe uses a per-PID + per-call unique
filename and tolerates FileNotFoundError on cleanup.
#15 — hermes_cli/superagent.py + hermes_cli/orchestrate.py: parent
AIAgent was constructed bare with model=... provider=...
quiet_mode=True only — no api_key, no base_url, no api_mode,
no credential_pool. delegate_task then pulled effective_
api_key=None from the parent, so child subagents failed to
authenticate whenever credentials lived in config.yaml
rather than env vars (the production case for serious users).
Fix: mirror hermes_cli/oneshot.py's resolve_runtime_provider
pattern in both _build_parent_agent and superagent.py's
parent construction. Threads api_key / base_url / provider /
api_mode / credential_pool from the resolved runtime, exactly
like oneshot does.
274 tests pass — no regressions.
All 15 code-review findings are now fixed across three commits
(f25ae81 showstoppers, 06e71bc critical correctness, this commit
lower-severity polish).
https://claude.ai/code/session_01PNyEMgrzVHtXnPGwUfotWw
…indings (one test each) #7 release_gate_parked suggested_command now carries the FULL gate sequence (event payload.commands joined with &&, fallback to joined _RELEASE_GATE_COMMANDS) instead of next(iter(...)) -> the bare leading cd. #8 freigabe/live_test_depth threaded into create_task's INSERT (new params) and the separate post-INSERT UPDATE removed from ingest_planspec -> root provenance is atomic with row creation, no NULL window / strand-on-raise. NousResearch#10 drop the redundant planspec_id child-dict key (always == planspec_subtask_id) and the dead `or` fallback in plugin_api; use planspec_subtask_id exclusively. NousResearch#11 add idempotent idx_events_kind on task_events(kind, task_id) (+ _REBUILD_SPECS) so the decision_queue kind='release_gate_parked' scan isn't full-table. NousResearch#13 /planspecs/detail: resolve+read EXACTLY once (parse_binding_planspec only, no validate-then-re-resolve TOCTOU window) and genericise resolve_planspec_path findings so the server's absolute vault path is never disclosed. NousResearch#14 lock the lossy AC body round-trip with a characterization test + explicit altitude-boundary docstring (structured fields live only in the .md; the full structured store is a Phase-4 follow-up). NousResearch#15 D1 characterization: make the docstring/contract truthful (no bug found -> no xfail; assertions are verified-correct regression tripwires). Gates: ruff clean; touched test files 643 passed; full scripts/run_tests.sh re-run for the record. Adversarial tree_root_woke real-chain repro still PASS. Co-Authored-By: Claude Opus 4.8 <[email protected]>
NousResearch#2 registry.get() alias + __contains__ — dict-like API consistency - tools/registry.py: added get() as alias for get_entry() - added __contains__ so "tool_name" in registry works NousResearch#3 _BUILTIN_SUBCOMMANDS guard test — catches missing entries - hermes_cli/main.py: added warning comment with test reference - tests/hermes_cli/test_main_integrity.py: 4 tests verifying the frozenset contains all core subcommands including reach NousResearch#4 hermes doctor --functional — actually test if tools work - hermes_cli/subcommands/doctor.py: added --functional flag - hermes_cli/doctor.py: runs reach capability functional probes as a new doctor section, showing real API call results NousResearch#6 proxy config in config.yaml — for restricted networks - hermes_cli/config.py: added proxy.url and proxy.apply_to_all to DEFAULT_CONFIG, added "proxy" to _KNOWN_ROOT_KEYS NousResearch#10 web toolset error messages — point to free alternatives - tools/web_tools.py: WEB_SEARCH_SCHEMA and WEB_EXTRACT_SCHEMA descriptions now mention free alternatives (Jina Reader, Exa, DDG) and "hermes reach setup" command for auto-configuration NousResearch#11 hermes mcp doctor — batch-test all MCP servers - hermes_cli/subcommands/mcp.py: added "doctor" subcommand - hermes_cli/main.py: _mcp_doctor() handler that tests all configured servers and reports status NousResearch#13 test isolation — investigated, not reproducible (pre-existing) - test passes consistently across 135 tests in 3 modules NousResearch#15 __tools__ list support — robust tool auto-discovery - tools/registry.py: _module_registers_tools() now also detects module-level __tools__ = [...] list declarations - tests/tools/test_registry.py: 3 new tests for __tools__ detection
|
Refactor progress on the PR #15 file-operations surface: extracted standalone file operation helpers into tools/file_operations_support.py while preserving the public tools.file_operations import surface. Commit: 44d016602 (refactor(file-ops): extract support helpers). Validation: py_compile for touched modules; focused file_operations suite 188 passed; standard gateway batches 265 passed and 115 passed; git diff --check clean. Note: broader file_tools/macOS temp-path tests still hit the existing /private/var sensitive-path guard and were not caused by this extraction. |
|
Refactor progress on PR #15 file operations, second slice: extracted lint registries and in-process lint helpers into tools/file_operations_lint.py while preserving imports from tools.file_operations. Commit: a41161fc5 (refactor(file-ops): extract lint helpers). Validation: py_compile for touched modules; focused file-operation/LSP lint suite 220 passed; standard gateway batches 265 passed and 115 passed; git diff --check clean. |
|
Refactor progress on PR #15 file operations, third slice: extracted search result types and shell search implementation into tools/file_operations_search.py while preserving ShellFileOperations.search and private wrapper method names used by tests. Commit: c342e24f1 (refactor(file-ops): extract search implementation). Validation: py_compile for touched modules; focused search/file-operation suite 200 passed; broader file-operation/LSP lint suite 229 passed; standard gateway batches 265 passed and 115 passed; git diff --check clean. Current line counts: tools/file_operations.py 1502, tools/file_operations_search.py 380, support 164, lint 110. |
|
Refactor progress on PR #15 file operations, fourth slice: moved lint/LSP orchestration behind tools/file_operations_lint.py while preserving ShellFileOperations private wrapper methods used by tests. Commit: c90c097ce (refactor(file-ops): extract lint orchestration). Validation: py_compile for touched modules; focused file-operation/LSP suite 240 passed; standard gateway batches 265 passed and 115 passed; git diff --check clean. Current line counts: tools/file_operations.py 1189, search 380, lint 339, support 164. |
|
Refactor progress on PR #15 file operations, fifth slice: extracted read/delete/move behavior into tools/file_operations_read.py and moved shared result dataclasses into tools/file_operations_results.py while preserving tools.file_operations exports and ShellFileOperations wrapper methods. Commit: a20c28974 (refactor(file-ops): extract read and file actions). Validation: py_compile for touched modules; focused file-operation/parser/live suite 241 passed; standard gateway batches 265 passed and 115 passed; git diff --check clean. Current line counts: tools/file_operations.py 879, read 221, results 82, search 380, lint 339, support 164. |
|
Refactor progress on PR #15 file operations, sixth slice: extracted write/patch mutation behavior into tools/file_operations_write.py and moved the abstract FileOperations interface into tools/file_operations_interface.py. Commit: 80da36609 (refactor(file-ops): extract write and patch actions). Validation: py_compile for touched modules; focused mutation/read/parser/LSP suite 284 passed; standard gateway batches 265 passed and 115 passed; git diff --check clean. The original hotspot is now under target: tools/file_operations.py 476 lines; interface 75; write 222; read 221; results 82; search 380; lint 339; support 164. |
|
Progress update for PRD #15: Implemented the next file-tool refactor slice in e6683b654 (refactor(file-tools): extract tracker state). What changed:
Line counts after this slice:
Validation:
Notes:
|
|
Progress update for PRD #15: Implemented another file-tool refactor slice in 6c6ead02f (refactor(file-tools): extract path safety helpers). What changed:
Line counts after this slice:
Validation:
Notes:
|
|
Progress update for PRD #15: Implemented the third file-tools slice in 37c3bdd13 (refactor(file-tools): extract env cache helpers). What changed:
Line counts after this slice:
Validation:
This continues the low-merge-risk pattern: move implementation behind small modules while preserving the old tools.file_tools import and patch surface. |
|
Progress update for PRD #15: Implemented the next file-tools slice in 9a3e19b4d (refactor(file-tools): extract read handler). What changed:
Line counts after this slice:
Validation:
Note:
|
|
Progress update for PRD #15: Implemented the next file-tools slice in 6138eaa1a (refactor(file-tools): extract search handler). What changed:
Line counts after this slice:
Validation:
Next remaining PR #15 seam is the write/patch mutation handler block; extracting that should bring tools/file_tools.py close to or under the 500-line target. |
|
Progress update for PRD #15: Implemented the mutation/schema slice in 50e42d119 (refactor(file-tools): extract mutation handlers). What changed:
Line counts after this slice:
Validation:
Known existing caveats kept separate:
|
…ded for version bumps) (NousResearch#15) * [agento] fix: green-gate Gate 3 — auto-PASS dependabot PRs (no CR needed for version bumps) dependabot[bot] PRs are automated dependency bumps. Requiring a CodeRabbit review blocks them indefinitely when CR hits rate limits. Add PR_GATE3_AUTHOR check: if author == dependabot[bot], Gate 3 auto-PASSes. Human-authored PRs continue to require CR APPROVED. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * [agento] fix: set LATEST_CR=APPROVED for dependabot Gate 3 auto-PASS (Gate 5 fast-path) BugBot caught that LATEST_CR was unset when dependabot PRs auto-PASS Gate 3, making Gate 5's CR-approved non-blocking fast-path unreachable for those PRs. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * [agento] fix: skeptic-cron Gate 3 — dependabot PRs auto-PASS (no CR needed) Mirrors green-gate Gate 3 dependabot exemption so dependabot version bumps can be auto-merged by skeptic-cron without requiring a formal CR review. Adds author field to PR JSON payload so dependabot detection works in the loop. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Rl capabilities && File Operator Tools
…seat) Rebase reconciliation for issue NousResearch#15 (v2026.6.19 merge). Commit 1's multi-user-isolation change "ResponseStore JSON blob now carries user_id" auto-merged its `"user_id": user_id` line into upstream v2026.6.19's NEW `_write_sse_responses._persist_response_snapshot` (git matched the `_response_store.put(...)` block), but `user_id` was not in that method's scope -> NameError at runtime on the streaming /v1/responses path (api_server.py:3261). py_compile/import don't catch undefined names in nested closures; surfaced by the api_server regression suite. Fix: add `user_id` param to `_write_sse_responses` and forward it from `_handle_responses` (which holds `user_id = scope["user_id"]`). Belongs logically in commit 166397c (multi-user isolation v1); kept separate so the rebase replay stays auditable. Authoritative kg suites: 231 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Rl capabilities && File Operator Tools
…de changes) Ran a read-only dry-run against a real exported skill library (76 SKILL.md, 25 candidates, nested category dirs + CJK) in an isolated HERMES_HOME. Pipeline ran cleanly and safely (no mutation); LLM decisions were sensible (2 consolidations proposed, rest kept standalone). Two real gaps fixtures could never expose: - dry-run under-reports consolidation proposals (counts/arrays stay 0 while prose proposes merges) — asymmetric vs split/deprecate (KNOWN_ISSUES NousResearch#15) - keyword-retention guard is near-inert on nested/CJK skills: _load_skill_keywords resolves only flat paths -> name-only fallback (KNOWN_ISSUES NousResearch#16) Guards were not exercised (model used the YAML channel; 25 skill_view, 0 skill_manage). No code changed. Co-Authored-By: Claude <[email protected]>
…n report (NousResearch#15 / P0) In dry-run nothing is removed, so the removal-based classification left consolidated/pruned empty even when the model proposed merges — while splits/deprecations already surfaced their YAML proposals. A dry-run preview therefore under-reported what a real run would do (REPORT.md printed 'consolidated: 0' above a prose body proposing merges). Surface the YAML-block consolidation/pruning proposals into run.json counts/arrays + REPORT.md, tagged source='model (proposed, dry-run)' and behind a DRY-RUN banner. The fold runs AFTER the cron-rewrite block so a dry-run never mutates cron/jobs.json; real-run classification is unchanged (guarded by a test). Co-Authored-By: Claude <[email protected]>
…h-pass real-data re-verification Co-Authored-By: Claude <[email protected]>
…o code changes) Ran a read-only dry-run against a larger, deliberately uncleaned backup (130 usage records vs 123 files, path-prefixed keys, all-active-despite-archive, external symlink). Result: no errors/exceptions handling the dirty data; LLM emitted a well-formed empty structured block (keep all 27); guard not exercised (YAML channel). NousResearch#15 fix makes the reported 0 trustworthy (matches empty block) vs the 8th-pass ambiguous 0. One untested dimension noted: the active-vs-archived usage mismatch's effect on the deterministic prune is not covered by dry-run (prune is skipped). No code changed. Co-Authored-By: Claude <[email protected]>
Anthropic bills any >200K-input request on a subscription (OAuth) account
to the EXTRA-USAGE budget, not plan limits — even without the context-1m
beta header (1M context is GA on Claude 4.6+). A 339K-token desktop session
got permanent 'You are out of extra usage' 400s while a small probe on the
same token returned 200.
Fix: _apply_subscription_context_cap() clamps the resolved context to 200K
when the token is an OAuth/setup token (sk-ant-oat*, eyJ*, cc-*). Metered
API keys (sk-ant-api*) are NOT capped. Escape hatch: anthropic.long_context.
Tests: test_critical26_subscription_context_capped_at_plan_lane,
test_critical26_long_context_escape_hatch (both pass)
See CRITICAL NousResearch#15 in CRITICAL-ISSUES.md for full RCA.
Rl capabilities && File Operator Tools
Initial RL training toolset and complete file operations toolset (to make it operate much more like a coding agent)