Skip to content

Commit 7754722

Browse files
committed
fix: improve progress draft truncation
1 parent 76da347 commit 7754722

21 files changed

Lines changed: 136 additions & 38 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai
1313
### Fixes
1414

1515
- CLI/sessions: accept `openclaw sessions list` as an alias for `openclaw sessions`, matching other list-style commands. Fixes #81139. (#81163) Thanks @YB0y.
16+
- Channels/stream previews: widen compact progress draft lines and cut prose at word boundaries while preserving command/path suffixes, with `streaming.progress.maxLineChars` for channel-specific tuning.
1617
- CLI/plugins: have `openclaw plugins doctor` warn when a configured runtime needs a missing owner plugin, sharing the same install mapping as `openclaw doctor --fix`. Fixes #81326. (#81674) Thanks @Zavianx.
1718
- Agents/Codex: route OpenAI runs that resolve to `openai-codex` through the Codex provider and bootstrap OpenClaw's stored OAuth profile into the Codex harness when the harness owns transport, so `openai/*` model refs no longer fail with `No API key found for openai-codex` despite an existing Codex OAuth profile. (#82864) Thanks @ragesaq.
1819
- Agents/ACP: distinguish prompt-submitted and runtime-active child stalls from true interactive waits, including redacted proxy-env diagnostics for Codex ACP no-output runs. Fixes #44810.

docs/channels/discord.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ Default slash command settings:
692692
progress: {
693693
label: "auto",
694694
maxLines: 8,
695+
maxLineChars: 120,
695696
toolProgress: true,
696697
},
697698
},
@@ -705,6 +706,7 @@ Default slash command settings:
705706
- Media, error, and explicit-reply finals cancel pending preview edits.
706707
- `streaming.preview.toolProgress` (default `true`) controls whether tool/progress updates reuse the preview message.
707708
- Tool/progress rows render as compact emoji + title + detail when available, for example `🛠️ Bash: run tests` or `🔎 Web Search: for "query"`.
709+
- `streaming.progress.maxLineChars` controls the per-line progress preview budget. Prose is shortened on word boundaries; command and path details keep useful suffixes.
708710
- `streaming.preview.commandText` / `streaming.progress.commandText` controls command/exec detail in compact progress lines: `raw` (default) or `status` (tool label only).
709711

710712
Hide raw command/exec text while keeping compact progress lines:

docs/concepts/progress-drafts.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,26 @@ Limit how many lines stay visible:
222222
Progress lines are compacted automatically to reduce chat-bubble reflow while the draft is edited.
223223

224224
OpenClaw truncates long progress lines by default so repeated draft edits do not
225-
wrap differently on every update. The prefix stays readable, and long details
226-
such as paths or raw commands are shortened with an ellipsis.
225+
wrap differently on every update. The default per-line budget is 120 characters.
226+
Prose cuts at a word boundary, while long details such as paths or raw commands
227+
are shortened with a middle ellipsis so the suffix remains visible.
228+
229+
Tune the per-line budget:
230+
231+
```json5
232+
{
233+
channels: {
234+
discord: {
235+
streaming: {
236+
mode: "progress",
237+
progress: {
238+
maxLineChars: 160,
239+
},
240+
},
241+
},
242+
},
243+
}
244+
```
227245

228246
Slack can render progress lines as structured Block Kit fields instead of a
229247
single text body:

docs/gateway/config-channels.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ WhatsApp runs through the gateway's web channel (Baileys Web). It starts automat
278278
progress: {
279279
label: "auto",
280280
maxLines: 8,
281+
maxLineChars: 120,
281282
toolProgress: true,
282283
},
283284
},

extensions/discord/src/config-ui-hints.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export const discordChannelConfigUiHints = {
8181
label: "Discord Progress Max Lines",
8282
help: "Maximum number of compact progress lines to keep below the draft label (default: 8).",
8383
},
84+
"streaming.progress.maxLineChars": {
85+
label: "Discord Progress Max Line Chars",
86+
help: "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes.",
87+
},
8488
"streaming.progress.toolProgress": {
8589
label: "Discord Progress Tool Lines",
8690
help: "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery.",

extensions/discord/src/monitor/message-handler.process.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,7 @@ describe("processDiscordMessage draft streaming", () => {
23162316
await runProcessDiscordMessage(ctx);
23172317

23182318
expect(draftStream.update).toHaveBeenCalledWith(
2319-
"Clawing...\n🩹 1 modified; extensions/discord/src/monitor/message-handler.draft-prev…",
2319+
"Clawing...\n🩹 1 modified; extensions/discord/src/monitor/message-handler.draft-preview.ts",
23202320
);
23212321
const updates = draftStream.update.mock.calls.map((call) => call[0]);
23222322
expect(updates.join("\n")).not.toContain("Apply Patch");

extensions/matrix/src/config-schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const matrixStreamingSchema = z
8585
label: z.union([z.string(), z.literal(false)]).optional(),
8686
labels: z.array(z.string()).optional(),
8787
maxLines: z.number().int().positive().optional(),
88+
maxLineChars: z.number().int().positive().optional(),
8889
toolProgress: z.boolean().optional(),
8990
})
9091
.strict()

extensions/matrix/src/config-ui-hints.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export const matrixChannelConfigUiHints = {
4141
label: "Matrix Progress Max Lines",
4242
help: "Maximum number of compact progress lines to keep below the draft label (default: 8).",
4343
},
44+
"streaming.progress.maxLineChars": {
45+
label: "Matrix Progress Max Line Chars",
46+
help: "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes.",
47+
},
4448
"streaming.progress.toolProgress": {
4549
label: "Matrix Progress Tool Lines",
4650
help: "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery.",

extensions/mattermost/src/config-schema-core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const MattermostStreamingProgressSchema = z
8484
label: z.union([z.string(), z.literal(false)]).optional(),
8585
labels: z.array(z.string()).optional(),
8686
maxLines: z.number().int().positive().optional(),
87+
maxLineChars: z.number().int().positive().optional(),
8788
toolProgress: z.boolean().optional(),
8889
})
8990
.strict();

extensions/mattermost/src/config-ui-hints.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export const mattermostChannelConfigUiHints = {
2929
label: "Mattermost Progress Max Lines",
3030
help: "Maximum number of compact progress lines to keep below the draft label (default: 8).",
3131
},
32+
"streaming.progress.maxLineChars": {
33+
label: "Mattermost Progress Max Line Chars",
34+
help: "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes.",
35+
},
3236
"streaming.progress.toolProgress": {
3337
label: "Mattermost Progress Tool Lines",
3438
help: "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery.",

0 commit comments

Comments
 (0)