From 00016b41c34293b10bfb7b8a64e5988260e5a901 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 00:09:25 +0000 Subject: [PATCH 1/3] Initial plan From 595a5185c5ee41a654c4a3c9f762643038f7f08e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 00:17:01 +0000 Subject: [PATCH 2/3] fix: strip surrounding quotes from item_number in resolveIssueNumber Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ed40b4de-6a89-46c1-adbf-c399b9674524 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/temporary_id.cjs | 4 +++- actions/setup/js/temporary_id.test.cjs | 27 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/actions/setup/js/temporary_id.cjs b/actions/setup/js/temporary_id.cjs index cb21069ad54..b00b18ca7a2 100644 --- a/actions/setup/js/temporary_id.cjs +++ b/actions/setup/js/temporary_id.cjs @@ -302,7 +302,9 @@ function resolveIssueNumber(value, temporaryIdMap) { // Strip # prefix if present to allow flexible temporary ID format const valueStr = String(value).trim(); - const valueWithoutHash = valueStr.startsWith("#") ? valueStr.substring(1) : valueStr; + // Strip surrounding quotes (agent sometimes double-quotes string values, e.g. `"aw_foo"`) + const unquoted = /^["'](.+)["']$/.test(valueStr) ? valueStr.slice(1, -1) : valueStr; + const valueWithoutHash = unquoted.startsWith("#") ? unquoted.substring(1) : unquoted; // Check if it's a temporary ID if (isTemporaryId(valueWithoutHash)) { diff --git a/actions/setup/js/temporary_id.test.cjs b/actions/setup/js/temporary_id.test.cjs index 243a49313e2..d6eb6b83379 100644 --- a/actions/setup/js/temporary_id.test.cjs +++ b/actions/setup/js/temporary_id.test.cjs @@ -486,6 +486,33 @@ describe("temporary_id.cjs", () => { expect(result.errorMessage).toContain("Invalid temporary ID format"); expect(result.errorMessage).toContain("#aw_test-id"); }); + + it("should strip surrounding double quotes from temporary ID", async () => { + const { resolveIssueNumber } = await import("./temporary_id.cjs"); + const map = new Map([["aw_blazwasm", { repo: "owner/repo", number: 42 }]]); + const result = resolveIssueNumber('"aw_blazwasm"', map); + expect(result.resolved).toEqual({ repo: "owner/repo", number: 42 }); + expect(result.wasTemporaryId).toBe(true); + expect(result.errorMessage).toBe(null); + }); + + it("should strip surrounding single quotes from temporary ID", async () => { + const { resolveIssueNumber } = await import("./temporary_id.cjs"); + const map = new Map([["aw_foo123", { repo: "owner/repo", number: 7 }]]); + const result = resolveIssueNumber("'aw_foo123'", map); + expect(result.resolved).toEqual({ repo: "owner/repo", number: 7 }); + expect(result.wasTemporaryId).toBe(true); + expect(result.errorMessage).toBe(null); + }); + + it("should strip surrounding double quotes from numeric issue number", async () => { + const { resolveIssueNumber } = await import("./temporary_id.cjs"); + const map = new Map(); + const result = resolveIssueNumber('"789"', map); + expect(result.resolved).toEqual({ repo: "testowner/testrepo", number: 789 }); + expect(result.wasTemporaryId).toBe(false); + expect(result.errorMessage).toBe(null); + }); }); describe("serializeTemporaryIdMap", () => { From cc1847b44057709c01bd9351116be38290526eb9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 00:18:20 +0000 Subject: [PATCH 3/3] fix: use backreference in quote-stripping regex and add mismatched-quote test Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ed40b4de-6a89-46c1-adbf-c399b9674524 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/temporary_id.cjs | 2 +- actions/setup/js/temporary_id.test.cjs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/actions/setup/js/temporary_id.cjs b/actions/setup/js/temporary_id.cjs index b00b18ca7a2..2bea0a36e99 100644 --- a/actions/setup/js/temporary_id.cjs +++ b/actions/setup/js/temporary_id.cjs @@ -303,7 +303,7 @@ function resolveIssueNumber(value, temporaryIdMap) { // Strip # prefix if present to allow flexible temporary ID format const valueStr = String(value).trim(); // Strip surrounding quotes (agent sometimes double-quotes string values, e.g. `"aw_foo"`) - const unquoted = /^["'](.+)["']$/.test(valueStr) ? valueStr.slice(1, -1) : valueStr; + const unquoted = /^(["'])(.+)\1$/.test(valueStr) ? valueStr.slice(1, -1) : valueStr; const valueWithoutHash = unquoted.startsWith("#") ? unquoted.substring(1) : unquoted; // Check if it's a temporary ID diff --git a/actions/setup/js/temporary_id.test.cjs b/actions/setup/js/temporary_id.test.cjs index d6eb6b83379..f3fe2ac5f90 100644 --- a/actions/setup/js/temporary_id.test.cjs +++ b/actions/setup/js/temporary_id.test.cjs @@ -513,6 +513,15 @@ describe("temporary_id.cjs", () => { expect(result.wasTemporaryId).toBe(false); expect(result.errorMessage).toBe(null); }); + + it("should not strip mismatched surrounding quotes from temporary ID", async () => { + const { resolveIssueNumber } = await import("./temporary_id.cjs"); + const map = new Map(); + const result = resolveIssueNumber("\"aw_foo123'", map); + expect(result.resolved).toBe(null); + expect(result.wasTemporaryId).toBe(false); + expect(result.errorMessage).not.toBe(null); + }); }); describe("serializeTemporaryIdMap", () => {