Skip to content

Implement confirm-only PR panel composer with classified error blocking - #9428

Merged
AmethystLiang merged 5 commits into
mainfrom
clarify-pr-panel-guidance
Jul 19, 2026
Merged

AmethystLiang merged 5 commits into
mainfrom
clarify-pr-panel-guidance

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

This PR implements a fail-closed "confirm-only" model for the Create PR composer in the Checks panel. Create now opens only when the existing-review lookup proves no PR exists for the exact context, and hard refresh errors (auth/permission/repo/CLI unavailable) block both automatic and manual retry until cleared.

Core design changes:

  • reviewLookupOutcome field distinguishes accepted no-review (not_found) from failed/unproven lookup (unavailable)
  • Confirmed-only composer gate: Create requires proven eligibility matching current HEAD, branch, upstream, dirty, base, and execution host
  • Hard refresh error blocking: auth/permission/repo_unavailable/gh_unavailable disable manual Retry and hide Create until a fresh eligibility request clears the error
  • Mobile/desktop parity: shared isChecksPanelCreateEligibilityConfirmable floor ensures both platforms fail consistently on the same hard blocks
  • All providers now use throwing review-lookup variants (GitHub, GitLab, Bitbucket, Azure DevOps, Gitea) so transport/auth failures surface as unavailable, never collapse to false "no PR found"

Implementation highlights:

  • New src/main/git/exec-error.ts with pure subprocess error helpers (Retry-After parsing, stderr/stdout extraction)
  • New pr-refresh-error-classification.ts for classified error types matching PR panel empty-state copy
  • Comprehensive empty-state refactor: new review-state model and lookup-authority model replace hasAmbiguousGitHubHostedReview boolean
  • Rate-Limit Retry-After support: secondary 429s disable manual Retry and set accurate auto-retry timing
  • Draft retention across hard-error recovery so user edits persist when composer reopens for the same context
  • 100+ i18n keys added for error states, blockers, recovery actions (en, es, ja, ko, zh)

Test coverage:

  • Mobile/desktop gate parity with unavailable-lookup and hard-error blocking
  • Hard-error observation and clear-time semantics (started-after, completed-after, newer-error)
  • Error classification edge cases (Retry-After detection, bare substrings, detection order)
  • All hosted-review creation tests updated for reviewLookupOutcome field

Backwards compatibility: Runtime RPC result normalized via normalizeRuntimePRForBranchOutcome so older hosts still work (PRInfo|null mapped to found/no-pr).

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1f3399d2-41f7-4dd1-80a4-3ee159e42544

📥 Commits

Reviewing files that changed from the base of the PR and between 9c601b6db0fcaf91423d1bc4ada0a3a5ea8d5b0f and 4435c73.

📒 Files selected for processing (62)
  • mobile/src/source-control/mobile-hosted-review-create-intent-runner.test.ts
  • mobile/src/source-control/mobile-hosted-review-service.ts
  • mobile/src/source-control/mobile-pr-create.test.ts
  • mobile/src/source-control/mobile-pr-create.ts
  • src/main/azure-devops/azure-devops-api-request.ts
  • src/main/azure-devops/client.test.ts
  • src/main/azure-devops/client.ts
  • src/main/bitbucket/client.test.ts
  • src/main/bitbucket/client.ts
  • src/main/git/exec-error.ts
  • src/main/git/runner.ts
  • src/main/gitea/client.test.ts
  • src/main/gitea/client.ts
  • src/main/github/client.test.ts
  • src/main/github/client.ts
  • src/main/github/gh-utils.ts
  • src/main/github/pr-refresh-coordinator.ts
  • src/main/github/pr-refresh-error-classification.test.ts
  • src/main/github/pr-refresh-error-classification.ts
  • src/main/gitlab/client-mr.test.ts
  • src/main/gitlab/client.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/hosted-review.test.ts
  • src/main/source-control/forge-provider.ts
  • src/main/source-control/hosted-review-creation-eligibility.test.ts
  • src/main/source-control/hosted-review-creation.ts
  • src/main/source-control/hosted-review.test.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/CommitArea.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.ts
  • src/renderer/src/components/right-sidebar/checks-panel-blocker-copy.ts
  • src/renderer/src/components/right-sidebar/checks-panel-empty-state.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-empty-state.ts
  • src/renderer/src/components/right-sidebar/checks-panel-git-status-snapshot.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-copy.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-creation.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-creation.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-lookup-authority.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-lookup-authority.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-state-model.ts
  • src/renderer/src/components/right-sidebar/source-control-create-pr-intent-flow.test.ts
  • src/renderer/src/components/right-sidebar/source-control-create-review-blocked-action.test.ts
  • src/renderer/src/components/right-sidebar/source-control-dropdown-items.test.ts
  • src/renderer/src/components/right-sidebar/source-control-hosted-review-creation-eligibility-snapshot.test.ts
  • src/renderer/src/components/right-sidebar/source-control-hosted-review-creation-eligibility-snapshot.ts
  • src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts
  • src/renderer/src/components/right-sidebar/source-control-primary-action.test.ts
  • src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.test.ts
  • src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/github.ts
  • src/shared/hosted-review.ts
  • src/shared/source-control-create-review-intent.ts
  • src/shared/source-control-primary-action-decision.test.ts
  • src/shared/types.ts
💤 Files with no reviewable changes (2)
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.ts
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.test.ts
🚧 Files skipped from review as they are similar to previous changes (56)
  • src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.test.ts
  • src/shared/source-control-primary-action-decision.test.ts
  • src/main/gitea/client.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/right-sidebar/source-control-create-review-blocked-action.test.ts
  • src/renderer/src/components/right-sidebar/source-control-hosted-review-creation-eligibility-snapshot.test.ts
  • src/main/bitbucket/client.test.ts
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/shared/source-control-create-review-intent.ts
  • src/main/source-control/hosted-review.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-git-status-snapshot.ts
  • mobile/src/source-control/mobile-pr-create.ts
  • src/shared/types.ts
  • src/main/git/exec-error.ts
  • src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.ts
  • mobile/src/source-control/mobile-hosted-review-create-intent-runner.test.ts
  • src/shared/hosted-review.ts
  • src/main/github/pr-refresh-error-classification.ts
  • src/main/azure-devops/client.ts
  • src/main/github/pr-refresh-error-classification.test.ts
  • src/main/source-control/hosted-review-creation-eligibility.test.ts
  • src/renderer/src/components/right-sidebar/source-control-dropdown-items.test.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/renderer/src/i18n/locales/es.json
  • src/main/github/client.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-lookup-authority.ts
  • src/renderer/src/components/right-sidebar/checks-panel-empty-state.test.ts
  • src/renderer/src/components/right-sidebar/source-control-primary-action.test.ts
  • src/renderer/src/components/right-sidebar/CommitArea.test.tsx
  • src/main/gitlab/client-mr.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-copy.ts
  • src/main/gitlab/client.ts
  • src/renderer/src/components/right-sidebar/source-control-hosted-review-creation-eligibility-snapshot.ts
  • src/main/github/client.ts
  • src/renderer/src/components/right-sidebar/source-control-create-pr-intent-flow.test.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/components/right-sidebar/checks-panel-blocker-copy.ts
  • src/main/azure-devops/client.test.ts
  • src/main/source-control/forge-provider.ts
  • src/main/git/runner.ts
  • mobile/src/source-control/mobile-hosted-review-service.ts
  • src/main/azure-devops/azure-devops-api-request.ts
  • src/main/gitea/client.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-state-model.ts
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-lookup-authority.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-creation.ts
  • src/renderer/src/i18n/locales/en.json
  • src/main/bitbucket/client.ts
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/components/right-sidebar/checks-panel-empty-state.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-creation.test.ts
  • src/renderer/src/store/slices/github.ts
  • src/main/github/pr-refresh-coordinator.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx

📝 Walkthrough

Walkthrough

The changes distinguish authoritative hosted-review lookup results from unavailable lookups across provider clients, eligibility checks, mobile creation, and shared intent decisions. GitHub PR refreshes now preserve classified failures and retry schedules through runtime, store, and coordinator layers. The Checks panel adds structured review evidence, confirmed-readiness tracking, blocker and refresh states, recovery actions, synchronization, draft retention, and localized copy. Tests cover provider failures, lookup outcomes, readiness rules, mobile gating, refresh behavior, and rendered state selection.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary, but it omits required template sections for Screenshots, Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections with screenshots or no visual change, testing checklist/results, AI review report, security audit, and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: a confirm-only PR panel composer with classified error blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/azure-devops/azure-devops-api-request.ts (1)

