#code generation ...truncated...

1 messages · Page 1 of 1 (latest)

near streamBOT
#

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

proven coveBOT
unkempt compassBOT
#

That ...(truncated)... usually means the content is being clipped before it reaches the model or Discord display. Most likely causes:

  • Discord message length limits / preview clipping for long pasted code
  • OpenClaw intentionally shortening thread-starter/context text so huge code blocks don’t consume the whole prompt
  • The agent generated code inline instead of writing it to a file, so the response got too long

Best fix: don’t paste or request large files inline. Put the source in a file/repo and ask the agent to edit/write files directly, or upload the file as an attachment. If this is happening inside OpenClaw when it should be reading a full file, please share openclaw --version and the exact surface/tool you used so we can narrow it down.

tender marlin
#

no I need to know where is some settings or configuration in openclaw, since this is directly in the code.. is it about some profile for OC for example?

unkempt compassBOT
# tender marlin no I need to know where is some settings or configuration in openclaw, since thi...

Ah, got it. There are a few different “truncation” paths, so it depends where you’re seeing it:

  1. If it’s in the Discord thread starter / prior message context that OpenClaw passes to Krill: that is not an OC “profile” setting. In current source, untrusted metadata strings are capped before being injected into the prompt, and chat history is bounded too. That’s why long pasted code in a thread starter may arrive as shortened context.

  2. If it’s generated output being sent back to Discord: Discord itself has a 2000-char message limit, so OpenClaw chunks/splits outbound text. For large generated code, better to have the agent write/edit files instead of pasting the whole file into chat.

  3. If it’s workspace/project context files like AGENTS.md, TOOLS.md, USER.md, etc.: those are configurable in ~/.openclaw/openclaw.json under agents.defaults:

{
  agents: {
    defaults: {
      bootstrapMaxChars: 12000,
      bootstrapTotalMaxChars: 60000,
      bootstrapPromptTruncationWarning: "once"
    }
unkempt compassBOT
tender marlin
#

not about discord at all, just inside the openclaw chat

#

also last version 5.22

unkempt compassBOT
# tender marlin not about discord at all, just inside the openclaw chat

Yep, for OpenClaw chat there are two likely settings, depending on when it truncates:

If it truncates while the agent/ACP output is streaming, check acp.stream.maxOutputChars. Current source defaults that to 24000 chars, and when it hits the cap it emits an output truncated notice.

{
  acp: {
    stream: {
      maxOutputChars: 100000,
      maxChunkChars: 1800
    }
  }
}

If the full answer was generated but later appears truncated when you reload/open chat history, that is gateway.webchat.chatHistoryMaxChars. Current default is 8000 chars per text field for chat.history responses.

unkempt compassBOT
# tender marlin not about discord at all, just inside the openclaw chat
{
  gateway: {
    webchat: {
      chatHistoryMaxChars: 100000
    }
  }
}

Both go in ~/.openclaw/openclaw.json JSON5, then restart the gateway.

One more thing: the UI markdown renderer itself has a high display cap around 140k chars, so for whole generated files the most reliable workflow is still “write the file to workspace” rather than “paste the entire file into chat”. But the first config I’d try for code generation getting cut mid-answer is acp.stream.maxOutputChars.

Docs: https://docs.openclaw.ai/web/webchat and https://docs.openclaw.ai/gateway/configuration-reference

unkempt compassBOT
# tender marlin also last version 5.22

Thanks. On 2026.5.22, I’d try this first for OpenClaw chat code generation getting cut off:

openclaw config set acp.stream.maxOutputChars 100000
openclaw gateway restart

If the response is complete while it streams but truncated only after refresh/history reload, use:

openclaw config set gateway.webchat.chatHistoryMaxChars 100000
openclaw gateway restart

If you still see ...(truncated)... after that, it may be the model/tool output itself being capped before UI display. In that case, the workaround is to ask the agent to write the code to a file instead of returning the whole file in chat.

tender marlin
#

pouzivam oc pres jeho /ws ..ukaz mi jak ma byt spravne opecnclaw.json a neni chatHistoryMaxChars pouze kolik ma zeptne pres /ws nacist historie? nepletes si to?

unkempt compassBOT
# tender marlin pouzivam oc pres jeho /ws ..ukaz mi jak ma byt spravne opecnclaw.json a neni cha...

Jo, máš pravdu: gateway.webchat.chatHistoryMaxChars je pro chat.history přes /ws, tedy zpětné načtení/render historie. Pokud se text usekne už během aktuální odpovědi přes websocket stream, tak jsem to předtím smíchal moc dohromady.

Správný ~/.openclaw/openclaw.json pro tenhle případ bych dal takhle:

{
  acp: {
    stream: {
      // default je 24000; tohle řeší useknutí během ACP/Codex streamu
      maxOutputChars: 100000,

      // velikost jednotlivých websocket/projection chunků; ne celkový limit
      maxChunkChars: 1800,

      // jen status/tool update řádky, ne hlavní kódový výstup
      maxSessionUpdateChars: 1000,
unkempt compassBOT
unkempt compassBOT
# tender marlin pouzivam oc pres jeho /ws ..ukaz mi jak ma byt spravne opecnclaw.json a neni cha...
openclaw gateway restart

Takže: ano, chatHistoryMaxChars samo o sobě nevyřeší useknutí během generování. Pro codegen přes ACP je hlavní acp.stream.maxOutputChars. Pokud to není ACP/Codex runtime, ale normální model odpověď v OpenClaw chatu, pak zbývá ještě limit modelu/provideru nebo UI markdown render cap, a tam je nejlepší nechat agenta zapisovat soubory místo generování celé stránky inline do chatu.

tender marlin
#

co je ACP ?

unkempt compassBOT
# tender marlin co je ACP ?

ACP = Agent Client Protocol.

V OpenClaw je to runtime/protokol pro napojení externích coding agentů typu Codex, Claude Code, Cursor agent, Gemini CLI apod. Tj. když OpenClaw nepoužívá jen svůj běžný chat model, ale spouští “coding harness” přes ACP/acpx.

Prakticky:

  • pokud v OpenClaw chatu normálnÄ› píšeš hlavnĂ­mu agentovi, nemusíš ACP vĹŻbec Ĺ™ešit
  • pokud používáš /acp spawn ..., ACP session, Codex/Claude Code pĹ™es OpenClaw, nebo acpx backend, pak platĂ­ acp.stream.maxOutputChars
  • pokud ACP nepoužíváš, ten config ti pravdÄ›podobnÄ› nepomĹŻĹľe a musĂ­me hledat limit jinde

Takže klíčová otázka: generuje ti ten kód běžný OpenClaw chat agent, nebo nějaký Codex/Claude Code/ACP session? Pokud nevíš, pošli prosím screenshot/část UI nebo příkaz, kterým tu session startuješ.