fix(codemode): prevent eval status heap exhaustion#4
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Superseded by standalone upstream Draft PR code-yeongyu#324. The replacement is based directly on upstream main and contains only the bounded eval status history fix plus its package changelog entry. |
Summary
Root cause
The reported process died near V8's 4.1-GB heap limit while child task
st_019f92dcwas visible. Raw artifactanalysis showed that the child itself had only a 3,634-byte task log and a 778-byte state record.
The actual concurrent workset was a Code Mode eval that recursively called Python
read()over an estimated:Every helper read emitted a status event containing its path and up to 500 preview characters.
upsertStatusEvent()appended every event, whileCellHandlercopied the complete accumulated history into bothcell-level and top-level details for every partial update. The retained state grew linearly and aggregate cloning
grew quadratically until V8 exhausted its heap.
Fix
{ op: "status-events-omitted", count: 2 }markerRED -> GREEN
Verification
@code-yeongyu/senpi-codemode: 54 files / 372 tests passed; 1 file / 12 tests skippednpm run build: passednpm run check: passedgit diff --check: passedRoot
npm testis blocked before workspace execution by a pre-existing missing localv0.82.0git tag inscripts/check-upstream-release.test.mjs; the same test fails on the unchanged stack base.Real fixpi QA
Hermetic localhost fake provider; real auth unchanged:
fixpilauncher loaded this third-stack worktreeNODE_OPTIONS=--max-old-space-size=256fixpi --version,fixpi --help, and bad input passedReview
Independent goal, code-quality, security, hands-on QA, and stacked/upstream-context reviewers all returned PASS with
no remaining blockers or findings.
Summary by cubic
Prevents heap exhaustion in Code Mode by capping eval status history to 100 rows per cell. Adds an omission marker and renderer support while keeping agent status coalescing intact.
STATUS_EVENT_HISTORY_LIMIT); on overflow, insert{ op: "status-events-omitted", count }as the first row and keep the latest 99 events.agentevents and trim after updates.Written for commit 2ac7b36. Summary will update on new commits.