Conversation
Port the OCR PR Review GitHub Action from vybestack/llxprt-luther into
this repo as a new standalone workflow (.github/workflows/ocr-review.yml).
Key adaptations for the TypeScript monorepo:
- Renamed workflow (OCR Review), concurrency group (ocr-review-<PR>),
and sticky-summary marker (<!-- llxprt-code-ocr-review -->) to be
repo-neutral.
- Adjusted OCR_RULES_JSON include patterns to cover *.test/*.spec for
.ts/.tsx/.js/.jsx/.mjs/.cjs plus __tests__/, tests/, test/ directories;
removed Rust/Go/Java/Python-specific patterns.
- Rewrote the changed-test scope-guard grep regex to match the actual
llxprt-code test layout: packages/**/__tests__/**, *.test.ts(x),
*.spec.ts(x), *.test/spec.{js,jsx,mjs,cjs}.
Fork-safety model preserved verbatim: pull_request_target with trusted
base checkout, PR head fetched to explicit local ref (never working copy),
scoped git-auth cleanup, no PR-supplied code execution.
pr-review.yml is intentionally untouched — OCR is fully decoupled and
observational (non-required).
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new standalone GitHub Actions workflow, ChangesOCR Review Workflow
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
LLxprt PR Review – PR #2420Issue AlignmentCloses #2413. Adds a standalone Side EffectsCI-only change. New workflow consumes repo vars/secrets ( Code QualityStrong defensive posture: trusted base checkout, PR head fetched to explicit local ref (never working copy), TOCTOU SHA verification, scoped git-auth cleanup with traps, explicit Tests and CoverageCoverage impact: unknown / not applicable. No test files were added or modified. This is a new CI workflow file; traditional automated tests are not possible. Validation cited by author includes YAML syntax check, VerdictReady. The PR delivers exactly what #2413 requested, with strong fork-safety discipline and no changes to application code. The lack of conventional automated tests is appropriate for a standalone workflow file, and the cited manual validations are credible. One minor consideration: |
Pin actions/checkout@v5, actions/upload-artifact@v4, and actions/github-script@v7 to their commit SHAs with ratchet comments, matching the repo convention enforced by the ratchet linter in CI.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ocr-review.yml:
- Around line 257-260: The changed-test filter in the workflow regex is
miswritten in the pattern used by the changed_tests shell block, so standard
standalone files like *.test.tsx and *.spec.tsx are not matched. Update the grep
expression in the changed-test scope guard to correctly match the suffix form
for .test/.spec before the TypeScript/JS extension, and verify it still
preserves the existing __tests__/tests directory matching logic.
- Around line 528-547: The duplicate filtering for inline OCR comments currently
happens only in the fallback path after batch posting fails, so a successful
batch retry can still repost the same comments. Update the inline review flow in
the GitHub Actions workflow around the createReview batch posting logic to build
and apply the existing-inline key filter before calling
github.rest.pulls.createReview, using existingInlineCommentKeys and the inline
comment set so already-posted comments are removed from the batch payload as
well as the fallback path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8fd5f3d4-8299-4602-b9b4-b783c822445d
📒 Files selected for processing (1)
.github/workflows/ocr-review.yml
Prettier (singleQuote: true) requires single-quoted YAML strings. Fixes the Lint (Javascript) CI failure.
…cates Address CodeRabbit feedback: 1. Scope-guard regex bug: the pattern (\.test\.|\.spec\.)\.(ts|...) matched a literal double-dot suffix (e.g. file.test..ts), so standard *.test.ts(x) and *.spec.ts(x) files outside test directories were NOT caught by the 'changed tests must be reviewed' guard. Fixed to \.(test|spec)\.(ts|tsx|js|jsx|mjs|cjs)$ which correctly matches the real test file names. 2. Inline comment duplicate filtering: duplicate detection only ran in the fallback path (after batch createReview failed). A successful batch retry on the same head SHA would repost all inline comments. Now existing inline keys are fetched and filtered BEFORE the batch post, making reruns idempotent.
CodeRabbit findings addressedBoth CodeRabbit findings from the initial push have been fixed in commit 2a2b97e: 1. Changed-test scope-guard regex (Major): The pattern 2. Pre-filter duplicate inline comments (Major): Duplicate detection previously only ran in the fallback path (after batch |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-24.x-ubuntu-latest' artifact from the main CI run. |
Summary
Ports the OCR PR Review GitHub Action from
vybestack/llxprt-lutherinto this repo as a new, fully standalone workflow:.github/workflows/ocr-review.yml. This is a CI-only change — no application source code is modified.Closes #2413.
What it does
Runs OpenCodeReview (OCR) — an LLM-based code reviewer — as an observational, non-required review signal alongside the existing
pr-review.ymlbot. It posts findings as inline PR review comments (resolvable file/line positions) plus a sticky summary comment.Triggers
pull_request_targetonopened/reopened/synchronize/ready_for_reviewissue_commenton/ocror/open-code-review(OWNER / MEMBER / COLLABORATOR only)workflow_dispatchwith apr_numberinputFork-safety model (preserved verbatim from luther)
Uses
pull_request_targetso secrets are reachable on fork PRs without ever executing PR-supplied code:actions/github-script@v7actions/checkout@v4,ref: <base_sha>,fetch-depth: 0,persist-credentials: false)git fetch origin pull/<n>/head:pr-head) without making it the working copymerge-baseso only the actual PR diff is reviewedmake/cargo/ repo npm scripts invoked; scoped git-auth cleanup on EXIT/INT/TERMAdaptations for TypeScript monorepo (Rust → TS)
OCR PR ReviewOCR Reviewocr-pr-review-<PR>ocr-review-<PR><!-- luther-ocr-review --><!-- llxprt-code-ocr-review -->*_test.rs,*_test.go,*Test.java, etc.*.test.{js,jsx,mjs,cjs,ts,tsx},*.spec.{...},__tests__/,tests/,test/__tests__/,tests?/,.test.,.spec.for.ts/.tsx/.js/.jsx/.mjs/.cjsThe scope-guard regex was validated against the real llxprt-code test layout (e.g.
packages/settings/src/__tests__/SettingsService.test.ts,packages/cli/src/ui/App.test.tsx,packages/providers/src/auth/__tests__/*.spec.ts).What is NOT changed
pr-review.ymlis untouched — OCR is fully decoupled. The two workflows evolve independently.Required repo setup (admin action, outside this PR)
Before the workflow can run, these must be configured on the repo:
OCR_LLM_URL,OCR_LLM_MODEL,OCR_LLM_USE_ANTHROPIC(optional)OCR_LLM_AUTH_TOKENVerification
python3 yaml.safe_load)actionlintpasses (exit 0, zero errors).test.ts(x),.spec.ts(x),__tests__/**match correctlypr-review.ymlconfirmed unmodified in diff@alibaba-group/open-code-review@1.6.1(same as luther)<!-- llxprt-code-ocr-review -->ocr-review-<PR>Acceptance criteria checklist
ocr-review.ymlexists as a new standalone file withpull_request_target,issue_comment, andworkflow_dispatchtriggerspr-review.ymlis untouched@1.6.1::error::messagesSummary by CodeRabbit