You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repo guidelines and linked-issue context are computed in Reviewer but never injected into the review prompt. Both features appear wired up but are silent no-ops for the actual code review.
Guidelines: dropped entirely — never reach the review or the walkthrough.
Linked issues: reach the walkthrough but not the review.
Evidence (src/reviewer.ts)
The review prompt receives repo knowledge only through the learnings array (knowledgeLearnings), which is passed to this.ai.review(context, repoConfig, knowledgeLearnings):
// Build enhanced prompt context by injecting knowledge into the AI prompt// (Guidelines and issues are injected via the prompt builder's learnings param)constknowledgeLearnings=[...relevantLearnings];// Add guideline content as synthetic learningsconstguidelinesPrompt=formatGuidelinesForPrompt(relevantGuidelines);// reviewer.ts:756 — assigned, never usedconstissuesPrompt=formatIssuesForPrompt(linkedIssues);// reviewer.ts:757 — assigned, never used
knowledgeLearnings is only ever [...relevantLearnings] (754), then unshift-ed with the language preference (761); it is never given guidelinesPrompt or issuesPrompt before being passed to this.ai.review(...) (813). Despite the comment ("injected via the prompt builder's learnings param" / "Add guideline content as synthetic learnings"), that injection never happens.
Corroborating facts:
formatGuidelinesForPrompt (src/guidelines.ts:147) and formatIssuesForPrompt (src/issues.ts:88) are pure string formatters — no side effects — so lines 756/757 are pure dead computation.
Only call site of each is the dead assignment above (formatGuidelinesForPrompt → reviewer.ts:756; formatIssuesForPrompt → reviewer.ts:757).
relevantGuidelines has no other consumer (defined 744, used only at the dead 756).
linkedIssuesis used for the walkthrough (reviewer.ts:1217, formatIssuesForWalkthrough), so issue context reaches the walkthrough but not the review.
buildReviewPrompt (src/ai/prompt.ts) takes no guidelines/issues parameters — the learnings array is the only channel into the review prompt.
Impact
Repo guidelines configured by users have no effect on inline review findings.
Linked-issue context does not inform the review (only the walkthrough).
Both fail silently — no error, no log — so the gap is invisible to operators.
Suspected intended behavior
Push the formatted strings into knowledgeLearnings as synthetic Learning entries before the review call, e.g.:
(Exact shape/placement TBD — verify against how learnings are rendered in buildReviewPrompt and add a regression test asserting guideline/issue content reaches the built prompt.)
Provenance / notes
Introduced by befbb49 ("Add CodeRabbit-parity features: walkthrough, chat, config, knowledge base, finishing touches"). Pre-existing on main.
Surfaced via the advisory-lint warning 'guidelinesPrompt' is assigned a value but never used while reviewing PR Add backup AI provider / failover (off by default) #78 (backup AI failover). Unrelated to that PR and intentionally left out of its scope to keep the diff focused.
Summary
Repo guidelines and linked-issue context are computed in
Reviewerbut never injected into the review prompt. Both features appear wired up but are silent no-ops for the actual code review.Evidence (
src/reviewer.ts)The review prompt receives repo knowledge only through the
learningsarray (knowledgeLearnings), which is passed tothis.ai.review(context, repoConfig, knowledgeLearnings):knowledgeLearningsis only ever[...relevantLearnings](754), thenunshift-ed with the language preference (761); it is never givenguidelinesPromptorissuesPromptbefore being passed tothis.ai.review(...)(813). Despite the comment ("injected via the prompt builder's learnings param" / "Add guideline content as synthetic learnings"), that injection never happens.Corroborating facts:
formatGuidelinesForPrompt(src/guidelines.ts:147) andformatIssuesForPrompt(src/issues.ts:88) are pure string formatters — no side effects — so lines 756/757 are pure dead computation.formatGuidelinesForPrompt→ reviewer.ts:756;formatIssuesForPrompt→ reviewer.ts:757).relevantGuidelineshas no other consumer (defined 744, used only at the dead 756).linkedIssuesis used for the walkthrough (reviewer.ts:1217,formatIssuesForWalkthrough), so issue context reaches the walkthrough but not the review.buildReviewPrompt(src/ai/prompt.ts) takes no guidelines/issues parameters — thelearningsarray is the only channel into the review prompt.Impact
Suspected intended behavior
Push the formatted strings into
knowledgeLearningsas syntheticLearningentries before thereviewcall, e.g.:(Exact shape/placement TBD — verify against how
learningsare rendered inbuildReviewPromptand add a regression test asserting guideline/issue content reaches the built prompt.)Provenance / notes
befbb49("Add CodeRabbit-parity features: walkthrough, chat, config, knowledge base, finishing touches"). Pre-existing onmain.'guidelinesPrompt' is assigned a value but never usedwhile reviewing PR Add backup AI provider / failover (off by default) #78 (backup AI failover). Unrelated to that PR and intentionally left out of its scope to keep the diff focused.