fix(message-tool): rename `type` schema property to avoid JSON Schema… · openclaw/openclaw@d91f58e
YashSaliya
·
2026-05-15
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/actions
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,6 +21,7 @@ Docs: https://docs.openclaw.ai
|
21 | 21 | - Slack/plugins: route plugin-owned modal `view_submission` and `view_closed` events through Slack interactive handlers before compacting the agent-visible system event, so plugins can persist full submitted form state while the transcript stays compact. Fixes #82102. Thanks @shannon0430. |
22 | 22 | - Providers/Xiaomi: promote legacy MiMo V2 reasoning-only final answers to visible text, including Xiaomi-compatible proxy routes, so `mimo-v2-pro` and `mimo-v2-omni` replies no longer appear blank when the answer arrives in `reasoning_content`. Fixes #60261. (#60304) Thanks @HiddenPuppy. |
23 | 23 | - Memory search: stop using chokidar write-stability polling for memory and QMD watchers so large Markdown extraPath trees no longer build up regular file descriptors; changed files now settle through the existing debounced sync queue. Fixes #77327 and #78224. (#81802) Thanks @frankekn, @loyur, and @JanPlessow. |
| 24 | +- Message tool: rename the Discord channel-create schema field exposed to models from `type` to `channelType`, avoiding NVIDIA NIM JSON Schema parser failures while still accepting legacy `type` tool calls. (#78920) Thanks @YashSaliya. |
24 | 25 | |
25 | 26 | ## 2026.5.14 |
26 | 27 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,10 @@ export function readDiscordChannelCreateParams(
|
46 | 46 | return { |
47 | 47 | guildId: readStringParam(params, "guildId", { required: true }), |
48 | 48 | name: readStringParam(params, "name", { required: true }), |
49 | | -type: readNumberParam(params, "type", { integer: true }) ?? undefined, |
| 49 | +type: |
| 50 | +readNumberParam(params, "channelType", { integer: true }) ?? |
| 51 | +readNumberParam(params, "type", { integer: true }) ?? |
| 52 | +undefined, |
50 | 53 | parentId: parentId ?? undefined, |
51 | 54 | topic: readStringParam(params, "topic") ?? undefined, |
52 | 55 | position: readNumberParam(params, "position", { integer: true }) ?? undefined, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -910,6 +910,27 @@ describe("handleDiscordGuildAction - channel management", () => {
|
910 | 910 | }); |
911 | 911 | }); |
912 | 912 | |
| 913 | +it("prefers channelType when creating a channel", async () => { |
| 914 | +await handleGuildAction( |
| 915 | +"channelCreate", |
| 916 | +{ |
| 917 | +guildId: "G1", |
| 918 | +name: "forum-thread", |
| 919 | +channelType: 11, |
| 920 | +type: 0, |
| 921 | +}, |
| 922 | +channelsEnabled, |
| 923 | +); |
| 924 | +expect(createChannelDiscord).toHaveBeenCalledWith( |
| 925 | +expect.objectContaining({ |
| 926 | +guildId: "G1", |
| 927 | +name: "forum-thread", |
| 928 | +type: 11, |
| 929 | +}), |
| 930 | +{ cfg: DISCORD_TEST_CFG }, |
| 931 | +); |
| 932 | +}); |
| 933 | + |
913 | 934 | it("respects channel gating for channelCreate", async () => { |
914 | 935 | await expect( |
915 | 936 | handleGuildAction("channelCreate", { guildId: "G1", name: "test" }, channelsDisabled), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -467,7 +467,12 @@ function buildPresenceSchema() {
|
467 | 467 | function buildChannelManagementSchema() { |
468 | 468 | return { |
469 | 469 | name: Type.Optional(Type.String()), |
470 | | -type: Type.Optional(Type.Number()), |
| 470 | +channelType: Type.Optional( |
| 471 | +Type.Number({ |
| 472 | +description: |
| 473 | +"Numeric channel type (e.g. Discord channel type). Renamed from `type` to avoid JSON Schema keyword collisions that break some OpenAI-compatible providers (notably NVIDIA NIM).", |
| 474 | +}), |
| 475 | +), |
471 | 476 | parentId: Type.Optional(Type.String()), |
472 | 477 | topic: Type.Optional(Type.String()), |
473 | 478 | position: Type.Optional(Type.Number()), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。