Skip to content

fix(gateway): update chunked progress messages - #26503

Closed
davetist wants to merge 1 commit into
NousResearch:mainfrom
davetist:fix/telegram-progress-chunk-updates
Closed

fix(gateway): update chunked progress messages#26503
davetist wants to merge 1 commit into
NousResearch:mainfrom
davetist:fix/telegram-progress-chunk-updates

Conversation

@davetist

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a Telegram gateway progress-update bug where tool-progress text that has already split into multiple messages keeps spawning fresh continuation replies instead of updating the existing progress messages.

The progress loop now tracks every visible progress chunk message id in order. On each update it edits existing chunks in place, sends a new chunk only when the rendered progress grows past another platform limit, and best-effort deletes stale trailing chunks if the rendered chunk count shrinks.

I searched existing bug reports and PRs before opening this. This overlaps with #26207 and the open rollover PRs #26208 / #26242, but takes a different approach: instead of rolling over to a new one-line/current bubble before overflow, it makes already-chunked progress messages stable and editable.

Related Issue

Refs #26207
Related: #26208, #26242, #25198

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • gateway/run.py
    • Adds progress-specific chunking helpers with platform-aware message limits.
    • Tracks progress chunk message ids as an ordered list instead of a single id.
    • Edits existing progress chunks in place after split.
    • Sends only newly needed chunks when the progress grows.
    • Best-effort deletes stale trailing chunks when the rendered progress shrinks.
  • tests/gateway/test_progress_chunking.py
    • Adds regression coverage for updating already-split progress chunks without sending duplicate continuations.
    • Adds coverage for sending only newly needed chunks when the progress grows into another chunk.

How to Test

  1. python -m compileall -q gateway/run.py tests/gateway/test_progress_chunking.py
  2. ruff check gateway/run.py tests/gateway/test_progress_chunking.py
  3. git diff --check
  4. python scripts/check-windows-footguns.py --all
  5. python -m pytest tests/gateway/test_progress_chunking.py tests/gateway/test_telegram_format.py tests/gateway/test_telegram_thread_fallback.py tests/gateway/test_telegram_topic_mode.py -q -o 'addopts='

Local result: 163 passed for the targeted Telegram/gateway subset.

I also tried a full local python -m pytest tests/gateway -q -o 'addopts=' before committing, but this checkout hit an existing local pytest resource issue: OSError: [Errno 24] Too many open files. I am not marking the full-suite checklist complete based on that run.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.7.4

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

python -m pytest tests/gateway/test_progress_chunking.py tests/gateway/test_telegram_format.py tests/gateway/test_telegram_thread_fallback.py tests/gateway/test_telegram_topic_mode.py -q -o 'addopts='
........................................................................ [ 44%]
........................................................................ [ 88%]
...................                                                      [100%]
163 passed in 7.79s

python scripts/check-windows-footguns.py --all
✓ No Windows footguns found (456 file(s) scanned).

@davetist

Copy link
Copy Markdown
Contributor Author

Closing as duplicate/overlapping work. I found existing open PRs covering the same Telegram tool-progress overflow/rollover bug, especially #26208 and #26242 for #26207. This draft used a different chunk-id tracking approach, but it should not compete with the active duplicate fixes.

@davetist davetist closed this May 15, 2026
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter labels May 15, 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 P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants