mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:00:42 +00:00
fix(slack): keep newest rich progress lines
This commit is contained in:
@@ -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 <message>` for queue-independent steering of the active current-session run without starting a new turn when the session is idle. (#76934)
|
||||
|
||||
@@ -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" }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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))],
|
||||
|
||||
Reference in New Issue
Block a user