fix(advisor): retry transient provider failures#6591
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds same-session retry handling for transient provider failures in advisor sessions, adds a workflow step that fails when analysis does not succeed, and updates boundary validation, tests, and workflow docs to match the new flow. ChangesAdvisor retry handling and workflow verification
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Session as Advisor Session
participant SettingsManager
participant Provider
Session->>SettingsManager: inMemory(advisorRetrySettings(modelId))
Session->>Provider: prompt()
Provider-->>Session: transient error (HTTP 429)
Session->>Session: auto_retry_start (clear currentTurnError, log attempt/delay)
Provider-->>Session: retry response
alt retry succeeded
Session->>Session: auto_retry_end (clear currentTurnError)
else retries exhausted
Session->>Session: auto_retry_end (captureTurnError finalError)
end
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage remains at 96%, unchanged from the TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most impacted files.
Updated |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
E2E Target RecommendationRequired E2E targets: None Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
PR Review Advisor (Nemotron Ultra) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
Review findings by urgency: 0 required fixes, 2 items to resolve/justify, 1 in-scope improvement
|
PR Review Advisor — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
Review findings by urgency: 0 required fixes, 1 item to resolve/justify, 0 in-scope improvements
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Adds model-aware same-session retries for transient PR Review Advisor provider failures, using one retry layer and staggered GPT/Nemotron backoff. The workflow still publishes summaries, comments, and artifacts after an incomplete analysis, then fails an explicit final outcome gate so the missing review cannot appear green. ## Changes - Configure four bounded agent-level retries while disabling the provider SDK's overlapping retry layer. - Clear transient attempt errors after a successful retry and preserve the final provider error when retries are exhausted. - Add a final workflow outcome check after summary, comment, and artifact publication, with boundary validation that prevents the failure from being masked. - Add retry and workflow regression tests and document the maintainer-facing behavior. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates <!-- Check exactly one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: this changes internal PR Review Advisor behavior; `tools/pr-review-advisor/README.md` documents the maintainer-facing contract and no public NemoClaw behavior changes. - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each applicable item only when supported by the requested evidence. Run targeted tests once per relevant change set and rerun after later edits or hook autofixes that can affect the tested behavior. Do not rerun hook-covered checks. --> - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: `npx vitest run test/advisor-session-runner.test.ts test/pr-review-advisor-workflow-boundary.test.ts test/pr-review-advisor.test.ts` (3 files, 74 tests passed); `npm run typecheck:cli`, `npm run source-shape:check`, and `npm run test-size:check` passed. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: not applicable; the change is isolated to advisor retry and workflow-boundary behavior with focused coverage. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added bounded retry handling for transient advisor provider failures within the same session, improving reliability. * Added an explicit post-analysis verification step to ensure advisor results complete successfully. * **Bug Fixes** * Prevents the workflow from continuing when the analysis outcome is missing, not successful, or when verification is misconfigured. * Improves reporting when transient retries are exhausted. * **Documentation** * Updated the PR Review Advisor workflow documentation to reflect the new transient retry behavior and revised step ordering. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Adds model-aware same-session retries for transient PR Review Advisor provider failures, using one retry layer and staggered GPT/Nemotron backoff. The workflow still publishes summaries, comments, and artifacts after an incomplete analysis, then fails an explicit final outcome gate so the missing review cannot appear green.
Changes
Type of Change
Quality Gates
tools/pr-review-advisor/README.mddocuments the maintainer-facing contract and no public NemoClaw behavior changes.Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run test/advisor-session-runner.test.ts test/pr-review-advisor-workflow-boundary.test.ts test/pr-review-advisor.test.ts(3 files, 74 tests passed);npm run typecheck:cli,npm run source-shape:check, andnpm run test-size:checkpassed.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result: not applicable; the change is isolated to advisor retry and workflow-boundary behavior with focused coverage.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
New Features
Bug Fixes
Documentation