Skip to content

feat(telegram): edit gateway status updates#30141

Closed
qike-ms wants to merge 1 commit into
NousResearch:mainfrom
qike-ms:feat/telegram-status-edit-clean
Closed

feat(telegram): edit gateway status updates#30141
qike-ms wants to merge 1 commit into
NousResearch:mainfrom
qike-ms:feat/telegram-status-edit-clean

Conversation

@qike-ms

@qike-ms qike-ms commented May 22, 2026

Copy link
Copy Markdown

Closes #30045

Summary

  • add Telegram send_or_update_status(chat_id, thread_id, status_key, text) with scoped bot-message storage and edit-in-place updates
  • fall back to a replacement status message when Telegram rejects editing a stale/deleted/non-editable message
  • route gateway progress/status checklist updates through the status API while preserving normal final/media/error sends

Tests

  • python -m pytest tests/gateway/test_telegram_status_update.py tests/gateway/test_telegram_status_gateway_integration.py tests/gateway/test_run_progress_interrupt.py -o 'addopts=' -q → 17 passed
  • python -m py_compile gateway/platforms/telegram.py gateway/run.py cron/scheduler.py tests/gateway/test_telegram_status_update.py tests/gateway/test_telegram_status_gateway_integration.py → pass

Reviews

  • Codex: APPROVE, no blockers
  • Claude Code (--model sonnet): APPROVE, no blockers
  • OpenCode (github-copilot/gpt-5.5): APPROVE, no blockers

Hygiene

  • Clean branch from origin/main
  • 5 files changed: cron/scheduler.py, gateway/platforms/telegram.py, gateway/run.py, and two focused gateway tests
  • No unrelated dashboard/cron WIP included

Machine: m5
Agent: codex
Session: 20260521_181316_535432
@daimon-nous daimon-nous Bot added type/feature New feature or request P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter comp/gateway Gateway runner, session dispatch, delivery comp/cron Cron scheduler and job management labels May 22, 2026
@daimon-nous

daimon-nous Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Clean resubmission of #30090 (closed). Implements #30045.

teknium1 added a commit that referenced this pull request May 23, 2026
…30864)

Closes #30045. Based on @qike-ms's PR #30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the feature and the issue spec @qike-ms — both were spot on. Landed the same shape in #30864 (merged: 9acf949) with credit in the PR body. The slimmer version drops the UTF-16 truncation helpers, the duck-typed adapter capability checks, and the OrderedDict LRU + per-key lock dict; the existing send()/edit_message() paths already cover length, formatting, overflow splitting and parse-mode handling so the wrapper only needed the cache. Closes #30045.

@teknium1 teknium1 closed this May 23, 2026
Gpapas pushed a commit to Gpapas/hermes-agent that referenced this pull request May 23, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
Mucky010 pushed a commit to Mucky010/hermes-agent that referenced this pull request May 24, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
exosyphon pushed a commit to exosyphon/hermes-agent that referenced this pull request May 24, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
mathias3 pushed a commit to mathias3/hermes-agent that referenced this pull request May 28, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
Bryce-huang pushed a commit to wbkunlun/hermes-agent that referenced this pull request May 29, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
#AI commit#
mosaiq-systems pushed a commit to mosaiq-systems/hermes-agent that referenced this pull request May 29, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
Seven74AI pushed a commit to Seven74AI/hermes-agent that referenced this pull request Jun 13, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…30864)

Closes #30045. Based on @qike-ms's PR #30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…ousResearch#30864)

Closes NousResearch#30045. Based on @qike-ms's PR NousResearch#30141.

Telegram status callbacks (lifecycle, compression, context-pressure)
used to append a fresh bubble on every emit. Now adapter tracks
{(chat_id, status_key) -> message_id}; first call sends, subsequent
calls edit. Failed edits drop the cache entry and fall through to a
fresh send.

- gateway/platforms/telegram.py: send_or_update_status() (+34 LOC)
- gateway/run.py: route _status_callback_sync through it when the
  adapter supports it; plain adapter.send() otherwise (+15 LOC)
- 5 tests covering first send / edit-in-place / edit-failure fallback
  / distinct key & chat isolation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: update Telegram status messages instead of appending progress spam

2 participants