Description
When an agent performs many sequential tool calls (8+), the streaming display in Discord accumulates tool-call lines (✅ command) that consume most of the 1900-char truncation budget. If the agent then emits a text message mid-stream (e.g. asking the user for confirmation), compose_display() places tool lines first and text after — the text gets truncated by the streaming preview and becomes invisible to the user.
Since the streaming edit loop (introduced in #135) only edits a single message and never sends new ones, the hidden text has no other path to reach the user. The agent waits for a reply it will never get, and the thread hangs indefinitely.
The root cause is in discord.rs edit_handle: it calls format::truncate_chars(&content, 1900) which always keeps the first 1900 chars. compose_display() renders tool lines before text, so tool history eats the budget and agent text is silently dropped.
Affects any ACP backend with interactive tool flows (claude-agent-acp, kiro-cli, etc.). Introduced after #135 + #138 merged into main.
Related: #135 (message fragmentation fix), #138 (tool call dedup), #58 (cross-session deadlock — different issue)
Steps to Reproduce
- Connect a Discord bot to an ACP backend with tool use (e.g. claude-agent-acp with bash/file tools)
- Send a prompt that triggers 8+ sequential tool calls with a mid-flow confirmation, e.g.:
@bot clone this repo, check each of the 10 config files, and ask me before making any changes
- The agent runs tools (git clone, cat file1, cat file2, ...) — each adds a ✅
command line
- After several tools, the agent emits text asking for confirmation (e.g. "I found an issue in config-7.yaml. Should I fix it?")
- Observe: Discord message shows only the tool call list followed by
… — the agent's question is not visible
- The thread is now deadlocked — agent waits for user input, user doesn't know there's a question
Expected Behavior
The user should always be able to see the agent's latest text output during streaming, even when there are many completed tool call entries above it. Suggested fix: collapse completed tool entries during streaming (e.g. "✅ 8 tool(s) completed") to preserve budget for agent text, then expand to full detail on final edit.
Description
When an agent performs many sequential tool calls (8+), the streaming display in Discord accumulates tool-call lines (✅
command) that consume most of the 1900-char truncation budget. If the agent then emits a text message mid-stream (e.g. asking the user for confirmation),compose_display()places tool lines first and text after — the text gets truncated by the streaming preview and becomes invisible to the user.Since the streaming edit loop (introduced in #135) only edits a single message and never sends new ones, the hidden text has no other path to reach the user. The agent waits for a reply it will never get, and the thread hangs indefinitely.
The root cause is in
discord.rsedit_handle: it callsformat::truncate_chars(&content, 1900)which always keeps the first 1900 chars.compose_display()renders tool lines before text, so tool history eats the budget and agent text is silently dropped.Affects any ACP backend with interactive tool flows (claude-agent-acp, kiro-cli, etc.). Introduced after #135 + #138 merged into main.
Related: #135 (message fragmentation fix), #138 (tool call dedup), #58 (cross-session deadlock — different issue)
Steps to Reproduce
@bot clone this repo, check each of the 10 config files, and ask me before making any changescommandline…— the agent's question is not visibleExpected Behavior
The user should always be able to see the agent's latest text output during streaming, even when there are many completed tool call entries above it. Suggested fix: collapse completed tool entries during streaming (e.g. "✅ 8 tool(s) completed") to preserve budget for agent text, then expand to full detail on final edit.