Skip to content

fix(codemode): bound eval status history#335

Draft
minpeter wants to merge 2 commits into
code-yeongyu:mainfrom
minpeter:fix/eval-status-history-bound-main
Draft

fix(codemode): bound eval status history#335
minpeter wants to merge 2 commits into
code-yeongyu:mainfrom
minpeter:fix/eval-status-history-bound-main

Conversation

@minpeter

@minpeter minpeter commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bound Code Mode eval status history to 100 rows per cell
  • reserve one row for an exact omitted-event count after overflow
  • retain the newest 99 real events without changing normal small histories or agent-status coalescing
  • document the bounded-history contract in the package README and changelog

This is the clean current-main replacement for #324, replayed directly onto upstream/main@38bd3a3cf with no compaction or TUI dependency.

Root cause

Each eval cell kept every emitted status event in state.events. Read/update-heavy child work could emit thousands of events, and every render rebuilt the full unbounded list. A long session could therefore retain and repeatedly render enough history to drive V8 toward its heap limit.

Behavior

  • at most 100 retained status rows per cell
  • after overflow: one synthetic omission row plus the newest 99 events
  • exact omitted-event count remains correct as additional events arrive
  • small histories and existing agent-status coalescing behavior remain unchanged

Verification

  • focused status/render/tool-output regressions: 3 files, 24 tests passed
  • full senpi-codemode suite: 54 files / 372 tests passed; 1 file / 12 tests skipped
  • root npm run build: passed
  • root npm run check: passed
  • real built CLI with a Python eval under NODE_OPTIONS=--max-old-space-size=256: 20,000 reads completed, 100 top-level/cell status rows retained, exact omitted count 19,901, auth unchanged
  • git diff --check: passed

Kept as Draft for maintainer review.


Summary by cubic

Bound Code Mode eval status history per cell to 100 rows to prevent unbounded growth and reduce memory pressure. Keeps the newest events and shows an exact omitted count.

  • Bug Fixes
    • On overflow, insert a status-events-omitted row and retain the latest 99 events; the omitted count increments as more events arrive.
    • Updated renderer to show "N earlier events omitted"; small histories and agent-status coalescing remain unchanged.
    • Documented the bounded-history contract in README.md/CHANGELOG.md and added tests for trimming and partial/final details.

Written for commit 8da0cea. Summary will update on new commits.

Review in cubic

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