#20589: Auto-reply: preserve Telegram DM newlines
size: S
Cluster:
Messaging Platform Improvements
## Summary
- Fix newline loss in user input before prompt delivery to embedded LLM.
- Preserve existing `/status` stripping behavior only when `/status` is actually present.
- Add e2e regression coverage for Telegram direct-message multiline input.
### Why
- User multiline DM content was flattened into a single line in normal conversation paths.
- Flattening removed user-intended line boundaries and harmed downstream LLM interpretation.
## Root Cause
- `stripInlineStatus()` normalized whitespace via `replace(/\s+/g, " ")` even when no `/status` existed.
- That behavior converted user `\n` line breaks into spaces.
## Change Type (select all)
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [x] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
- New permissions/capabilities? `NO`
- Secrets/tokens handling changed? `NO`
- New/changed network calls? `NO`
- Command/tool execution surface changed? `NO`
- Data access scope changed? `NO`
## Human Verification (required)
Author understanding: I reviewed and understand the implemented changes and their runtime behavior.
### Testing
- Degree: fully tested.
- Commands run:
- `pnpm build`
- `pnpm check`
- `pnpm test`
- Result: all passed.
### Deployment Validation
- Deployed to personal production environment.
- Runtime behavior validated as normal after deployment.
## Compatibility / Migration
- Backward compatible? (`Yes`)
- Config/env changes? (`No`)
- Migration needed? (`No`)
## Failure Recovery (if this breaks)
## Risks and Mitigations
None
Most Similar PRs
#19213: Telegram: preserve DM topic thread in direct replies
by Kemalau · 2026-02-17
73.1%
#3368: fix: sessions navigation, DM thread display, and DM thread delivery...
by Lukavyi · 2026-01-28
69.6%
#13580: fix(telegram): skip updateLastRoute when dmScope isolates DM sessions
by lailoo · 2026-02-10
68.2%
#23766: feat : add support for agent status reactions in Telegram messages
by jayy-77 · 2026-02-22
68.2%
#23729: fix : normalize local file paths for Windows compatibility across m...
by jayy-77 · 2026-02-22
68.1%
#17953: fix(telegram): prevent silent message loss and duplicate messages i...
by zuyan9 · 2026-02-16
67.7%
#16321: Fix #12767: suppress HEARTBEAT_OK leakage in Telegram DM replies
by tdjackey · 2026-02-14
67.7%
#16733: fix(ui): avoid injected newlines when tool output is hidden
by jp117 · 2026-02-15
67.4%
#23226: fix(msteams): proactive messaging, EADDRINUSE fix, tool status, ada...
by TarogStar · 2026-02-22
67.3%
#12936: fix(telegram): omit message_thread_id for private DM chats
by omair445 · 2026-02-09
67.2%