iachat/app/javascript/dashboard
Sivin Varghese 0012fa2c35
fix: align message trimming with configured maxLength (#13947)
# Pull Request Template

## Description

This PR fixes 
1. Messages being trimmed to the default 1024 limit in `trimContent`
method, instead of channel-specific limits for drafts and AI tasks.
2. Telegram messages are allowed up to 10,000 characters in config, but
the API supports only 4096, causing failures for oversized messages.

Fixes
https://linear.app/chatwoot/issue/CW-6694/captain-ai-rewrite-tasks-truncate-draft-to-1024-chars-trimcontent
https://github.com/chatwoot/chatwoot/issues/13919

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

### Loom video

**Before**
https://www.loom.com/share/00e9d6b4d19247febf35dffa99da3805

**After**
https://www.loom.com/share/c4900e9effc345c79bcd8a5aa1ee277b


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2026-03-31 10:39:54 +05:30
..
api feat(whatsapp): add webhook registration and status endpoints (#13551) 2026-03-16 12:48:16 +05:30
assets fix(ui): resolve unreadable select options in dark mode (#13207) 2026-03-30 13:05:28 +05:30
components fix: align message trimming with configured maxLength (#13947) 2026-03-31 10:39:54 +05:30
components-next feat: support bulk select and delete for documents (#13907) 2026-03-26 19:48:12 +05:30
composables fix: Add fix to only allow confirmed agents to used in Agent Assingments at Macros/Automations (#13225) 2026-03-11 02:01:53 -07:00
constants feat: Add a priority + created at sort for conversations (#13658) 2026-02-25 18:22:41 -08:00
helper fix(i18n): add zh_TW snooze parser locale (#13822) 2026-03-25 16:54:18 +05:30
i18n feat: support bulk select and delete for documents (#13907) 2026-03-26 19:48:12 +05:30
mixins feat: allow configuring attachment upload limit (#12835) 2025-11-17 14:03:08 -08:00
modules feat: compose form improvements (#13668) 2026-03-02 18:27:51 +05:30
routes fix: show backend error message on API channel creation failure (#13855) 2026-03-27 11:42:33 +05:30
store fix: show backend error message on API channel creation failure (#13855) 2026-03-27 11:42:33 +05:30
stores feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00
App.vue chore: Remove vue-multiselect package and styles from codebase (#13585) 2026-02-19 15:42:34 +05:30
featureFlags.js chore: make all the deprecated feature flag reclaimable (#13646) 2026-02-26 18:01:13 +05:30