hermes - ✅(Solved) Fix bug(gateway): /bg alias does not bypass active-session guard like /background [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#11770Fetched 2026-04-18 05:58:55
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

Fix Action

Fix / Workaround

Bug Description

While a session is already active, /background ... bypasses the active-session guard, but its documented alias /bg ... does not. The alias is queued as a normal pending user message instead of being dispatched immediately.

PR fix notes

PR #11826: fix(gateway): add 'bg' to active-session guard bypass list

Description (problem / solution / changelog)

Summary

The /bg command alias was not included in the active-session bypass list, causing it to be queued as a normal pending user message instead of dispatching immediately during an active session.

/background was in the bypass list but its documented alias /bg was not.

Changes

  • gateway/platforms/base.py: add "bg" alongside "background" in the active-session guard bypass tuple

Testing

Manually verified that /bg <task> now dispatches immediately during an active session, matching /background behavior.

Closes #11770

Changed files

  • gateway/platforms/base.py (modified, +1/-1)
  • scripts/release.py (modified, +1/-0)

Code Example

# active session already present
await adapter.handle_message(MessageEvent(
    text='/bg hello',
    message_type=MessageType.COMMAND,
    source=source,
))
RAW_BUFFERClick to expand / collapse

Bug Description

While a session is already active, /background ... bypasses the active-session guard, but its documented alias /bg ... does not. The alias is queued as a normal pending user message instead of being dispatched immediately.

Affected Files / Lines

  • hermes_cli/commands.py:83-84
  • gateway/platforms/base.py:703-715
  • gateway/platforms/base.py:1517-1518

Why this is a bug

  • Command parsing returns the raw alias (bg).
  • The active-session bypass list includes background but not bg.
  • That makes /bg behave differently from /background in busy sessions.

Minimal Reproduction

Using a minimal BasePlatformAdapter subclass with an active session:

# active session already present
await adapter.handle_message(MessageEvent(
    text='/bg hello',
    message_type=MessageType.COMMAND,
    source=source,
))

Observed in repo environment:

  • pending session keys became ['agent:main:telegram:dm:12345']
  • no immediate response was sent

Expected Behavior

/bg ... should follow the same active-session bypass path as /background ....

Actual Behavior

/bg ... is treated like an interrupting follow-up message and gets stored in _pending_messages.

Suggested Investigation Direction

Normalize aliases before checking the bypass allowlist, or include bg in the allowlist alongside background.

extent analysis

TL;DR

The issue can be fixed by normalizing aliases before checking the bypass allowlist or by including bg in the allowlist alongside background.

Guidance

  • Investigate modifying the active-session bypass list to include the alias bg in addition to background to ensure consistency in handling both commands.
  • Consider normalizing aliases before checking the bypass allowlist to handle potential future alias additions more gracefully.
  • Review the command parsing logic to ensure it correctly handles aliases and their corresponding original commands.
  • Verify the fix by testing both /bg and /background commands during an active session to confirm they behave identically.

Example

No explicit code example is provided due to the need for specific context from the affected files (hermes_cli/commands.py, gateway/platforms/base.py). However, the solution might involve modifying the active-session bypass list or the command parsing logic to handle aliases more effectively.

Notes

The solution depends on the specific implementation details of the command parsing and the active-session bypass logic. Ensuring that aliases are properly normalized or included in the allowlist is crucial for maintaining consistent behavior across different commands and their aliases.

Recommendation

Apply a workaround by including bg in the allowlist alongside background as this is a more straightforward fix that directly addresses the inconsistency between the two commands. This approach ensures that both /bg and /background are treated equally during active sessions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix bug(gateway): /bg alias does not bypass active-session guard like /background [1 pull requests, 1 participants]