hermes - 💡(How to fix) Fix AFK follow-up virtual turns can disappear or complete without delivery [1 pull requests]

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…

AFK follow-up turns were configured and expected to run as gateway-native virtual turns, but the implementation was only present as local WIP and never made it into upstream/live code. During local dogfood before it disappeared, AFK virtual turns also exposed a delivery-path regression: an internal AFK response could be generated by the model but skipped by the adapter response-send path when a user message arrived mid-run.

Root Cause

Two separate gaps combine:

  • The AFK scheduler/helper was local-only WIP and not wired into upstream GatewayRunner, so gateway.afk_followup can disappear after branch/update churn while config still contains gateway.afk_followup.
  • BasePlatformAdapter._process_message_background suppresses any response when the interrupt event is set and a pending message exists. That is correct for normal user-originated stale responses, but wrong for internal synthetic events such as AFK follow-ups: the AFK summary should still be delivered, then the queued user message can drain afterward.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

AFK follow-up turns were configured and expected to run as gateway-native virtual turns, but the implementation was only present as local WIP and never made it into upstream/live code. During local dogfood before it disappeared, AFK virtual turns also exposed a delivery-path regression: an internal AFK response could be generated by the model but skipped by the adapter response-send path when a user message arrived mid-run.

Observed dogfood evidence

From local gateway logs/notes on 2026-05-07:

  1. AFK follow-up: injecting 15m virtual turn for ...
  2. inbound synthetic message begins: [Automated AFK follow-up] ...
  3. model run completes and gateway logs response ready: ... response=379 chars
  4. no matching platform send line appears afterward (Sending response / Telegram flush), so the user sees silence

User-facing impact: AFK work can silently complete without delivering its summary.

Root cause

Two separate gaps combine:

  • The AFK scheduler/helper was local-only WIP and not wired into upstream GatewayRunner, so gateway.afk_followup can disappear after branch/update churn while config still contains gateway.afk_followup.
  • BasePlatformAdapter._process_message_background suppresses any response when the interrupt event is set and a pending message exists. That is correct for normal user-originated stale responses, but wrong for internal synthetic events such as AFK follow-ups: the AFK summary should still be delivered, then the queued user message can drain afterward.

Desired behavior

  • AFK follow-up is opt-in via gateway.afk_followup.enabled.
  • A background watcher checks idle sessions at configured thresholds.
  • It skips active/running sessions and queued sessions.
  • It injects an internal MessageEvent so auth is bypassed but normal adapter delivery still happens.
  • Internal AFK responses are not suppressed merely because a later user message is pending.
  • Prompt is safety-scoped and does not request external/destructive actions.

Test coverage expected

  • threshold scheduler chooses the first unfired threshold
  • running/queued sessions are skipped
  • watcher injects one internal virtual turn per threshold
  • disabled config is inert
  • adapter-level pending messages block AFK injection
  • internal AFK responses still deliver when a pending user message exists

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 - 💡(How to fix) Fix AFK follow-up virtual turns can disappear or complete without delivery [1 pull requests]