Skip to content

fix(review): preserve candidate-owner preparation errno in diagnostic message (#2376) - #2388

Open
carlosmoradev wants to merge 1 commit into
Gentleman-Programming:mainfrom
carlosmoradev:fix/2376-candidate-owner-preparation-errno-diagnostic
Open

carlosmoradev wants to merge 1 commit into
Gentleman-Programming:mainfrom
carlosmoradev:fix/2376-candidate-owner-preparation-errno-diagnostic

Conversation

@carlosmoradev

@carlosmoradev carlosmoradev commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2376

Problem

When gentle_review START fails during candidate view owner preparation, the returned diagnostic drops the underlying errno and outputs an unhelpful generic message:

{"code":"candidate-owner-preparation-failed","message":"candidate view rejected before native START"}

In lib/review-candidate-view.ts, candidateOwnerPreparationError explicitly computes and formats the bounded safe errno (EPERM, EACCES, ENOENT, EIO, ETIMEDOUT) into error.message (e.g. candidate view owner preparation failed (EACCES)). However, in extensions/gentle-ai.ts:7098 (nativeOperationFailure), the pre-native CandidateViewError branch discarded error.message and hardcoded "candidate view rejected before native START". In contrast, the non-pre-native branch immediately below preserved error.message.

Solution

  • Preserve error.message on pre-native CandidateViewError:
    • In extensions/gentle-ai.ts:7098, updated the fallback to error.diagnostics ?? { code: error.reason, message: error.message }, allowing the computed errno to surface cleanly to callers.
  • Regression Coverage:
    • In tests/gentle-ai.test.ts, verified that candidate-owner-preparation-failed preserves the formatted errno in result.diagnostics.message.

Changes

File Change
extensions/gentle-ai.ts Preserve error.message in pre-native CandidateViewError diagnostic fallback
tests/gentle-ai.test.ts Assert result.diagnostics.message retains the computed errno
odd/tasks/fix-2376-candidate-owner-preparation-errno-diagnostic.md Task breakdown and verification evidence

Verification

  • Strict TDD:
    • RED: Observed message: 'candidate view rejected before native START' !== 'candidate view owner preparation failed (EACCES)'.
    • GREEN: All 123 tests in tests/gentle-ai.test.ts pass.
  • Typecheck & Integrity:
    • npm run typecheck: 0 diagnostics, no regressions.

Summary by CodeRabbit

  • Bug Fixes
    • Candidate-owner preparation errors now retain their specific diagnostic messages, including error codes such as EACCES, instead of showing a generic rejection message.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: dd6ab2c7-290f-46bc-b7d7-8f9e99db6181
📥 Commits

Reviewing files that changed from the base of the PR and between ceb5e54 and 256f3ef.

📒 Files selected for processing: 3
  • extensions/gentle-ai.ts
  • odd/tasks/fix-2376-candidate-owner-preparation-errno-diagnostic.md
  • tests/gentle-ai.test.ts

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

📝 Walkthrough

For pre-native START failures caused by CandidateViewError, nativeOperationFailure now preserves the error’s message instead of returning a generic message. The test checks that the returned diagnostic includes (EACCES).

Changes: Candidate-owner diagnostics

Layer / File(s) Summary
Preserve candidate-owner error message
extensions/gentle-ai.ts, tests/gentle-ai.test.ts, odd/tasks/fix-2376-candidate-owner-preparation-errno-diagnostic.md
The pre-native START diagnostic now uses the CandidateViewError message. The test expects the (EACCES) detail, and the task record documents the test, implementation, and reported verification.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: alan-thegentleman

Merge Risk: ⚪ Minimal · up to 256f3

Candidate-owner preparation failures now retain their bounded errno in the caller-facing diagnostic, with no actionable merge risk identified.

Pre-merge checks: Passed 5
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: preserving the candidate-owner preparation errno in the diagnostic message.
Linked Issues check Passed Issue #2376 requires the pre-native CandidateViewError diagnostic to expose the bounded errno. extensions/gentle-ai.ts now uses error.message when error.diagnostics is absent. The regression t…
Out of Scope Changes check Passed The source change directly implements issue #2376. The test provides regression coverage for that change. The task document records the same implementation and verification work. No unrelated change i…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check

Explanation

Issue #2376 requires the pre-native CandidateViewError diagnostic to expose the bounded errno. extensions/gentle-ai.ts now uses error.message when error.diagnostics is absent. The regression test verifies candidate-owner-preparation-failed with (EACCES). The issue requires diagnosability; it does not require this patch to resolve the underlying owner-preparation failure.

Full details: Out of Scope Changes check

Explanation

The source change directly implements issue #2376. The test provides regression coverage for that change. The task document records the same implementation and verification work. No unrelated change is shown.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (2 skipped: 1 unsupported, 1 too large.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This branch has not been deployed

No deployments
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.

gentle_review START: candidate-owner-preparation-failed drops the errno, leaving the failure undiagnosable

1 participant