8000 fix(collector)!: prevent dropped-byte counter overflow by dominicnunez · Pull Request #322 · dominicnunez/codex-sdk-go · GitHub
[go: up one dir, main page]

Skip to content

fix(collector)!: prevent dropped-byte counter overflow - #322

Merged
dominicnunez merged 1 commit into
mainfrom
fix/collector-byte-counters
Nov 4, 2026
Merged

dominicnunez merged 1 commit into
mainfrom
fix/collector-byte-counters

Conversation

@dominicnunez
Copy link
Copy Markdown
Owner

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 int64 throughout 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.Process and RunStreamedWithCollector, checking the totals below and above 2 GiB, exact retained suffixes, identity isolation, plan replacement and command completion. CI now executes the public cases on 386 as 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

BREAKING CHANGE: DroppedLatestPlanTextBytes and DroppedOutputDeltaBytes now use int64 instead of int.
@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Nov 4, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T04:23:52.980683Z 434134a PR opened
🔒 Security Review ✅ Completed 2026-11-04T04:25:00.856596Z 434134a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dominicnunez
dominicnunez merged commit 4780900 into main Nov 4, 2026
4 checks passed
< 7FBC /div>
@dominicnunez
dominicnunez deleted the fix/collector-byte-counters branch November 4, 2026 04:27
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.

fix: prevent collector dropped-byte counter overflow on 32-bit builds

1 participant

0