fix(assistant): make the message length limit configurable (#14651)
* fix(assistant): make the message length limit configurable
The Assistant composer capped input at 500 characters with a hard textarea
maxLength while the Assistant API accepted 2000, so anything longer was
silently truncated in the browser and never reached the server. Users
building flows from long prompts lost the tail of their request with
nothing on screen to say so.
Both ends now read one operator-tunable limit,
LANGFLOW_ASSISTANT_MAX_MESSAGE_LENGTH (default 2000). The backend enforces
it on /assist and the headless /assist/run at request time, and mirrors it
to the visual editor through /api/v1/config so the UI cannot drift below
the API again. Over the limit the composer blocks sending and explains why
instead of truncating.
* fix(assistant): show the prompt limit in both composers
The welcome screen ("What do you want to build?") had a second 500-character
cap of its own, sliced in onChange, so it truncated prompts exactly like the
panel composer did. It now reads the same server-served limit.
Both composers make the cap visible instead of silent: the character count is
always on screen as N/LIMIT, input stops at the limit, and reaching it names
LANGFLOW_ASSISTANT_MAX_MESSAGE_LENGTH as the way to raise it. The textareas
are also height-bounded so a long draft scrolls inside the composer rather
than crowding out the conversation above it.
* fix(assistant): grow the composer with the draft
Both assistant composers stayed at their initial height, so a long prompt was
read through a one- or three-line slot. They now grow with the content up to
9rem and scroll past it, which keeps the conversation above the panel composer
readable.
The limit hint moves inside the textarea wrapper: as a direct child of the
composer's flex column it also inherited the column gap, spacing it far wider
than the same hint on the welcome screen. Its own padding is now symmetric in
both places.
* fix(assistant): tighten the limit hint spacing
With the hint on screen the composer column gap stacked on top of the hint own
padding, leaving a visible hole between the warning and the model row. The gap
collapses while the hint is showing, so the spacing is the hint padding alone.
* test(lfx): register the new assistant setting
The settings composition guard pins the exact field set of Settings, so adding
assistant_max_message_length without listing it here failed the count check.
---------
Co-authored-by: Eric Hare <ericrhare@gmail.com> C
Cristhian Zanforlin Lousa committed
f91c6c34a3e06aed47c0af3d936ca1448af8c1b3
Parent: a5ab0ab
Committed by GitHub <noreply@github.com>
on 8/20/2026, 6:37:16 PM