From 0534c24292754b237b7e212fd63a1df99824e5e7 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 7 Apr 2026 02:53:34 +0000
Subject: [PATCH] fix: resolve TypeScript errors in js workflow check

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d97ec115-fca7-468f-8455-80e276a712cf

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
---
 actions/setup/js/assign_to_agent.cjs      | 4 ++--
 actions/setup/js/create_agent_session.cjs | 2 +-
 actions/setup/js/create_pull_request.cjs  | 4 ++--
 actions/setup/js/pr_helpers.cjs           | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/actions/setup/js/assign_to_agent.cjs b/actions/setup/js/assign_to_agent.cjs
index 327bec5d6ac..f9873be5f5c 100644
--- a/actions/setup/js/assign_to_agent.cjs
+++ b/actions/setup/js/assign_to_agent.cjs
@@ -197,7 +197,7 @@ async function main(config = {}) {
       const normalized = normalizeTemporaryId(String(message.issue_number));
       if (!temporaryIdMap.has(normalized)) {
         core.info(`Deferring assign_to_agent — temporary ID ${message.issue_number} not yet resolved`);
-        return { deferred: true };
+        return { success: false, deferred: true };
       }
     }
 
@@ -242,7 +242,7 @@ async function main(config = {}) {
         const defaultPullRequestRepo = pullRequestRepoConfig || defaultTargetRepo;
         const pullRequestRepoValidation = validateRepo(itemPullRequestRepo, defaultPullRequestRepo, allowedPullRequestRepos);
         if (!pullRequestRepoValidation.valid) {
-          const error = pullRequestRepoValidation.error;
+          const error = pullRequestRepoValidation.error ?? "Repository validation failed";
           core.error(`E004: ${error}`);
           _allResults.push({ issue_number: message.issue_number || null, pull_number: message.pull_number || null, agent: agentName, owner: effectiveOwner, repo: effectiveRepo, success: false, error });
           return { success: false, error };
diff --git a/actions/setup/js/create_agent_session.cjs b/actions/setup/js/create_agent_session.cjs
index d161d23b6d7..ae3542e7e1a 100644
--- a/actions/setup/js/create_agent_session.cjs
+++ b/actions/setup/js/create_agent_session.cjs
@@ -44,7 +44,7 @@ async function main(config = {}) {
   /**
    * Process a single create_agent_session message.
    * @param {Object} message - The agent output message
-   * @returns {Promise<{success: boolean, number?: string, url?: string, error?: string}>}
+   * @returns {Promise<{success: boolean, number?: string, url?: string, error?: string, skipped?: boolean}>}
    */
   return async function handleMessage(message) {
     const taskDescription = message.body;
diff --git a/actions/setup/js/create_pull_request.cjs b/actions/setup/js/create_pull_request.cjs
index 9f5ee8197af..ca327229dc3 100644
--- a/actions/setup/js/create_pull_request.cjs
+++ b/actions/setup/js/create_pull_request.cjs
@@ -112,13 +112,13 @@ function sanitizeFallbackAssignees(assignees) {
  * Creates a fallback GitHub issue, retrying without assignees if the API rejects them.
  * This ensures fallback issue creation remains reliable even if an assignee username
  * is invalid or the repository does not have that collaborator.
- * @param {import('@octokit/rest').Octokit} githubClient - Authenticated GitHub client
+ * @param {object} githubClient - Authenticated GitHub client
  * @param {{owner: string, repo: string}} repoParts - Repository owner and name
  * @param {string} title - Issue title
  * @param {string} body - Issue body
  * @param {string[]} labels - Issue labels
  * @param {string[] | null} assignees - Sanitized assignees (null = omit field)
- * @returns {Promise<import('@octokit/rest').Octokit['rest']['issues']['create'] extends (...args: any[]) => Promise<infer R> ? R : never>}
+ * @returns {Promise<any>}
  */
 async function createFallbackIssue(githubClient, repoParts, title, body, labels, assignees) {
   const payload = {
diff --git a/actions/setup/js/pr_helpers.cjs b/actions/setup/js/pr_helpers.cjs
index 3b48792d76c..53a772352f0 100644
--- a/actions/setup/js/pr_helpers.cjs
+++ b/actions/setup/js/pr_helpers.cjs
@@ -77,7 +77,7 @@ function getPullRequestNumber(messageItem, context) {
  * @param {import("@actions/github-script").AsyncFunctionArguments["github"]} github
  * @param {string} owner
  * @param {string} repo
- * @param {string|undefined} configuredBaseBranch - explicitly configured base branch (may be undefined)
+ * @param {string|null|undefined} configuredBaseBranch - explicitly configured base branch (may be null or undefined)
  * @returns {Promise<{repoId: string, effectiveBaseBranch: string|null, resolvedDefaultBranch: string|null}>}
  */
 async function resolvePullRequestRepo(github, owner, repo, configuredBaseBranch) {
