Skip to content

fix(gateway): show Telegram context compaction notice - #40378

Closed
guinnessmax wants to merge 1 commit into
NousResearch:mainfrom
guinnessmax:fix/telegram-context-compaction-notice
Closed

fix(gateway): show Telegram context compaction notice#40378
guinnessmax wants to merge 1 commit into
NousResearch:mainfrom
guinnessmax:fix/telegram-context-compaction-notice

Conversation

@guinnessmax

Copy link
Copy Markdown

Summary

Telegram currently suppresses the context compaction lifecycle status as gateway noise:

r"|compacting\\s+context\\s+[—-]\\s+summarizing\\s+earlier\\s+conversation"

That means long gateway turns can silently pause while Hermes summarizes older conversation history. From the user's perspective, especially in Telegram, this looks like the bot is stuck or has lost context.

This matches the concern raised in #16469: users have no signal when context is auto-compressed / summarized.

User-visible impact

  • A long Telegram session pauses during context compaction.
  • Hermes emits a lifecycle status like:
🗜️ Compacting context — summarizing earlier conversation so I can continue...
  • The Telegram gateway filters it out via _TELEGRAM_NOISY_STATUS_RE.
  • The user sees silence instead of an explanation.

Suggested fix

Do not classify the compaction lifecycle message as Telegram noise. Keep filtering noisy auxiliary/retry/provider chatter, but let this one status through.

Local verification

UV_PROJECT_ENVIRONMENT=.venv-codex uv run --extra dev python -m pytest tests/gateway/test_telegram_noise_filter.py -q
.......                                                                  [100%]
7 passed in 1.25s

Stop classifying the context compaction lifecycle status as Telegram noise.
Long gateway turns can pause while Hermes summarizes older conversation history;
Telegram users should see that state instead of waiting through silent
compaction.

Add regression coverage that keeps auxiliary/retry chatter filtered while
allowing the compaction notice through.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter P3 Low — cosmetic, nice to have labels Jun 6, 2026
@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing — routine compaction is silent by design on chat surfaces: the noise regex this PR deletes from now gates every chat platform fail-closed (widened beyond Telegram by #39293), so removing the compacting context pattern would un-silence every gateway, not just Telegram. Failure notices and manual /compress feedback are the deliberate carve-outs from that silence.

The right vehicle for what you want is #52995 — an opt-in, default-off progress notice. If that gets a maintainer yes, a reshaped version of this PR behind that flag would be welcome.

@teknium1 teknium1 closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/telegram Telegram bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants