Skip to content

fix(sidebar): classify review cancellation from the thrown error - #1511

Merged
Alan-TheGentleman merged 1 commit into
mainfrom
fix/sidebar-abort-error-classification
Sep 27, 2026
Merged

Alan-TheGentleman merged 1 commit into
mainfrom
fix/sidebar-abort-error-classification

Conversation

@Alan-TheGentleman

@Alan-TheGentleman Alan-TheGentleman commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Linked issue

Follow-up to #1306 / #1510 (CodeRabbit finding on #1510).

PR type

  • Bug fix (type:bug)

Summary

  • The sidebar classified any failure as unknown whenever signal.aborted was true, so an abort that raced an ordinary failure (e.g. a denied destructive-operation confirmation) was mislabeled.
  • Classification now reads the thrown error: AbortError, or a native NativeReviewCliError with code cancelled, maps to unknown; everything else stays unavailable.
  • The three explicit pre-execution cancellations in gentle_review, gentle_review_capture, and gentle_review_capture_group now throw AbortError, following the existing convention in lib/native-review-cli.ts.

Verification

  • Test-first: the new abort-races-ordinary-failure case was observed RED (unknown instead of unavailable), then GREEN.
  • node --experimental-strip-types --test tests/review-sidebar-state.test.ts tests/shell-bar.test.ts: 59/59 passed.
  • node --experimental-strip-types --test tests/gentle-ai.test.ts tests/native-review-cli.test.ts tests/native-review-consent.test.ts tests/review-authority.test.ts: 146/146 passed.
  • node scripts/check-types.mjs: 188 baseline diagnostics, no regressions.
  • node scripts/build-runtime-modules.mjs --check: generated modules match sources.
  • Native review: medium/reliability approved and acknowledged.

Summary by CodeRabbit

  • Bug Fixes
    • Review cancellations are now reported as an unknown status, while other failures remain unavailable—even if the cancellation signal was aborted.
    • Capture and controller tools now return a cancellation-specific error when started with an already-aborted signal.

An abort that races an ordinary failure, such as a later authorization denial, no longer shows as unknown. Explicit tool cancellations now throw AbortError, and native CANCELLED errors keep the unknown classification.
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a522caa6-2b3f-4a10-a2ca-6f6d0c55d33b

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa1ea4 and 11ac05b.

📒 Files selected for processing (3)
  • extensions/gentle-ai.ts
  • lib/review-sidebar-state.ts
  • tests/review-sidebar-state.test.ts

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


📝 Walkthrough

Walkthrough

Review tools now throw named cancellation errors when their signals are already aborted. The sidebar publisher classifies cancellation from the thrown error and sets its snapshot state accordingly.

Changes

Review cancellation

Layer / File(s) Summary
Named cancellation errors in review tools
extensions/gentle-ai.ts
The capture-group tool, capture tool, and review controller now throw errors named AbortError when their signals are already aborted.
Sidebar classification and tests
lib/review-sidebar-state.ts, tests/review-sidebar-state.test.ts
The publisher sets the snapshot to unknown for AbortError and native CANCELLED errors. It sets the snapshot to unavailable for other errors. Tests verify these states and that the original error is rethrown.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 11ac0

Explicit review cancellations are reported as unknown while ordinary failures remain unavailable. No material merge-blocking issue was identified, so the change is mergeable subject to normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 11ac0

The change corrects how an existing review session displays cancellation versus failure. No new permission or execution route was found, but some integration coverage remains incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The evidenced change affects review-session display classification rather than adding a route to native execution or expanding the authority of the underlying tool.

Trust Boundaries and Controls

  • observed — Snapshot publication requires a matching live session and generation. The wrapper still delegates execution to the underlying tool and rethrows its error, so classification is not an authorization decision.

Resilience and Maintainability Implications

  • observed — Reset invalidates pending publication through the generation counter. The cancellation regression test checks the original error identity, but its listed cases run sequentially rather than as concurrent pending calls.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: classifying sidebar review cancellation from the thrown error.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@Alan-TheGentleman
Alan-TheGentleman merged commit 78775c3 into main Sep 27, 2026
6 checks passed
@Alan-TheGentleman
Alan-TheGentleman deleted the fix/sidebar-abort-error-classification branch September 27, 2026 20:29
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