Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The optimized log-tail extraction preserves existing excerpts while reducing work for dense logs; no actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — behavior-preserving perf refactor of earlier-error context selection, plus a benchmark and regression tests.
- Backward scan with early stop —
collectEarlierErrorLineIndexesnow walks earlier lines fromrecentStart - 1down to 0 and fills each error's context window fromcontextEnddownward, breaking once theSethitsPR_CHECK_LOG_TAIL_MAX_EARLIER_LINES(30). - Cap moved into collection — the
earlierIndexes.slice(-30)at the call site is dropped; the 30-line cap is enforced while collecting. - New benchmark script —
config/scripts/check-job-log-tail-benchmark.mjsloads the baseline via stdin with esbuild, asserts a 2000-case differential, and reports counterbalanced timings. - New tests — early-stop scan bound, overlapping-window dedup with oldest-window clipping, and first-line/boundary clipping.
The equivalence claim holds: since descending error positions have non-increasing contextEnd, any index an earlier error could contribute above the running minimum is already covered by a previously added contiguous window, so the first 30 collected indexes are exactly the 30 largest unique indexes the old sort().slice(-30) produced. I confirmed this three ways — pnpm test src/shared/check-job-log-tail-slice.test.ts (7 passed), pnpm tc (clean), and an independent 200,000-case differential fuzz against the baseline (all match) — alongside re-running the PR's own 2000-case differential benchmark. The measured speedups reproduce (dense 19.2 → 3.9 ms, spaced 24.3 → 4.2 ms on 100k lines).
No wire, path, platform, or shared-contract change — the same pure function serves the GitHub and GitLab paths.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Closing as a functional duplicate of #20211. Both make the same optimization to |

ELI5
Failed CI logs can contain thousands of errors, but Orca shows only the latest 30 lines of earlier error context. Find those lines from the end and stop as soon as the excerpt is full.
What Changed
Scan earlier log lines backwards, deduplicate overlapping context windows in a set capped at 30 entries, then restore chronological order. Preserve the existing error patterns, two-line context, recent tail, UTF-8 byte budget, and exact excerpt text.
Why
The old implementation scans every earlier line and stores/sorts every matching context index before discarding almost all of them. GitHub job logs can reach the existing 64 MiB download cap; this code runs synchronously when showing failed check details. GitLab uses the same excerpt function after its existing trace normalization.
Measured actual baseline and candidate functions on synthetic 100,000-line logs (~9 MB), macOS arm64, Node 26.6.0. Eight counterbalanced before/after pairs per workload; medians per call:
These measure excerpt generation, not network downloads or app-wide latency. The existing full-log split remains. No output is truncated differently and no new cache or state is introduced.
Linked Issue
Refs #20206. Performance audit PR 1; the broader audit remains open.
Visual Proof
N/A — the excerpt text and interactions are unchanged.
Testing
ORCA_BACKGROUND_LAUNCH=1 pnpm tcand changed-code quality checks pass.Reproduce measurements from the repository root:
git show 20ab99506541:src/shared/check-job-log-tail-slice.ts | node config/scripts/check-job-log-tail-benchmark.mjsReview
Descending error positions have descending context endpoints, so once the most recent 30 unique lines are selected, earlier errors cannot contribute a newer line. Both Git providers use the same pure function; no path, platform, Git command, SSH execution boundary, or wire format changes.
Agent skill upstream boundary
Checklist