Skip to content

handle_create_pr_error: unhandled exceptions on API calls crash conclusion job #19605

Closed

Description

@samuelkahessay

Context

Observed while running gh-aw v0.52.1 in production in samuelkahessay/prd-to-prod — a parallel agentic pipeline with concurrent agent work. Still present on current main at 6502173c8 (v0.53.1-2-g6502173c8).

Location

actions/setup/js/handle_create_pr_error.cjs — lines 59–87

Problem

The main() function has no try/catch around any of its three API calls:

  • Line 59: github.rest.search.issuesAndPullRequests()
  • Line 70: github.rest.issues.createComment()
  • Line 79: github.rest.issues.create()
// Line 59 — no try/catch
const searchResult = await github.rest.search.issuesAndPullRequests({
  q: searchQuery,
  per_page: 1,
});

If any of these calls fail (rate limit, network error, permissions), the unhandled exception crashes the conclusion job.

This function is called specifically because PR creation already failed — it is the fallback-of-fallback path. A crash here means:

  • The diagnostic issue is not created
  • The conclusion job fails with an unrelated API error
  • The operator has no visibility into the original PR creation failure

Compare to handle_agent_failure.cjs, whose analogous failure-reporting path wraps the search/create-or-comment sequence in a guarded block and degrades with core.warning() instead of throwing (lines 607–880).

Proposed fix

Wrap the reporting sequence in a top-level try/catch. Log the error via core.warning() rather than letting it crash the conclusion job. The function should degrade gracefully — a failure to report the PR creation error should not mask the original error.

Environment

  • Observed in production: v0.52.1
  • Still present on: main at 6502173c8 (v0.53.1-2-g6502173c8)
  • Pipeline: Parallel agentic workflow (decompose → dispatch → implement → review → merge)
  • Repo: samuelkahessay/prd-to-prod

Activity

  1. locked and limited conversation to collaborators on Mar 4, 2026
  2. unlocked this conversation on Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions