diff --git a/CHANGELOG.md b/CHANGELOG.md index 4295707673a..43b8d683d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai - Channels/streaming: add unified `streaming.mode: "progress"` drafts with auto single-word status labels and shared progress configuration across Discord, Telegram, Matrix, Slack, and Microsoft Teams. - Slack/streaming: add `streaming.progress.render: "rich"` for Block Kit progress drafts backed by structured progress line data. +- Slack/streaming: keep the newest rich progress lines when Block Kit limits trim long progress drafts. Thanks @vincentkoc. - Channels/streaming: cap progress-draft tool lines by default so edited progress boxes avoid jumpy reflow from long wrapped lines. - Agents/verbose: use compact explain-mode tool summaries for `/verbose` and progress drafts by default, with `agents.defaults.toolProgressDetail: "raw"` and per-agent overrides for debugging raw command/detail output. - Agents/commands: add `/steer ` for queue-independent steering of the active current-session run without starting a new turn when the session is idle. (#76934) diff --git a/extensions/slack/src/progress-blocks.test.ts b/extensions/slack/src/progress-blocks.test.ts index 854401a8c87..5aa6875293e 100644 --- a/extensions/slack/src/progress-blocks.test.ts +++ b/extensions/slack/src/progress-blocks.test.ts @@ -64,7 +64,7 @@ describe("buildSlackProgressDraftBlocks", () => { }); }); - it("caps rich progress blocks to Slack's maximum while leaving caller text fallback independent", () => { + it("keeps newest rich progress lines when capping Slack blocks", () => { const blocksWithLabel = buildSlackProgressDraftBlocks({ label: "Shelling...", lines: Array.from({ length: 60 }, (_value, index) => progressLine(index)), @@ -74,18 +74,26 @@ describe("buildSlackProgressDraftBlocks", () => { type: "section", text: { text: "*Shelling...*" }, }); + expect(blocksWithLabel?.[1]).toMatchObject({ + type: "section", + fields: [{ text: "🛠️ *Exec 11*" }, { text: "run 11" }], + }); expect(blocksWithLabel?.at(-1)).toMatchObject({ type: "section", - fields: [{ text: "🛠️ *Exec 48*" }, { text: "run 48" }], + fields: [{ text: "🛠️ *Exec 59*" }, { text: "run 59" }], }); const blocksWithoutLabel = buildSlackProgressDraftBlocks({ lines: Array.from({ length: 60 }, (_value, index) => progressLine(index)), }); expect(blocksWithoutLabel).toHaveLength(50); + expect(blocksWithoutLabel?.[0]).toMatchObject({ + type: "section", + fields: [{ text: "🛠️ *Exec 10*" }, { text: "run 10" }], + }); expect(blocksWithoutLabel?.at(-1)).toMatchObject({ type: "section", - fields: [{ text: "🛠️ *Exec 49*" }, { text: "run 49" }], + fields: [{ text: "🛠️ *Exec 59*" }, { text: "run 59" }], }); }); }); diff --git a/extensions/slack/src/progress-blocks.ts b/extensions/slack/src/progress-blocks.ts index b1339a6848e..8b1ba33a9c1 100644 --- a/extensions/slack/src/progress-blocks.ts +++ b/extensions/slack/src/progress-blocks.ts @@ -55,7 +55,7 @@ export function buildSlackProgressDraftBlocks(params: { }); } const availableLineBlocks = Math.max(0, SLACK_MAX_BLOCKS - blocks.length); - for (const line of params.lines.slice(0, availableLineBlocks)) { + for (const line of params.lines.slice(-availableLineBlocks)) { blocks.push({ type: "section", fields: [field(lineTitle(line)), field(lineDetail(line))],