mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:10:45 +00:00
fix: normalize MCP empty tool schemas (#75401) (thanks @SymbolStar)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user