Cherry-picked from PR #789 by Aum08Desai, rebased onto current main
with conflict resolution and improvements:
- Added /reasoning command: view current level or set to none|low|medium|high|xhigh
- Persists to config via save_config_value, forces agent re-init
- Resolved conflict with COMMANDS_BY_CATEGORY refactor (added to Configuration category)
- Restricted valid levels to none, low, medium, high, xhigh (removed 'minimal')
- Updated _parse_reasoning_config in cli.py and _load_reasoning_config in gateway/run.py
- Improved display messages (show all valid options, clearer defaults/disabled state)
- Added EXPECTED_COMMANDS entry for regression guard
- Expanded test suite: 16 tests covering all levels, rejection, display, case insensitivity,
config save failure
Co-authored-by: Aum08Desai <145567217+Aum08Desai@users.noreply.github.com>
Add /background <prompt> to the gateway, allowing users on Telegram,
Discord, Slack, etc. to fire off a prompt in a separate agent session.
The result is delivered back to the same chat when done, without
modifying the active conversation history.
Implementation:
- _handle_background_command: validates input, spawns asyncio task
- _run_background_task: creates AIAgent in executor thread, delivers
result (text, images, media files) back via the platform adapter
- Inherits model, toolsets, provider routing from gateway config
- Error handling with user-visible failure messages
Also adds /background to hermes_cli/commands.py registry so it
appears in /help and autocomplete.
Tests: 15 new tests covering usage, task creation, uniqueness,
multi-platform, error paths, and help/autocomplete integration.
/provider command (CLI + gateway):
Shows all providers with auth status (✓/✗), aliases, and active marker.
Users can now discover what provider names work with provider:model syntax.
Gateway bugs fixed:
- Config was saved even when validation.persist=False (told user 'session
only' but actually persisted the unvalidated model)
- HERMES_INFERENCE_PROVIDER env var not set on provider switch, causing
the switch to be silently overridden if that env var was already set
parse_model_input hardened:
- Colon only treated as provider delimiter if left side is a recognized
provider name or alias. 'anthropic/claude-3.5-sonnet:beta' now passes
through as a model name instead of trying provider='anthropic/claude-3.5-sonnet'.
- HTTP URLs, random colons no longer misinterpreted.
56 tests passing across model validation, CLI commands, and integration.