Skip to content

Commit d91f58e

Browse files
YashSaliyaaltaywtf
andauthored
fix(message-tool): rename type schema property to avoid JSON Schema keyword collision (#78920)
Merged via squash. Prepared head SHA: 669084a Co-authored-by: YashSaliya <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
1 parent f74436d commit d91f58e

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Docs: https://docs.openclaw.ai
2121
- 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.
2222
- 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.
2323
- 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.
2425

2526
## 2026.5.14
2627

extensions/discord/src/actions/runtime.shared.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export function readDiscordChannelCreateParams(
4646
return {
4747
guildId: readStringParam(params, "guildId", { required: true }),
4848
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,
5053
parentId: parentId ?? undefined,
5154
topic: readStringParam(params, "topic") ?? undefined,
5255
position: readNumberParam(params, "position", { integer: true }) ?? undefined,

extensions/discord/src/actions/runtime.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,27 @@ describe("handleDiscordGuildAction - channel management", () => {
910910
});
911911
});
912912

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+
913934
it("respects channel gating for channelCreate", async () => {
914935
await expect(
915936
handleGuildAction("channelCreate", { guildId: "G1", name: "test" }, channelsDisabled),

src/agents/tools/message-tool.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,12 @@ function buildPresenceSchema() {
467467
function buildChannelManagementSchema() {
468468
return {
469469
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+
),
471476
parentId: Type.Optional(Type.String()),
472477
topic: Type.Optional(Type.String()),
473478
position: Type.Optional(Type.Number()),

0 commit comments

Comments
 (0)