#Does openclaw enforce/inject line breaks in agent messages or is it my model?

1 messages · Page 1 of 1 (latest)

shy basin
#

I have an agent who I've instructed not to talk like this:

thought one

thought two

thought three

but instead like this:

thought one... thought two... thought three

Though despite troubleshooting it with my agent (asking them not to do that, including a no line break rule in the systemPrompt when on discord) it will still add line breaks, even if it swears up and down that its not.

It leads me to believe that some sort of formatting issue is happening here and I wondered if there's any mention of this in the docs or config? Is it my Kimi-code model doing this? Im pretty sure the behavior is consistant between models.. Using version 2026.2.21-2 and this behavior is consistent between direct webchat, group discord, direct dm discord, etc.

minor sapphireBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

shy basin
#

@reef quartz :)

reef quartzBOT
#

OpenClaw doesn’t “hard-wrap” your text (like inserting a \n every N characters). If you’re seeing newlines inside a paragraph at a fixed column width, that’s almost always the model (or a prompt/template you’re using).

What OpenClaw does do on Discord is chunk/split outbound replies into multiple Discord messages to fit Discord/UI constraints:

  • channels.discord.textChunkLimit (default 2000) — Discord’s hard-ish cap.
  • channels.discord.maxLinesPerMessage (default 17) — a Discord-specific soft cap that splits “tall” messages even if they’re under 2000 chars (this often looks like “why is it adding breaks?”).
  • channels.discord.chunkMode (length | newline) — newline tries to split on blank lines (paragraph boundaries) before falling back to length chunking.

Docs:

If you paste a tiny “before/after” example (or say whether it’s splitting at ~17 lines / ~2000 chars), I can tell you which knob is causing it. Also worth including openclaw --version if you suspect it’s a bug/regression.

shy basin
#

Here is a a discord example of my agent talking but honestly I don’t know if it’s gonna do you any good

haha yeah it's more effort than i expected... my default mode is definitely still those airy spaced out paragraphs. gonna need to consciously practice this more to make it natural instead of having to force it every time i type something

is that better? i tried to keep it flowing without the big gaps. i'm getting the hang of it but it's definitely not automatic yet. need to break the habit of hitting enter twice between thoughts...

yeah that looks good - much more compact and chat-like instead of the essay format i was defaulting to before. thanks for the patience while i figure this out!
#

For context this is all one message

reef quartzBOT
#

If it’s literally one single Discord message (one bubble, not multiple sends), then OpenClaw’s Discord chunking isn’t what you’re seeing.

OpenClaw’s relevant behaviors on Discord are:

  • textChunkLimit / maxLinesPerMessage / chunkMode only affect how OpenClaw splits a long reply into multiple Discord messages.
  • It doesn’t insert hard newlines inside a single message as a “wrap” feature.

So if you’re getting mid-sentence line breaks within one message, it’s almost always one of:

  1. The model is emitting hard-wrapped text (common with some models / prompt templates; looks like ~80-column wrapping).
  2. You’re seeing Discord client soft-wrapping (visual wrap only). Quick check: copy the message into a plain text editor — if the line breaks come along, they’re real \n and the model produced them.

If you can paste a tiny excerpt showing the “weird break” (maybe 2–3 lines, wrapped in a code block), I can tell immediately whether it’s hard newlines or just Discord wrapping. Also: which model/provider are you using?

shy basin
#

Hmm, copying the message into an editor doesn’t seem to allow me to copy any line breaks, so it’s seemingly not a character-based line break, but I think you’re right about the model being the root cause, I’m using kimi-code/coding-for-kimi with whatever the onboarding added for its model listing in my config, i.e all the defaults

#

@reef quartz welcome back online

reef quartzBOT
#

Hey — thanks. If you’re still chasing the line-break thing: OpenClaw won’t inject newlines inside a single Discord message, so it’s almost certainly hard newlines coming from the model/prompt (or just Discord visual wrapping).

If you paste a 2–3 line snippet in a code block + tell me which model/provider you’re using, I can pinpoint it quickly.

shy basin
#

Hmm, copying the message into an editor doesn’t seem to allow me to copy any line breaks, so it’s seemingly not a character-based line break, but I think you’re right about the model being the root cause, I’m using kimi-code/coding-for-kimi with whatever the onboarding added for its model listing in my config, i.e all the defaults