Repository navigation
fix(collector)!: prevent dropped-byte counter overflow - #322
Merged
Merged
Conversation
BREAKING CHANGE: DroppedLatestPlanTextBytes and DroppedOutputDeltaBytes now use int64 instead of int.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long streams could make plan-text and command-output discarded-byte totals wrap negative on 32-bit builds, despite bounded retained text. Both totals now use
int64throughout their stored state, accumulation helpers and public summaries. Retained lengths and dropped-entry counts keep their existing types and limits.Public regressions process 257 reused 8 MiB chunks through
StreamCollector.ProcessandRunStreamedWithCollector, checking the totals below and above 2 GiB, exact retained suffixes, identity isolation, plan replacement and command completion. CI now executes the public cases on386as well as the existing ordinary builds. Race builds exercise the full command-counter workload directly at its owner alongside the existing smaller public notification/lifecycle tests, avoiding race instrumentation of more than 2 GiB of JSON. Architecture and threat-model accounting descriptions match the implementation.Validation: the original 32-bit implementation failed exactly the two overflow assertions while the identical 64-bit workload passed. Final formatting, module tidiness, build, vet, lint, ordinary tests, race tests, explicit 32-bit regressions and focused retention/identity checks passed. Independent patch review found no actionable issues.
Closes #270