Skip to content

Make the ripgrep stdout byte cap deterministic across platforms - #450

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5550-ripgrep-output-cap-does-not-trip-on-linux-ci
Aug 10, 2026
Merged

Make the ripgrep stdout byte cap deterministic across platforms#450
TheGreatAxios merged 1 commit into
mainfrom
cl-5550-ripgrep-output-cap-does-not-trip-on-linux-ci

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes the Linux CI race where process close could settle a ripgrep run as complete output before the last stdout chunk was handled, so the byte cap never tripped.
  • Defers close settlement by one setImmediate turn so queued data handlers run first, and re-checks the cap on every settle path (close, timeout) so an over-cap body can never be reported as a full success.
  • Adds unit coverage for close-before-data ordering and collector settle ordering.

Closes CL-5550

Test plan

  • bun test src/plugins/rg-output.test.ts src/plugins/rg-run.test.ts tests/unit/ripgrep-plugin.test.ts (22 pass)
  • bun run typecheck
  • Confirm CI Linux runner passes grep returns partial matches when the output byte cap is hit

Close could settle as complete output before the last stdout chunk was
handled, so Linux CI never tripped the cap. Defer close one turn so
queued data runs first, and re-check the cap at every settle path so an
over-cap body can never be reported as a full success.
@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

CL-5550

@TheGreatAxios
TheGreatAxios merged commit 6c66af4 into main Aug 10, 2026
2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-5550-ripgrep-output-cap-does-not-trip-on-linux-ci branch August 10, 2026 02:14
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.

1 participant