fix: normalize MCP empty tool schemas (#75401) (thanks @SymbolStar)

This commit is contained in:
Ayaan Zaidi
2026-05-02 09:04:08 +05:30
parent 1890d96680
commit 3f766c8c62
3 changed files with 3 additions and 4 deletions

View File

@@ -87,6 +87,7 @@ Docs: https://docs.openclaw.ai
- Plugins/hooks: derive hook `ctx.channelId` from the conversation target instead of the provider name, so Discord and other channel plugins can keep per-channel state isolated. Fixes #59881. Thanks @bradfreels.
- Gateway/config: log config health-state write failures instead of silently hiding config observe-recovery write errors. Thanks @sallyom.
- Diagnostics: reset stuck-session timers on reply, tool, status, block, and ACP progress events, and back off repeated `session.stuck` diagnostics while a session remains unchanged. Supersedes #72010. Thanks @rubencu.
- Agents/OpenAI: normalize parameter-free MCP tool schemas whose `properties` value is null or undefined, so OpenAI no longer rejects MCP tools without parameters. Fixes #75362. (#75401) Thanks @SymbolStar.
## 2026.4.30

View File

@@ -134,10 +134,6 @@ function isTypedSchemaMissingProperties(
if (!("type" in schemaRecord) || conditionalKey !== null) {
return false;
}
// Treat both missing `properties` and `properties` set to a non-object value
// (e.g. undefined/null) as "missing properties" — MCP servers sometimes return
// `{ type: "object" }` or `{ type: "object", properties: undefined }` for
// parameter-free tools.
if (!("properties" in schemaRecord)) {
return true;
}

View File

@@ -207,6 +207,8 @@ describe("normalizeToolParameters", () => {
expect(parameters.type).toBe("object");
expect(parameters.properties).toEqual({});
});
it("preserves existing properties on type:object schemas", () => {
const tool: AnyAgentTool = {
name: "query",
label: "query",