Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): a refused review shows GitHub's reason #22382

Mergedtiliakoos(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/22382/headmerged by maria-rcks View on GitHub

Problem

When GitHub refuses a pull request review, the web client shows only "The review could not be submitted", so the reviewer cannot tell what to fix (#12549). GitHub's reason already reaches the client: submitReview posts through the REST client, whose errors carry GitHub's message and errors[] since #19224, and that text arrives as PullRequestOperationError.detail. The toast in PullRequestReviewForm.tsx never reads it. The mobile review sheet already shows the failure's message.

Change

The failure toast gets a description from readableFailure(squashAtomCommandFailure(result), hint), the same call the label and reviewer pickers use for their refusals. It drops the "Pull request operation … failed:" prefix, falls back to the hint when the host gives nothing readable, and caps the text at 320 characters. The title, the kept draft and the success path are unchanged. Web only: the server already sends the reason.

Scope and approval

Refs #12549. This is item 3 of Julius's triage: "Surface GitHub’s 422. If something still slips through, … show that string in the toast. PullRequestOperationError already has a detail field; the UI just does not use it here." Item 1, refusing anchors outside the hunks, landed in #12583.

It picks up agomesp's #13293, which was closed for missing before/after screenshots of this toast and the kept draft. Its server half, carrying the gh api error body into detail, is no longer needed after #19224.

Verification

  • vp lint and vp fmt --check on the file and the @t3tools/web typecheck are clean. pullRequestDetail.logic.test.ts, which covers readableFailure, passes (140 tests). No new test: the change passes an existing, tested helper's output to the toast.

  • Real app: the dev desktop app from this branch on an empty .t3, signed in through gh, against a throwaway pull request in a private scratch repository. I drafted a line comment on src/greeting.ts:10, pushed a commit that took src/greeting.ts out of the pull request, and submitted the review with that comment still pending. GitHub refused it each time, and the summary and the pending comment ("Review (1)") stayed.

    Before (main's PullRequestReviewForm.tsx, same session and draft):

    main: the toast reads only 'The review could not be submitted'; the summary and one pending comment stay

    This branch, where the toast adds GitHub's reason, "GitHub returned an error: Unprocessable Entity; Path could not be resolved":

    this branch: the toast adds 'GitHub returned an error: Unprocessable Entity; Path could not be resolved'; the summary and one pending comment stay
  • After discarding the stale comment, the same review went through: "Review submitted", the summary cleared, and GitHub lists the review.

  • Not checked: GitHub's Line could not be resolved from the issue, since #12583 now refuses that anchor before a comment exists; other hosts (GitLab, Bitbucket, Azure DevOps), whose providers fill detail in their own words; mobile, unchanged.

Claude Opus 5.5 via T3 Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 3582b8c

      Macroscope's review found this PR approvable — This is a focused web bug fix that surfaces an existing host refusal reason in the review-submission error toast while preserving the draft and all submission behavior. It changes one failure-message path, uses existing tested helpers, and introduces no schema, default, security, or deployment changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: a6b4ed51-642a-4f72-8817-49ec49bfcd07
      📥 Commits

      Reviewing files that changed from the base of the PR and between 67c0fc0cdaf963b103518862dd7b68a9c758ecf2 and 3582b8c86c0bcc6efac77fa2a6480f8d4b3d2acf.

      📒 Files selected for processing: 1
      • apps/web/src/components/pullRequest/PullRequestReviewForm.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      📝 Walkthrough

      The review form now shows a readable host failure reason when review submission fails. The error toast also states that the draft remains available for retry.

      Changes: Review submission errors

      Layer / File(s)Summary
      Failure details and retry message
      apps/web/src/components/pullRequest/PullRequestReviewForm.tsx
      The form uses failure-normalization helpers and displays a descriptive failure message with the error toast. The message states that the draft is preserved for retry.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~5 minutes

      Change: Bug fix

      Suggested reviewers: maria-rcks

      Merge Risk: ⚪ Minimal · up to 3582b

      The updated toast safely presents provider refusal details and preserves retry guidance.

      Security architecture risk: 🔵 Low · up to 3582b

      Review requests and draft handling remain unchanged. Error text becomes visible to the submitting reviewer, but its display-safety is not fully established for every provider or unexpected failure. No sensitive-data disclosure was demonstrated.

      Retained concerns No architecture-level concerns identified.

      Security review details

      Security Blast Radius

      • inferred — The changed exposure is failure-text presentation in the submitting web client. The diff does not expand request targets, credentials, provider access or submission authority; error detail was already transported to that client.

      Security Findings and Attack Paths

      • inferred — The disclosure candidate is not established. Forgejo response-body text can reach the new description, and unexpected client defects can become displayable failures, but no inspected path demonstrated credentials, sensitive local data or another user's data reaching this sink. Provider-wide display guarantees and complete defect propagation remain partially covered.

      Trust Boundaries and Controls

      • observed — GitHub supplies structured message and error-field explanations rather than forwarding the complete response body, and uses fixed messages for transport and several operational failures. This is strong counterevidence to treating the intended GitHub refusal display as arbitrary local-error disclosure.
      • observed — The formatter's prefix removal, noise fallback and length cap are presentation controls, not secrecy filters. Forgejo's existing handling preserves non-404 HTTP response text, so the newly visible content is not universally restricted to structured refusal fields.

      Hardening Proposals

      • proposed — Consider an explicit display-safe provider error contract, with a generic fallback for unexpected defects and unclassified response bodies, so future consumers do not have to infer whether arbitrary error messages are suitable for display.
      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: showing GitHub's reason when a web review is refused.
      Description checkPassedThe description covers the problem, change, scope and approval, verification results, screenshots, limitations, and the agent used. It is specific to the pull request and meets the template requiremen…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description covers the problem, change, scope and approval, verification results, screenshots, limitations, and the agent used. It is specific to the pull request and meets the template requirements.

      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    4. Note

      Written by gpt-6.1-sol on behalf of Maria

      Verified in a real dev environment

      baseline reproduced on github/main at 5ef56853ef in /home/user/main, installed with vp i. used repository playwright and /usr/bin/google-chrome against the real dev web client. created a project and private scratch repository through the app, then used codex gpt-6.1-sol turns to create and push the review files and remove the commented file.

      on scratch pr maria-rcks/pr22382-verification-20261030#1, drafted a comment on src/greeting.ts:10 and the summary "review refusal verification: keep my draft". after the provider removed that file and pushed, submitting the stale review showed only "The review could not be submitted". the summary and one pending comment remained available. repeated the refusal with the same result.

      main: generic review failure toast with the summary and one pending comment preserved

      checked out exact pr head 3582b8c86c0bcc6efac77fa2a6480f8d4b3d2acf. vp i --frozen-lockfile succeeded after an initial npm metadata timeout. stopped main before starting the pr server. ran the existing pullRequestDetail.logic.test.ts through blacksmith-check: 140 tests passed. the pr had 30 successful ci checks when inspected.

      Not verified

      the changed behavior is unverified. the pr dev server started with isolated /home/user/t3code/.t3 state on server port 13773 and web port 5733. pairing reached /, but the main app remained blank (#root empty). the server logged repeated event-loop stalls exceeding the ten-minute limit. this blocks an after screenshot, interaction recording, draft recovery on the pr head, and successful submission after discarding the stale comment. no mocks, injected failures, or fixture data were used. the cause of the runtime stall is undiagnosed; this is not evidence that the toast change caused it.

      runtime transcript:

      [08:47:32.589] Listening on http://127.0.0.1:13773
      [08:47:32.695] Authentication required. Open T3 Code using the pairing URL.
      [09:47:30.230] event loop stalled for 626065 ms
      [10:09:49.648] event loop stalled for 813433 ms
      [10:19:01.178] V2 orchestration shutdown reconciliation completed

      native desktop/mobile clients, other forge providers, remote/relay/tunnel connections, and the successful review recovery path were not exercised. both task dev servers were stopped. no source changes, commits, or pushes were made to this pr.

    5. maria-rcks merged this45d29b4

    6. maria-rcks closed this

Sign in to join this conversation.