90-103: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consume/cancel the response body on failure paths; consider extracting the shared throwOnFailure branching. All three provider request helpers add an identical "throw on failure vs. return null" block without draining the !response.ok body first, which can hold connections open under Node/undici and now gets exercised more often via the new retry-driven eligibility lookup.

  • src/main/azure-devops/azure-devops-api-request.ts#L90-L103: call await response.text().catch(() => {}) (or similar) before return null/throw on the non-OK branch; consider extracting the shared throw/return-null logic into one helper reused by all three providers.
  • src/main/bitbucket/client.ts#L106-L118: same fix — drain the response body before discarding it on the non-OK branch.
  • src/main/gitea/client.ts#L95-L108: same fix — drain the response body before discarding it on the non-OK branch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 18cb5dae-876c-4f95-af30-083b7a9231be

📥 Commits

Reviewing files that changed from the base of the PR and between 8ed8f0d and 162d0c3.

📒 Files selected for processing (58)
  • mobile/src/source-control/mobile-hosted-review-service.ts
  • mobile/src/source-control/mobile-pr-create.test.ts
  • mobile/src/source-control/mobile-pr-create.ts
  • src/main/azure-devops/azure-devops-api-request.ts
  • src/main/azure-devops/client.test.ts
  • src/main/azure-devops/client.ts
  • src/main/bitbucket/client.test.ts
  • src/main/bitbucket/client.ts
  • src/main/git/exec-error.ts
  • src/main/git/runner.ts
  • src/main/gitea/client.test.ts
  • src/main/gitea/client.ts
  • src/main/github/client.test.ts
  • src/main/github/client.ts
  • src/main/github/gh-utils.ts
  • src/main/github/pr-refresh-coordinator.ts
  • src/main/github/pr-refresh-error-classification.test.ts
  • src/main/github/pr-refresh-error-classification.ts
  • src/main/gitlab/client-mr.test.ts
  • src/main/gitlab/client.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/hosted-review.test.ts
  • src/main/source-control/forge-provider.ts
  • src/main/source-control/hosted-review-creation-eligibility.test.ts
  • src/main/source-control/hosted-review-creation.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/CommitArea.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.ts
  • src/renderer/src/components/right-sidebar/checks-panel-blocker-copy.ts
  • src/renderer/src/components/right-sidebar/checks-panel-empty-state.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-empty-state.ts
  • src/renderer/src/components/right-sidebar/checks-panel-git-status-snapshot.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-copy.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-creation.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-creation.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-lookup-authority.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-lookup-authority.ts
  • src/renderer/src/components/right-sidebar/checks-panel-review-state-model.ts
  • src/renderer/src/components/right-sidebar/source-control-create-pr-intent-flow.test.ts
  • src/renderer/src/components/right-sidebar/source-control-create-review-blocked-action.test.ts
  • src/renderer/src/components/right-sidebar/source-control-dropdown-items.test.ts
  • src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts
  • src/renderer/src/components/right-sidebar/source-control-primary-action.test.ts
  • src/renderer/src/components/right-sidebar/source-control-primary-create-pr-intent-action.ts
  • src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.test.ts
  • src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/github.ts
  • src/shared/hosted-review.ts
  • src/shared/source-control-create-review-intent.ts
  • src/shared/source-control-primary-action-decision.test.ts
  • src/shared/types.ts
💤 Files with no reviewable changes (2)
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.ts
  • src/renderer/src/components/right-sidebar/checks-panel-ambiguous-github-review.test.ts
👮 Files not reviewed due to content moderation or server errors (1)
  • src/renderer/src/i18n/locales/ko.json

