Skip to content

fix(codemode): bound eval status history on current main#334

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

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

Conversation

@minpeter

@minpeter minpeter commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bound each Code Mode eval cell's retained status history to 100 rows
  • after overflow, retain one exact omitted-event count plus the newest 99 real events
  • preserve small histories and existing in-window agent-status coalescing
  • render and document the omission row

Root cause

Each eval cell retained every status event, including a path and preview for every read(). Every partial update then copied the entire unbounded history into both top-level and cell details. Read-heavy child work could therefore exhaust V8's heap before eval completed.

Current-main replacement

This Draft is based directly on upstream/main@38bd3a3cf and contains patch-identical ports of the two focused commits from #324. No current-main source file touched by the fix diverged from #324's old base.

Supersedes #324, which was 21 main commits behind and did not contain current main in its ancestry.

Verification

  • root npm run build: passed
  • focused status/output/render source tests: 3 files / 24 tests passed
  • full @code-yeongyu/senpi-codemode source suite: 54 files / 372 tests passed; 1 file / 12 tests capability-skipped
  • CI Code Mode suite: 55 files / 384 tests passed
  • required root npm run check: passed
  • changed-file LSP diagnostics, no-excuse audit, and git diff --check: passed

Exact 256 MB source CLI QA

Run from the PR worktree root through the Senpi QA harness and real source CLI (runCli/tsx) with a hermetic localhost fake-model provider:

NODE_OPTIONS=--max-old-space-size=256 node local-ignore/qa-evidence/20260724-eval-status-history-current-main/eval-memory-cli-qa.mjs 125
NODE_OPTIONS=--max-old-space-size=256 node local-ignore/qa-evidence/20260724-eval-status-history-current-main/eval-memory-cli-qa.mjs 20000

Results:

  • 125 Python read() events: PASS in 5.232 s; 100 top-level rows; 100 cell rows; exact omitted count 26
  • 20,000 Python read() events: PASS in 7.735 s; 100 top-level rows; 100 cell rows; exact omitted count 19,901
  • both runs completed two model turns, observed the completion marker, kept real auth unchanged, and removed the QA sandbox

Red Check and test classification

The historical check remains red and is not represented as passing. Its two packages/coding-agent failures were compared against fresh upstream/main@38bd3a3cf, which is still the PR's exact base:

  • git diff --stat upstream/main...HEAD -- packages/coding-agent is empty; the failing tests, Vitest config, and src/main.ts have identical hashes at PR head and base.
  • Compaction assertion: current-main CI run 30089381490 has the same test, expected [] to have a length of 2 but got +0 assertion, and line 1361 as PR run 30110526214. Fresh focused runs fail identically at both PR head and a clean detached base worktree; fresh serialized CI=1 npm test runs fail it on both revisions. Classification: pre-existing current-main failure.
  • List-model 30 s timeout: the exact failed test passes focused at PR head (7.50 s) and base (7.32 s), and does not time out in either fresh serialized full-package run. Classification: non-reproducing suite/runner timeout with no PR source delta, not a PR regression.

No unrelated coding-agent fix is included in this scoped Code Mode OOM PR.

Local evidence: local-ignore/qa-evidence/20260724-eval-status-history-current-main/INDEX.md and ci-failure-classification.md.


Summary by cubic

Bound each eval cell’s status history to 100 rows and added an omission marker to prevent heap bloat during read‑heavy evaluations while keeping the newest events intact.

  • Bug Fixes
    • Trim status history in status-events.ts with STATUS_EVENT_HISTORY_LIMIT = 100; keep the latest 99 events plus a { op: "status-events-omitted", count } row.
    • Apply trimming on partial updates and final details; existing agent coalescing remains.
    • Render omission row in render.ts as “N earlier events omitted”.
    • Updated README and tests in @code-yeongyu/senpi-codemode to document and verify bounded history.

Written for commit 48dbede. Summary will update on new commits.

Review in cubic

@minpeter

Copy link
Copy Markdown
Contributor Author

CI follow-up for the replacement delivery: run 30110526214 passed Check, the workspace build, all three terminal-platform jobs, GitGuardian, and the Code Mode suite (55 files / 384 tests). The broad workspace Test step is red in packages/coding-agent: its agent-session-compaction assertion is the same failure already present on current main@38bd3a3cf in main run 30089381490, and list-models-fast-path additionally timed out under the PR run. This PR changes only seven packages/senpi-codemode files, so I am leaving the Draft scoped rather than mixing an unrelated current-main CI repair into the eval OOM fix.

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