Skip to content

Move glob import to top level in terminal_tool.py - #100

Closed
aydnOktay wants to merge 3 commits into
NousResearch:mainfrom
aydnOktay:refactor/move-glob-import-to-top
Closed

Move glob import to top level in terminal_tool.py#100
aydnOktay wants to merge 3 commits into
NousResearch:mainfrom
aydnOktay:refactor/move-glob-import-to-top

Conversation

@aydnOktay

Copy link
Copy Markdown
Contributor

This PR moves the glob module import from function scope to module level in terminal_tool.py, removing redundant inline imports in _check_disk_usage_warning, get_active_environments_info, and cleanup_all_environments functions. This follows Python best practices by keeping all imports at the top of the file, improving code organization and maintainability without changing any functionality.

- Implemented page storage system in ~/.hermes/web_cache/
- Added web_list_pages tool to list all cached pages
- Added web_search_pages tool to search through cached pages by URL, title, or content
- Added web_get_page tool to retrieve specific pages from cache
- Modified web_extract_tool and web_crawl_tool to automatically save pages to cache
- Resolves TODO items: Search capabilities, page storage, and listing tools
- Add return type hints to all helper functions
- Improve error handling in _check_disk_usage_warning with better logging
- Add exc_info=True to exception logging for better debugging
- Enhance docstrings with Args and Returns sections
- Improve error messages in cleanup functions
- Move glob import from function scope to module level
- Remove redundant inline imports for better code organization
- Follows Python best practices for import statements
@aydnOktay aydnOktay closed this Feb 27, 2026
@aydnOktay
aydnOktay deleted the refactor/move-glob-import-to-top branch February 27, 2026 00:53
Xowiek added a commit to Xowiek/hermes-agent that referenced this pull request Apr 15, 2026
CodyLee117 pushed a commit to CodyLee117/hermes-agent that referenced this pull request Jun 30, 2026
Live e2e (scout cap-out, 2026-06-30) surfaced a bug the mocked unit tests couldn't:
the agents-portal WAF 403s urllib's default 'Python-urllib/x.y' User-Agent, so the
dispatch lookup silently failed and no autopsy filed. Set an explicit UA on _api.
Verified end-to-end: file_cap_autopsy now autopsies a live working dispatch (NousResearch#100 →
dead, [autopsy:iteration_cap]). + regression test asserting the UA header.
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
…-mv8x-fg99-32mf) (NousResearch#118)

- Replace concatenated-KEY splitter with safe no-split normalizer per
  upstream 0.19.0. Values after the first '=' are now opaque data —
  embedded KEY= patterns can no longer synthesize assignments.
- Bump package version to 0.18.0 (Dependabot floor for CVE-2026-10222).
- Update docstrings, migrate message, and comments to reflect semantics-
  preserving behavior (GHSA-mv8x-fg99-32mf / CVE-2026-10222).
- Port full upstream sanitize test suite (17 tests) validating:
  - known KEY= inside values remains opaque
  - leading 'export ' prefix preserved
  - load_env never synthesizes variables from values
  - save_env_value / sanitize_env_file preserve value semantics

Closes Dependabot alert NousResearch#100 (LOW).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant