Skip to content

Review submission fails with "Line could not be resolved" when inline comment targets line outside diff hunk #5

@guineveresaenger

Description

@guineveresaenger

Problem

The PR re-review workflow fails to submit reviews when it tries to post an inline comment on a line that exists in the file but is outside the diff context. GitHub's API rejects the create_pull_request_review_comment call with:

Unprocessable Entity: "Line could not be resolved"

This blocks the entire review submission, including the approval. The bot's intended output (visible in the safe-output/outputs.jsonl artifact) shows it wanted to APPROVE the PR with one non-blocking nit, but the nit's line wasn't in a diff hunk.

Examples

Suggested fix

When the GitHub API returns 422 "Line could not be resolved" for an inline comment, fall back to posting it as a PR-level comment (or include it in the review body) instead of failing the entire review submission.

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