Replace the ambiguous GitHub hosted-review boolean with a four-state evidence
model (found/positive_unresolved/not_found/unknown) so "No PR found" never
appears without an accepted lookup result. Classify GitHub refresh failures
into types (rate_limited, auth, network, permission, repo_unavailable,
gh_unavailable, unknown) for stable, honest copy. Confirmed-only composer:
preserve drafts across transient failures; hide Create during hard errors and
positive-unresolved evidence. Hard errors clear only when an eligibility
request starts after the error and returns an accepted outcome. Propagate
error types and unified retry schedule through the store. Sync mobile parity
with shouldOpenChecksPanelCreateComposer gating. Localize all new copy.
Add reviewLookupOutcome to hosted-review eligibility and thread it through
the panel so it never claims "No PR found" without accepted evidence. A
failed lookup is unavailable, not a settled no-PR. Fail closed on positive
unresolved evidence, hard refresh errors, and unavailable lookups. Add
structured GitHub refresh-error classification with Retry-After parsing.
Implement confirmed-only composer gating based on fresh, matching-context
eligibility with hard-error clearing. Mobile gates on reviewLookupOutcome
to prevent false Create claims. Surface throwOnFailure variants for each
provider so transport failures cross the RPC boundary instead of collapsing
to null. (Design success criteria 1–4; invariant 8.)
Extracts stderr/stdout parsing and Retry-After detection into a
lightweight module that can be imported without pulling in the heavier
runner machinery. Supports PR-refresh error classification and proper
rate-limit handling for gh commands.
Create / Push & Create now fails closed unless the lookup is not_found.
Update mobile test fixtures so accepted-no-PR cases can still proceed.
forge-provider resolves branch reviews via the OrThrow variant so
lookup failures surface as unavailable instead of "no PR found".
@AmethystLiang
AmethystLiang force-pushed the clarify-pr-panel-guidance branch from 9c601b6 to 4435c73 Compare July 19, 2026 23:18
@AmethystLiang
AmethystLiang merged commit d67ede1 into main Jul 19, 2026
2 checks passed
brennanb2025 added a commit that referenced this pull request Jul 22, 2026
…R loads

The Checks panel briefly showed the terminal "Pull request already exists"
card (Open Review only) on a cold mount, and only rendered the real PR panel
after a manual refresh.

