Skip to content

refactor: split adapter and cli cleanup - #939

Closed
kshitijk4poor wants to merge 2 commits into
NousResearch:mainfrom
kshitijk4poor:split/cleanup-pr
Closed

refactor: split adapter and cli cleanup#939
kshitijk4poor wants to merge 2 commits into
NousResearch:mainfrom
kshitijk4poor:split/cleanup-pr

Conversation

@kshitijk4poor

@kshitijk4poor kshitijk4poor commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Split unrelated cleanup/refactor work out of fix: stop repeated identical tool doom loops #823 into an independent, reviewable PR.
  • Deduplicate repeated helper logic across Discord/Slack/Telegram adapter flows.
  • Consolidate small CLI/browser utility cleanups without changing doom-loop behavior.

Scope

  • Includes: agent/display.py, gateway/platforms/{discord,slack,telegram}.py, hermes_cli/main.py, hermes_state.py, tools/browser_tool.py
  • Excludes: doom-loop detection changes in run_agent.py / tests/test_run_agent.py
  • Excludes: vision logging/test fixes

Related

Validation

  • python -m pytest tests/gateway/ -q
  • python -m pytest tests/test_cli_init.py tests/hermes_cli/test_commands.py -q

…or cleanups

- Extract _relative_time() to module-level in hermes_cli/main.py (was defined 3x)
- Add _run_simple_slash() helper for Discord slash commands (14 of 16 now use it)
- Fix build_tool_preview return type annotation (str -> str | None)
- Remove redundant `import re` in hermes_state.py methods (already at module level)
- Hoist _SANE_PATH to module-level constant in browser_tool.py
…shot cleanup

- Extract _send_file_attachment() in Discord adapter, _upload_file() in Slack adapter
- Add explicit FileNotFoundError handling in all platform adapters
- Remove redundant inline imports in Telegram adapter
- Throttle _cleanup_old_screenshots to run at most once per hour
@kshitijk4poor kshitijk4poor changed the title refactor: split adapter and cli cleanup out of #823 refactor: split adapter and cli cleanup Mar 11, 2026
teknium1 pushed a commit that referenced this pull request Mar 14, 2026
Salvaged from PR #939 by kshitij.

- deduplicate Discord slash command dispatch and local file send helpers
- deduplicate Slack file uploads while preserving thread metadata
- extract shared CLI session relative-time formatting
- hoist browser PATH cleanup constants and throttle screenshot pruning
- tidy small type and import cleanups
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #1279. I salvaged the substantive cleanup work onto current main, preserving contributor credit and adapting the newer gateway pieces (notably Slack thread-metadata preservation and Discord/file-helper integration) so it merges cleanly with current behavior.

@teknium1 teknium1 closed this Mar 14, 2026
teknium1 added a commit that referenced this pull request Mar 14, 2026
refactor: salvage adapter and CLI cleanup from PR #939
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Salvaged from PR NousResearch#939 by kshitij.

- deduplicate Discord slash command dispatch and local file send helpers
- deduplicate Slack file uploads while preserving thread metadata
- extract shared CLI session relative-time formatting
- hoist browser PATH cleanup constants and throttle screenshot pruning
- tidy small type and import cleanups
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…315847fd

refactor: salvage adapter and CLI cleanup from PR NousResearch#939
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Salvaged from PR NousResearch#939 by kshitij.

- deduplicate Discord slash command dispatch and local file send helpers
- deduplicate Slack file uploads while preserving thread metadata
- extract shared CLI session relative-time formatting
- hoist browser PATH cleanup constants and throttle screenshot pruning
- tidy small type and import cleanups
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…315847fd

refactor: salvage adapter and CLI cleanup from PR NousResearch#939
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Salvaged from PR NousResearch#939 by kshitij.

- deduplicate Discord slash command dispatch and local file send helpers
- deduplicate Slack file uploads while preserving thread metadata
- extract shared CLI session relative-time formatting
- hoist browser PATH cleanup constants and throttle screenshot pruning
- tidy small type and import cleanups
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…315847fd

refactor: salvage adapter and CLI cleanup from PR NousResearch#939
@kshitijk4poor
kshitijk4poor deleted the split/cleanup-pr branch August 5, 2026 07:09
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.

2 participants