hermes - 💡(How to fix) Fix feat(gateway): continue Telegram background tasks from replies

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…

Code Example

/bg research X and report back

---

also check Y and update the output
RAW_BUFFERClick to expand / collapse

Feature Description

When Hermes delivers the final result of a Telegram /background / /bg task, replying to that result message should continue the same background task/session in the background.

Today the user can reply to the background result, and reply-to context may be injected into the current foreground session, but the reply is not routed back into the original background task/session. From the user's perspective, the natural workflow is:

  1. Start async work from Telegram:
    /bg research X and report back
  2. Hermes sends a background completion/result message.
  3. User replies directly to that result message with a follow-up:
    also check Y and update the output
  4. Hermes should treat that reply as a continuation of the completed/running background task, start a new background continuation using the prior background context, and deliver the follow-up result back to the same chat/thread.

Motivation

Telegram reply UX already gives users a clear object to continue from: the result message. For background tasks, this would make /bg workflows resumable and follow-up-capable instead of fire-and-forget.

This is especially useful when a background task produces a useful intermediate answer but the user wants another pass, a correction, or a next step without pulling the foreground chat into that task.

Expected Behavior

  • Background result deliveries should retain enough metadata to identify the originating background task/session.
  • If a user replies to a /background result message in Telegram, Hermes should detect the reply_to_message_id and resolve it to the associated background task/session.
  • Hermes should launch a background continuation using the prior background session/context plus the user's follow-up message.
  • The foreground chat should receive a short acknowledgement and the final continuation result, but the work should not block or hijack the foreground session.
  • This should work for both /background and /bg aliases.

Suggested Implementation Shape

One possible approach:

  1. When delivering a background completion to Telegram, store a mapping from delivered platform message id → background task/session id, chat id, thread id, and parent foreground session id.
  2. On inbound Telegram messages with reply_to_message_id, check whether the replied-to message is a known background result delivery.
  3. If matched, route the user's message into a background continuation runner instead of the normal foreground session path.
  4. The continuation could use the original background session as context, or clone/branch it into a child continuation session.
  5. Mirror continuation lifecycle/result events into the foreground transcript so future turns can reference what happened.

Related Work

  • #1594 / #1596 — reply-to context injection for out-of-session replies, including background task outputs. Useful context plumbing, but does not route replies back into the background task/session.
  • #8568 / #8592 — background task observability and /bg namespace.
  • #21750 — mirrors /background completions into gateway transcripts.
  • #6159 — /spawn background child sessions from current context.
  • #4949 / #4950 — persistent background subagents with later follow-up capability.
  • #5586 / #8482 — async delegation with task steering.

Notes

This request is specifically about the platform-native Telegram interaction: reply to the background result message, and have Hermes continue that same background task/session in the background.

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