Skip to content

Commit ccb94a6

Browse files
committed
fix(slack): keep newest rich progress lines
1 parent e80de46 commit ccb94a6

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

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

1414
- 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.
1515
- Slack/streaming: add `streaming.progress.render: "rich"` for Block Kit progress drafts backed by structured progress line data.
16+
- Slack/streaming: keep the newest rich progress lines when Block Kit limits trim long progress drafts. Thanks @vincentkoc.
1617
- Channels/streaming: cap progress-draft tool lines by default so edited progress boxes avoid jumpy reflow from long wrapped lines.
1718
- 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.
1819
- Agents/commands: add `/steer <message>` for queue-independent steering of the active current-session run without starting a new turn when the session is idle. (#76934)

extensions/slack/src/progress-blocks.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe("buildSlackProgressDraftBlocks", () => {
6464
});
6565
});
6666

67-
it("caps rich progress blocks to Slack's maximum while leaving caller text fallback independent", () => {
67+
it("keeps newest rich progress lines when capping Slack blocks", () => {
6868
const blocksWithLabel = buildSlackProgressDraftBlocks({
6969
label: "Shelling...",
7070
lines: Array.from({ length: 60 }, (_value, index) => progressLine(index)),
@@ -74,18 +74,26 @@ describe("buildSlackProgressDraftBlocks", () => {
7474
type: "section",
7575
text: { text: "*Shelling...*" },
7676
});
77+
expect(blocksWithLabel?.[1]).toMatchObject({
78+
type: "section",
79+
fields: [{ text: "🛠️ *Exec 11*" }, { text: "run 11" }],
80+
});
7781
expect(blocksWithLabel?.at(-1)).toMatchObject({
7882
type: "section",
79-
fields: [{ text: "🛠️ *Exec 48*" }, { text: "run 48" }],
83+
fields: [{ text: "🛠️ *Exec 59*" }, { text: "run 59" }],
8084
});
8185

8286
const blocksWithoutLabel = buildSlackProgressDraftBlocks({
8387
lines: Array.from({ length: 60 }, (_value, index) => progressLine(index)),
8488
});
8589
expect(blocksWithoutLabel).toHaveLength(50);
90+
expect(blocksWithoutLabel?.[0]).toMatchObject({
91+
type: "section",
92+
fields: [{ text: "🛠️ *Exec 10*" }, { text: "run 10" }],
93+
});
8694
expect(blocksWithoutLabel?.at(-1)).toMatchObject({
8795
type: "section",
88-
fields: [{ text: "🛠️ *Exec 49*" }, { text: "run 49" }],
96+
fields: [{ text: "🛠️ *Exec 59*" }, { text: "run 59" }],
8997
});
9098
});
9199
});

extensions/slack/src/progress-blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function buildSlackProgressDraftBlocks(params: {
5555
});
5656
}
5757
const availableLineBlocks = Math.max(0, SLACK_MAX_BLOCKS - blocks.length);
58-
for (const line of params.lines.slice(0, availableLineBlocks)) {
58+
for (const line of params.lines.slice(-availableLineBlocks)) {
5959
blocks.push({
6060
type: "section",
6161
fields: [field(lineTitle(line)), field(lineDetail(line))],

0 commit comments

Comments
 (0)