From ad7bbcacb717f672ee0deb4c6b314a4f4bb46084 Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 12:16:29 -0400 Subject: [PATCH] Fix shared schema comparison for codegen Ignore documentation-only schema metadata when comparing shared API and session-event definitions so Go codegen references common wire types instead of emitting duplicate declarations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/test/shared-codegen.test.ts | 2 ++ scripts/codegen/utils.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nodejs/test/shared-codegen.test.ts b/nodejs/test/shared-codegen.test.ts index 88f4d3cc3..95342e733 100644 --- a/nodejs/test/shared-codegen.test.ts +++ b/nodejs/test/shared-codegen.test.ts @@ -36,6 +36,7 @@ describe("shared schema definition codegen utilities", () => { ReasoningSummary: { type: "string", enum: ["concise", "detailed"], + description: "Reasoning summary mode used for model calls.", }, SharedPayload: { type: "object", @@ -74,6 +75,7 @@ describe("shared schema definition codegen utilities", () => { ReasoningSummary: { type: "string", enum: ["concise", "detailed"], + description: "Reasoning summary mode to request for supported model clients.", }, SharedPayload: { type: "object", diff --git a/scripts/codegen/utils.ts b/scripts/codegen/utils.ts index 6f06e8670..6ebe0531e 100644 --- a/scripts/codegen/utils.ts +++ b/scripts/codegen/utils.ts @@ -998,7 +998,9 @@ function normalizeDefinitionForComparison(definition: JSONSchema7Definition): un const result: Record = {}; for (const [key, value] of Object.entries(definition as Record)) { - if (key === "$ref" && typeof value === "string") { + if (key === "description" || key === "markdownDescription") { + continue; + } else if (key === "$ref" && typeof value === "string") { const localRef = parseLocalDefinitionRef(value); result[key] = localRef ? `#/definitions/${localRef}` : value; } else if (Array.isArray(value)) {