Skip to content

fix(gateway): include pre-tool text in non-streaming replies#6091

Open
Vasanthdev2004 wants to merge 1 commit into
NousResearch:mainfrom
Vasanthdev2004:fix-telegram-pretool-text-6067
Open

fix(gateway): include pre-tool text in non-streaming replies#6091
Vasanthdev2004 wants to merge 1 commit into
NousResearch:mainfrom
Vasanthdev2004:fix-telegram-pretool-text-6067

Conversation

@Vasanthdev2004

Copy link
Copy Markdown
Contributor

Summary

  • preserve visible assistant text from mixed content-plus-tool-call turns in non-streaming gateway replies
  • normalize pre-tool content before merging so hidden reasoning tags and structured text blocks do not leak into user-visible output
  • scope the merge to the current turn only and add regression tests for duplicate suppression, reasoning stripping, structured content, and history-offset reset behavior

Verification

  • py -3 -m pytest -o addopts= tests/gateway/test_pretool_text_delivery.py -q

Closes #6067

@erikamrc84

Copy link
Copy Markdown

Thank you for the quick fix! This was affecting our Telegram setup with MiMo. 🙏

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels Apr 30, 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 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Text content before tool calls is not delivered on Telegram (only visible in CLI)

3 participants