Root cause (regression from #9428): the eligibility probe resolves
`existing_review` from cache faster than the renderable PR hydrates, and the
new exhaustive selector ranks `existing_review` as a terminal safety blocker
above every loading state. So during the fetch window the panel settled on the
terminal card instead of a self-updating loading state. The auto-fetch also
used a lazy SWR priority, so the PR landed slowly unless the user forced a
foreground refresh.

Fix:
- Selector: while a PR fetch is queued/in-flight and we have positive-but-not-
  yet-renderable review evidence (existing_review or positive_unresolved), show
  the self-updating "Checking status" state instead of the terminal card. It
  flips to the review once details land. A concurrent branch blocker still owns
  the copy.
- Fetch: when a review is known to exist but no renderable PR is cached, escalate
  the auto-fetch to a foreground `active`/80 request (matching manual refresh) so
  it resolves promptly.

Reuses existing i18n keys; adds unit coverage for both parts.
brennanb2025 added a commit that referenced this pull request Jul 23, 2026
…R loads (#10008)

* fix(checks): stop the transient "PR already exists" card before the PR loads

The Checks panel briefly showed the terminal "Pull request already exists"
card (Open Review only) on a cold mount, and only rendered the real PR panel
after a manual refresh.

Root cause (regression from #9428): the eligibility probe resolves
`existing_review` from cache faster than the renderable PR hydrates, and the
new exhaustive selector ranks `existing_review` as a terminal safety blocker
above every loading state. So during the fetch window the panel settled on the
terminal card instead of a self-updating loading state. The auto-fetch also
used a lazy SWR priority, so the PR landed slowly unless the user forced a
foreground refresh.

Fix:
- Selector: while a PR fetch is queued/in-flight and we have positive-but-not-
  yet-renderable review evidence (existing_review or positive_unresolved), show
  the self-updating "Checking status" state instead of the terminal card. It
  flips to the review once details land. A concurrent branch blocker still owns
  the copy.
- Fetch: when a review is known to exist but no renderable PR is cached, escalate
  the auto-fetch to a foreground `active`/80 request (matching manual refresh) so
  it resolves promptly.

Reuses existing i18n keys; adds unit coverage for both parts.

* fix(checks): bound unresolved review foreground refreshes

* fix(types): exclude absent stat overloads

* fix(checks): preserve refresh precedence and budget

* fix(checks): avoid redundant foreground PR refreshes

Fold unresolved-review promotion into the existing refresh effect so cached evidence produces one dispatch instead of an SWR plus active pair. Keep non-GitHub evidence on the budgeted path to avoid forced GitHub work for GitLab and other providers.

* fix(checks): scope foreground refreshes by provider
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ng (stablyai#9428)

* Clarify PR panel guidance: classify errors and confirm-only composer

Replace the ambiguous GitHub hosted-review boolean with a four-state evidence
model (found/positive_unresolved/not_found/unknown) so "No PR found" never
appears without an accepted lookup result. Classify GitHub refresh failures
into types (rate_limited, auth, network, permission, repo_unavailable,
gh_unavailable, unknown) for stable, honest copy. Confirmed-only composer:
preserve drafts across transient failures; hide Create during hard errors and
positive-unresolved evidence. Hard errors clear only when an eligibility
request starts after the error and returns an accepted outcome. Propagate
error types and unified retry schedule through the store. Sync mobile parity
with shouldOpenChecksPanelCreateComposer gating. Localize all new copy.

* Clarify PR panel guidance: classify errors and confirm-only composer

Add reviewLookupOutcome to hosted-review eligibility and thread it through
the panel so it never claims "No PR found" without accepted evidence. A
failed lookup is unavailable, not a settled no-PR. Fail closed on positive
unresolved evidence, hard refresh errors, and unavailable lookups. Add
structured GitHub refresh-error classification with Retry-After parsing.
Implement confirmed-only composer gating based on fresh, matching-context
eligibility with hard-error clearing. Mobile gates on reviewLookupOutcome
to prevent false Create claims. Surface throwOnFailure variants for each
provider so transport failures cross the RPC boundary instead of collapsing
to null. (Design success criteria 1–4; invariant 8.)

* Add exec-error helpers for subprocess error classification

Extracts stderr/stdout parsing and Retry-After detection into a
lightweight module that can be imported without pulling in the heavier
runner machinery. Supports PR-refresh error classification and proper
rate-limit handling for gh commands.

* test(mobile): include reviewLookupOutcome in create eligibility fixtures

Create / Push & Create now fails closed unless the lookup is not_found.
Update mobile test fixtures so accepted-no-PR cases can still proceed.

* Add OrThrow mock variants to forge-provider test mocks

forge-provider resolves branch reviews via the OrThrow variant so
lookup failures surface as unavailable instead of "no PR found".
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…R loads (stablyai#10008)

* fix(checks): stop the transient "PR already exists" card before the PR loads

The Checks panel briefly showed the terminal "Pull request already exists"
card (Open Review only) on a cold mount, and only rendered the real PR panel
after a manual refresh.

Root cause (regression from stablyai#9428): the eligibility probe resolves
`existing_review` from cache faster than the renderable PR hydrates, and the
new exhaustive selector ranks `existing_review` as a terminal safety blocker
above every loading state. So during the fetch window the panel settled on the
terminal card instead of a self-updating loading state. The auto-fetch also
used a lazy SWR priority, so the PR landed slowly unless the user forced a
foreground refresh.

Fix:
- Selector: while a PR fetch is queued/in-flight and we have positive-but-not-
  yet-renderable review evidence (existing_review or positive_unresolved), show
  the self-updating "Checking status" state instead of the terminal card. It
  flips to the review once details land. A concurrent branch blocker still owns
  the copy.
- Fetch: when a review is known to exist but no renderable PR is cached, escalate
  the auto-fetch to a foreground `active`/80 request (matching manual refresh) so
  it resolves promptly.

Reuses existing i18n keys; adds unit coverage for both parts.

* fix(checks): bound unresolved review foreground refreshes

* fix(types): exclude absent stat overloads

* fix(checks): preserve refresh precedence and budget

* fix(checks): avoid redundant foreground PR refreshes

Fold unresolved-review promotion into the existing refresh effect so cached evidence produces one dispatch instead of an SWR plus active pair. Keep non-GitHub evidence on the budgeted path to avoid forced GitHub work for GitLab and other providers.

* fix(checks): scope foreground refreshes by provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant