From b83bf008453b4083016bc387c286206ea2bd6195 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 23:38:38 +0000 Subject: [PATCH 1/4] Initial plan From a7072a685c9f14c0c20ed503dccb0831b3000e25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 23:51:41 +0000 Subject: [PATCH 2/4] Normalize string labels in safe output type validator Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/safe_output_type_validator.cjs | 9 +++++++++ actions/setup/js/safe_output_type_validator.test.cjs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/actions/setup/js/safe_output_type_validator.cjs b/actions/setup/js/safe_output_type_validator.cjs index d9de7359671..004286613a8 100644 --- a/actions/setup/js/safe_output_type_validator.cjs +++ b/actions/setup/js/safe_output_type_validator.cjs @@ -409,6 +409,15 @@ function validateField(value, fieldName, validation, itemType, lineNum, options) } if (validation.type === "array") { + // Backward compatibility: agents sometimes provide comma-separated labels as a string. + // Normalize this into a string array before strict array validation. + if (fieldName === "labels" && typeof value === "string") { + value = value + .split(",") + .map(item => item.trim()) + .filter(Boolean); + } + if (!Array.isArray(value)) { // For required fields, use "requires a" format for both missing and wrong type if (validation.required) { diff --git a/actions/setup/js/safe_output_type_validator.test.cjs b/actions/setup/js/safe_output_type_validator.test.cjs index 723e49cb428..d628a74c626 100644 --- a/actions/setup/js/safe_output_type_validator.test.cjs +++ b/actions/setup/js/safe_output_type_validator.test.cjs @@ -873,6 +873,15 @@ describe("safe_output_type_validator", () => { expect(Array.isArray(result.normalizedItem.labels)).toBe(true); }); + it("should normalize comma-separated labels string to array", async () => { + const { validateItem } = await import("./safe_output_type_validator.cjs"); + + const result = validateItem({ type: "create_issue", title: "Test", body: "Detailed issue body text.", labels: "reliability, telemetry" }, "create_issue", 1); + + expect(result.isValid).toBe(true); + expect(result.normalizedItem.labels).toEqual(["reliability", "telemetry"]); + }); + it("should reject array with non-string items", async () => { const { validateItem } = await import("./safe_output_type_validator.cjs"); From cc6361c96d8b83bc2af410874a3232b35b34de98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 00:15:41 +0000 Subject: [PATCH 3/4] Document create_issue labels string compatibility in specs and schemas Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/safe_outputs_tools.json | 6 +++--- .../src/content/docs/specs/safe-outputs-specification.md | 6 +++--- pkg/workflow/js/safe_outputs_tools.json | 9 ++++++--- schemas/agent-output.json | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/actions/setup/js/safe_outputs_tools.json b/actions/setup/js/safe_outputs_tools.json index 8746d177dc2..60d9d499eb1 100644 --- a/actions/setup/js/safe_outputs_tools.json +++ b/actions/setup/js/safe_outputs_tools.json @@ -1,7 +1,7 @@ [ { "name": "create_issue", - "description": "WRITE-ONCE: do NOT call this tool with empty or placeholder arguments to probe or discover its schema \u2014 required fields (title, body) are listed in this schema; if you are not ready to open the real issue, call `noop` instead. Creates a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead.", + "description": "WRITE-ONCE: do NOT call this tool with empty or placeholder arguments to probe or discover its schema \u2014 required fields (title, body) are listed in this schema; if you are not ready to open the real issue, call `noop` instead. Creates a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead. Compatibility: labels may be passed as either an array of strings or a comma-separated string; string input is split, trimmed, and normalized to an array.", "inputSchema": { "type": "object", "required": ["title", "body"], @@ -16,11 +16,11 @@ "description": "Detailed issue description in Markdown. Must be the final intended body \u2014 not a placeholder or test value. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate." }, "labels": { - "type": "array", + "type": ["array", "string"], "items": { "type": "string" }, - "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository." + "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository. Accepts either an array of strings or a comma-separated string; string input is split on commas, trimmed, and normalized to an array." }, "fields": { "type": "array", diff --git a/docs/src/content/docs/specs/safe-outputs-specification.md b/docs/src/content/docs/specs/safe-outputs-specification.md index e73a56edf49..2b7a950963b 100644 --- a/docs/src/content/docs/specs/safe-outputs-specification.md +++ b/docs/src/content/docs/specs/safe-outputs-specification.md @@ -875,7 +875,7 @@ Compiler generates tool schemas: "properties": { "title": {"type": "string"}, "body": {"type": "string"}, - "labels": {"type": "array", "items": {"type": "string"}} + "labels": {"type": ["array", "string"], "items": {"type": "string"}} } } } @@ -1993,14 +1993,14 @@ Schema-only updates without matching agent/runtime sync updates **MUST NOT** be ```json { "name": "create_issue", - "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks.", + "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks. Compatibility: labels may be passed as an array or comma-separated string.", "inputSchema": { "type": "object", "required": ["title", "body"], "properties": { "title": {"type": "string", "description": "Issue title"}, "body": {"type": "string", "description": "Issue description in Markdown"}, - "labels": {"type": "array", "items": {"type": "string"}}, + "labels": {"type": ["array", "string"], "items": {"type": "string"}}, "fields": { "type": "array", "items": { diff --git a/pkg/workflow/js/safe_outputs_tools.json b/pkg/workflow/js/safe_outputs_tools.json index 35d34aa915b..ec317e84389 100644 --- a/pkg/workflow/js/safe_outputs_tools.json +++ b/pkg/workflow/js/safe_outputs_tools.json @@ -1,7 +1,7 @@ [ { "name": "create_issue", - "description": "WRITE-ONCE: do NOT call this tool with empty or placeholder arguments to probe or discover its schema \u2014 required fields (title, body) are listed in this schema; if you are not ready to open the real issue, call `noop` instead. Creates a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead.", + "description": "WRITE-ONCE: do NOT call this tool with empty or placeholder arguments to probe or discover its schema \u2014 required fields (title, body) are listed in this schema; if you are not ready to open the real issue, call `noop` instead. Creates a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead. Compatibility: labels may be passed as either an array of strings or a comma-separated string; string input is split, trimmed, and normalized to an array.", "inputSchema": { "type": "object", "required": [ @@ -19,11 +19,14 @@ "description": "Detailed issue description in Markdown. Must be the final intended body \u2014 not a placeholder or test value. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate." }, "labels": { - "type": "array", + "type": [ + "array", + "string" + ], "items": { "type": "string" }, - "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository." + "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository. Accepts either an array of strings or a comma-separated string; string input is split on commas, trimmed, and normalized to an array." }, "fields": { "type": "array", diff --git a/schemas/agent-output.json b/schemas/agent-output.json index aca093c99bd..7e57ab0f008 100644 --- a/schemas/agent-output.json +++ b/schemas/agent-output.json @@ -77,7 +77,7 @@ "minLength": 1 }, "labels": { - "type": "array", + "type": ["array", "string"], "description": "Optional labels to add to the issue", "items": { "type": "string" From 984a91d9d90a3b57d25b7920c99cb48dd9143a14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 01:33:53 +0000 Subject: [PATCH 4/4] Scope labels string normalization to create_issue and update schema description Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/safe_output_type_validator.cjs | 4 ++-- schemas/agent-output.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/setup/js/safe_output_type_validator.cjs b/actions/setup/js/safe_output_type_validator.cjs index 004286613a8..7f47cb7d1f1 100644 --- a/actions/setup/js/safe_output_type_validator.cjs +++ b/actions/setup/js/safe_output_type_validator.cjs @@ -409,9 +409,9 @@ function validateField(value, fieldName, validation, itemType, lineNum, options) } if (validation.type === "array") { - // Backward compatibility: agents sometimes provide comma-separated labels as a string. + // Backward compatibility: create_issue agents sometimes provide comma-separated labels as a string. // Normalize this into a string array before strict array validation. - if (fieldName === "labels" && typeof value === "string") { + if (itemType === "create_issue" && fieldName === "labels" && typeof value === "string") { value = value .split(",") .map(item => item.trim()) diff --git a/schemas/agent-output.json b/schemas/agent-output.json index 7e57ab0f008..38d1049c161 100644 --- a/schemas/agent-output.json +++ b/schemas/agent-output.json @@ -78,7 +78,7 @@ }, "labels": { "type": ["array", "string"], - "description": "Optional labels to add to the issue", + "description": "Optional labels to add to the issue. Accepts an array of strings or a comma-separated string (e.g. \"bug, reliability\") that is normalized into an array.", "items": { "type": "string" }