Skip to content

Desktop: a check run that failed to start shows the checks summary as pending #8962

Closed

Description

@akshatcoder-hash

Where did this happen?

Desktop app (macOS)

Version

2.0.0, commit 8e301a7

What happened?

A check run that GitHub reports as COMPLETED with conclusion STARTUP_FAILURE is mapped to pending, so the pull request checks summary never leaves the in progress state. The workflow never started, so GitHub and the mobile client both show this check run as a failure. The summary should show failure as well.

Steps to reproduce

  1. Open a pull request whose workflow cannot start, for example a workflow file with an error, so GitHub reports that check run as COMPLETED with conclusion STARTUP_FAILURE.
  2. Open the pull request in the workspace review tab and look at the checks summary.

Logs, screenshots, or recordings

Sample payload and the current result:

parseCheckContexts([{ __typename: "CheckRun", name: "build", status: "COMPLETED", conclusion: "STARTUP_FAILURE" }])
=> [ { name: "build", status: "pending", url: null } ]

computeChecksStatus(...) => "pending"

Expected status for that check: failure. Expected aggregate: failure. Current result is pending for both, so the summary spins until the pull request closes.

Activity

  1. github-actions commented on Oct 27, 2026

    @github-actions
    Contributor

    Triage: a check run that failed to start (STARTUP_FAILURE) is mapped to pending

    Summary. GitHub can report a check run as status: COMPLETED with conclusion: STARTUP_FAILURE. This happens when the workflow never started, for example because the workflow file has an error. The host-service PR mapper has no case for that conclusion. It falls through to pending, so the PR checks summary in the desktop review tab stays "in progress" for good. The mobile client shows the same run as failed, so the two clients disagree. Reading the code confirms the report, and the payload in the issue gives exactly the result described.

    Affected code

    • packages/host-service/src/runtime/pull-requests/utils/pull-request-mappers/pull-request-mappers.ts:156-177 (mapCheckRunStatus): for a completed run, only SUCCESS, FAILURE, TIMED_OUT, ACTION_REQUIRED, CANCELLED, SKIPPED and NEUTRAL have a case. Anything else, including STARTUP_FAILURE, hits default: return "pending" at line 175.
    • pull-request-mappers.ts:91-104 (computeChecksStatus): one pending check with no failure or cancelled check gives "pending" for the whole PR. That is why the summary keeps spinning.
    • For comparison, mobile gets this right. apps/mobile/screens/(authenticated)/workspace/[id]/utils/pullRequest/checks.ts:15-32 treats any completed conclusion it does not know as "failed" (default branch). It only treats STALE and null as running.

    Root cause

    The default branch in mapCheckRunStatus treats every unknown conclusion as "still running". But status === "COMPLETED" has already been checked at that point, so the run is finished. It can never move from pending to anything else. GitHub's CheckConclusionState also includes STARTUP_FAILURE and STALE, and neither has a case.

    Related: the legacy desktop gh CLI path has the same gap, and it is worse there

    • apps/desktop/src/lib/trpc/routers/workspaces/utils/github/types.ts:9-20: the conclusion zod enum does not list STARTUP_FAILURE (or STALE).
    • pr-resolution.ts:332-337 and :363-367: GHPRResponseSchema.safeParse therefore fails for the whole PR. On the single-PR path it returns null, and on the list path the PR is skipped without a message. The PR does not show at all, which is worse than a wrong check status.
    • pr-resolution.ts:432-436 and :463-470: even if the schema accepted the value, parseChecks and computeChecksStatus do not list STARTUP_FAILURE either.

    Reproduction

    Steps from the issue: open a PR whose workflow file is invalid, then open the workspace review tab. Or add this unit test beside the mapper:

    import { expect, test } from "bun:test";
    import { computeChecksStatus, parseCheckContexts } from "./pull-request-mappers";
    
    test("STARTUP_FAILURE check run counts as failure", () => {
    	const checks = parseCheckContexts([
    		{ __typename: "CheckRun", name: "build", status: "COMPLETED", conclusion: "STARTUP_FAILURE", detailsUrl: null } as never,
    	]);
    	expect(checks[0]?.status).toBe("failure");
    	expect(computeChecksStatus(checks)).toBe("failure");
    });

    With the current code, both assertions get "pending".

    Suggested fix

    1. In mapCheckRunStatus, add case "STARTUP_FAILURE": to the failure group.
    2. Match mobile's rule for the remaining cases: once status === "COMPLETED", an unknown conclusion should not stay pending. Map only STALE and null to pending and send other unknown values to failure, so the next conclusion GitHub adds does not bring this bug back.
    3. Legacy desktop path: add "STARTUP_FAILURE" and "STALE" to the zod conclusion enum, or relax it to z.string(), so one new conclusion cannot drop the whole PR. Then add STARTUP_FAILURE to the failure branches in parseChecks and computeChecksStatus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions