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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
量子位
S
SegmentFault 最新的问题
博客园 - 聂微东
博客园 - 【当耐特】
J
Java Code Geeks
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
V
V2EX
人人都是产品经理
人人都是产品经理
博客园 - Franky
罗磊的独立博客
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research

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
Preserve disabled Discord presentation buttons (#84312) ·...
clawsweeper · 2026-05-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1212

### Fixes

1313
1414

- Plugins/hooks: apply a default 30-second timeout to `before_compaction` and `after_compaction` hooks so a hung plugin handler no longer blocks compaction completion. (#84153)

15+

- Discord: preserve disabled presentation buttons when adapting and rendering Discord message controls. (#84188) Thanks @100menotu001.

1516

- Plugins/perf: thread explicit plugin discovery results through `loadBundledCapabilityRuntimeRegistry`, `resolveBundledPluginSources`, and `listChannelCatalogEntries` so callers that already hold a discovery result skip redundant filesystem walks. Thanks @SebTardif.

1617

- harden update restart script creation [AI]. (#84088) Thanks @pgondhi987.

1718

- Docker: keep the bundled Codex plugin in official release image keep lists so the default OpenAI agent harness remains available after Docker pruning. Fixes #83613. (#83626) Thanks @YuanHanzhong.

Original file line numberDiff line numberDiff line change

@@ -60,6 +60,7 @@ function createButtonComponent(params: {

6060

class DynamicLinkButton extends LinkButton {

6161

label = params.spec.label;

6262

url = linkUrl;

63+

override disabled = params.spec.disabled ?? false;

6364

}

6465

return { component: new DynamicLinkButton() };

6566

}

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,4 @@

1-

import { MessageFlags } from "discord-api-types/v10";

1+

import { ButtonStyle, MessageFlags } from "discord-api-types/v10";

22

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

33
44

let clearDiscordComponentEntries: typeof import("./components-registry.js").clearDiscordComponentEntries;

@@ -60,6 +60,41 @@ describe("discord components", () => {

6060

expect(result.modals[0]?.allowedUsers).toEqual(["discord:user-1"]);

6161

});

6262
63+

it("serializes disabled link buttons", () => {

64+

const spec = readDiscordComponentSpec({

65+

blocks: [

66+

{

67+

type: "actions",

68+

buttons: [

69+

{

70+

label: "Open docs",

71+

style: "link",

72+

url: "https://example.com/docs",

73+

disabled: true,

74+

},

75+

],

76+

},

77+

],

78+

});

79+

if (!spec) {

80+

throw new Error("Expected component spec to be parsed");

81+

}

82+
83+

const result = buildDiscordComponentMessage({ spec });

84+

const serialized = result.components[0]?.serialize() as

85+

| { components?: Array<{ components?: Array<Record<string, unknown>> }> }

86+

| undefined;

87+

const button = serialized?.components?.[0]?.components?.[0];

88+
89+

expect(button).toMatchObject({

90+

label: "Open docs",

91+

style: ButtonStyle.Link,

92+

url: "https://example.com/docs",

93+

disabled: true,

94+

});

95+

expect(result.entries).toHaveLength(0);

96+

});

97+
6398

it("requires options for modal select fields", () => {

6499

expect(() =>

65100

readDiscordComponentSpec({

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

import { adaptMessagePresentationForChannel } from "openclaw/plugin-sdk/interactive-runtime";

12

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

23

import {

34

createDiscordOutboundHoisted,

@@ -581,6 +582,56 @@ describe("discordOutbound", () => {

581582

});

582583

});

583584
585+

it("preserves disabled presentation buttons through channel adaptation", async () => {

586+

const adaptedPresentation = adaptMessagePresentationForChannel({

587+

capabilities: discordOutbound.presentationCapabilities,

588+

presentation: {

589+

blocks: [

590+

{

591+

type: "buttons",

592+

buttons: [

593+

{ label: "Already handled", value: "done", disabled: true },

594+

{ label: "Open docs", url: "https://example.com/docs", disabled: true },

595+

],

596+

},

597+

],

598+

},

599+

});

600+
601+

const payload = await discordOutbound.renderPresentation?.({

602+

payload: { text: "Action state" },

603+

presentation: adaptedPresentation,

604+

ctx: {

605+

cfg: {},

606+

to: "channel:123456",

607+

},

608+

} as never);

609+
610+

if (!payload) {

611+

throw new Error("expected Discord presentation payload");

612+

}

613+
614+

const discordData = payload.channelData?.discord as

615+

| { presentationComponents?: { blocks?: Array<{ type?: string; buttons?: unknown[] }> } }

616+

| undefined;

617+

const buttons = discordData?.presentationComponents?.blocks?.find(

618+

(block) => block.type === "actions",

619+

)?.buttons;

620+
621+

expect(buttons?.[0]).toEqual({

622+

label: "Already handled",

623+

style: "secondary",

624+

callbackData: "done",

625+

disabled: true,

626+

});

627+

expect(buttons?.[1]).toEqual({

628+

label: "Open docs",

629+

style: "link",

630+

url: "https://example.com/docs",

631+

disabled: true,

632+

});

633+

});

634+
584635

it("keeps replyToId on every internal component media send when replyToMode is all", async () => {

585636

const payload = await discordOutbound.renderPresentation?.({

586637

payload: {

Original file line numberDiff line numberDiff line change

@@ -126,6 +126,7 @@ export const discordOutbound: ChannelOutboundAdapter = {

126126

maxActionsPerRow: 5,

127127

maxRows: 5,

128128

maxLabelLength: 80,

129+

supportsDisabled: true,

129130

},

130131

selects: {

131132

maxOptions: 25,

Original file line numberDiff line numberDiff line change

@@ -150,4 +150,40 @@ describe("buildDiscordInteractiveComponents", () => {

150150

],

151151

});

152152

});

153+
154+

it("preserves disabled presentation buttons for Discord components", () => {

155+

expect(

156+

buildDiscordPresentationComponents({

157+

blocks: [

158+

{

159+

type: "buttons",

160+

buttons: [

161+

{ label: "Already handled", value: "done", disabled: true },

162+

{ label: "Open docs", url: "https://example.com/docs", disabled: true },

163+

],

164+

},

165+

],

166+

}),

167+

).toEqual({

168+

blocks: [

169+

{

170+

type: "actions",

171+

buttons: [

172+

{

173+

label: "Already handled",

174+

style: "secondary",

175+

callbackData: "done",

176+

disabled: true,

177+

},

178+

{

179+

label: "Open docs",

180+

style: "link",

181+

url: "https://example.com/docs",

182+

disabled: true,

183+

},

184+

],

185+

},

186+

],

187+

});

188+

});

153189

});

Original file line numberDiff line numberDiff line change

@@ -60,6 +60,9 @@ export function buildDiscordInteractiveComponents(

6060

if (button.url) {

6161

spec.url = button.url;

6262

}

63+

if (button.disabled === true) {

64+

spec.disabled = true;

65+

}

6366

return spec;

6467

}),

6568

});

@@ -154,6 +157,9 @@ function appendDiscordPresentationButtonBlocks(

154157

if (button.url) {

155158

component.url = button.url;

156159

}

160+

if (button.disabled === true) {

161+

component.disabled = true;

162+

}

157163

return component;

158164

}),

159165

});

Original file line numberDiff line numberDiff line change

@@ -158,6 +158,7 @@ const presentationButtonSchema = Type.Object({

158158

url: Type.Optional(Type.String()),

159159

webApp: Type.Optional(Type.Object({ url: Type.String() })),

160160

web_app: Type.Optional(Type.Object({ url: Type.String() })),

161+

disabled: Type.Optional(Type.Boolean()),

161162

style: Type.Optional(stringEnum(["primary", "secondary", "success", "danger"])),

162163

});

163164