惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
U
Unit 42
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
D
DataBreaches.Net
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
Martin Fowler
Martin Fowler
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
罗磊的独立博客
B
Blog RSS Feed
J
Java Code Geeks
The GitHub Blog
The GitHub Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: cap slack approval update text · openclaw/openclaw@3...
steipete · 2026-04-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -74,6 +74,7 @@ Docs: https://docs.openclaw.ai

7474

- Slack/interactive replies: drop overlong Block Kit button URLs while preserving valid callback values, so malformed link buttons no longer make Slack reject the whole interactive reply. Thanks @slackapi.

7575

- Slack/commands: truncate native command argument-menu confirmation text to Slack's dialog limit, so long plugin arg names no longer make fallback buttons render invalid Block Kit payloads. Thanks @slackapi.

7676

- Slack/exec approvals: cap native approval metadata context to Slack's element and text limits, so large approval details no longer make Slack reject the approval card. Thanks @slackapi.

77+

- Slack/exec approvals: cap native approval update fallback text to Slack's message limit while preserving the rendered approval blocks, so long commands no longer make resolved or expired approval cards stay stale after `chat.update` rejects `msg_too_long`. Thanks @slackapi.

7778

- Slack/commands: cap native command argument-menu fallback rows to Slack's message block limit, so large plugin choice lists no longer make Slack reject the generated menu. Thanks @slackapi.

7879

- Slack/commands: drop fallback command argument buttons whose encoded values exceed Slack's button-value limit, so one oversized plugin choice no longer makes Slack reject the whole menu. Thanks @slackapi.

7980

- Slack/messages: merge message-tool presentation and interactive blocks on Slack sends, so buttons and selects are no longer dropped when a structured message body is also present. Thanks @slackapi.

Original file line numberDiff line numberDiff line change

@@ -1,10 +1,11 @@

1-

import { describe, expect, it } from "vitest";

1+

import { describe, expect, it, vi } from "vitest";

22

import { slackApprovalNativeRuntime } from "./approval-handler.runtime.js";

33
44

type SlackPayload = {

55

text: string;

66

blocks?: unknown;

77

};

8+

const SLACK_TEXT_LIMIT = 8000;

89
910

function findSlackActionsBlock(blocks: Array<{ type?: string; elements?: unknown[] }>) {

1011

return blocks.find((block) => block.type === "actions");

@@ -114,6 +115,53 @@ describe("slackApprovalNativeRuntime", () => {

114115

).toBe(false);

115116

});

116117
118+

it("caps resolved update fallback text while preserving approval blocks", async () => {

119+

const blocks = [

120+

{

121+

type: "section",

122+

text: {

123+

type: "mrkdwn",

124+

text: "*Command*\n```short preview```",

125+

},

126+

},

127+

];

128+

const chatUpdate = vi.fn(async (_payload: { text: string; blocks: typeof blocks }) => ({}));

129+
130+

await slackApprovalNativeRuntime.transport.updateEntry?.({

131+

cfg: {} as never,

132+

accountId: "default",

133+

context: {

134+

app: {

135+

client: {

136+

chat: {

137+

update: chatUpdate,

138+

},

139+

},

140+

},

141+

config: {},

142+

} as never,

143+

entry: {

144+

channelId: "C123",

145+

messageTs: "1712345678.999999",

146+

},

147+

payload: {

148+

text: `*Exec approval: Allowed once*\n\n*Command*\n${"a".repeat(9000)}`,

149+

blocks,

150+

},

151+

phase: "resolved",

152+

});

153+
154+

expect(chatUpdate).toHaveBeenCalledWith(

155+

expect.objectContaining({

156+

channel: "C123",

157+

ts: "1712345678.999999",

158+

text: expect.stringMatching(/$/),

159+

blocks,

160+

}),

161+

);

162+

expect(chatUpdate.mock.calls[0]?.[0].text).toHaveLength(SLACK_TEXT_LIMIT);

163+

});

164+
117165

it("keeps pending metadata context within Slack Block Kit limits", async () => {

118166

const payload = (await slackApprovalNativeRuntime.presentation.buildPendingPayload({

119167

cfg: {} as never,

Original file line numberDiff line numberDiff line change

@@ -17,8 +17,10 @@ import {

1717

shouldHandleSlackExecApprovalRequest,

1818

normalizeSlackApproverId,

1919

} from "./exec-approvals.js";

20+

import { SLACK_TEXT_LIMIT } from "./limits.js";

2021

import { resolveSlackReplyBlocks } from "./reply-blocks.js";

2122

import { sendMessageSlack } from "./send.js";

23+

import { truncateSlackText } from "./truncate.js";

2224
2325

type SlackBlock = Block | KnownBlock;

2426

type SlackPendingApproval = {

@@ -229,7 +231,7 @@ async function updateMessage(params: {

229231

await params.app.client.chat.update({

230232

channel: params.channelId,

231233

ts: params.messageTs,

232-

text: params.text,

234+

text: truncateSlackText(params.text, SLACK_TEXT_LIMIT),

233235

blocks: params.blocks,

234236

});

235237

} catch (err) {