Skip to content

[codex] Structure pull request link failures#3445

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/web-client-error-audit-2
Jun 20, 2026
Merged

[codex] Structure pull request link failures#3445
juliusmarminge merged 1 commit into
mainfrom
codex/web-client-error-audit-2

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • translate pull-request link bridge rejections into a structured error at the external-open boundary
  • retain the original cause while correlating diagnostics with only the safe target origin
  • use the shared operation from both pull-request link entry points and log the structured failure before showing the existing toast

Root cause

The two pull-request link entry points called the bridge independently and reduced rejected operations to toast text. That discarded the cause chain and provided no safe URL correlation for diagnostics.

Validation

  • vp test apps/web/src/lib/openPullRequestLink.test.ts (2 tests)
  • vp check
  • vp run typecheck

Note

Low Risk
Small UX/diagnostics refactor around external link opening; no auth or data-path changes, with tests for error redaction.

Overview
Pull request links no longer call shell.openExternal directly at each UI entry point. A shared openPullRequestLink helper wraps the bridge call and turns rejections into a PullRequestLinkOpenError that keeps the original cause while exposing only a safe targetOrigin (no full URL or query secrets) in user-facing messages.

useOpenPrLink and GitActionsControl’s open-existing-PR path now use that helper; failures are console.error’d before the existing error toasts. Unit tests cover successful opens and failure shaping (including URLs with sensitive query params).

Reviewed by Cursor Bugbot for commit d120aa7. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Structure pull request link open failures into PullRequestLinkOpenError

  • Introduces openPullRequestLink.ts with a PullRequestLinkOpenError tagged error class that wraps raw shell failures, exposing only the URL origin (not full URL with query params) in its message.
  • Adds openPullRequestLink(shell, url) utility that throws PullRequestLinkOpenError on failure, used by both GitActionsControl and useOpenPrLink.
  • Failures are now logged to the console via console.error before surfacing a toast, and the toast message reflects the sanitized error message.

Macroscope summarized d120aa7.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 45fe8001-0c69-4cb8-9b7a-ec9ee1a77e17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/web-client-error-audit-2

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR introduces structured error handling for opening PR links, wrapping existing openExternal calls with a custom error class that sanitizes URLs (hiding tokens). The core behavior is unchanged, tests are included, and the change improves security by preventing sensitive URL parameters from appearing in error messages.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge merged commit a9460bb into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/web-client-error-audit-2 branch June 20, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant