Skip to content

fix(coding-agent): keep compaction progress bounded#3

Closed
minpeter wants to merge 1 commit into
fix/compaction-fallback-fsmfrom
fix/compaction-tui-stability
Closed

fix(coding-agent): keep compaction progress bounded#3
minpeter wants to merge 1 commit into
fix/compaction-fallback-fsmfrom
fix/compaction-tui-stability

Conversation

@minpeter

@minpeter minpeter commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Stacked on upstream Draft PR code-yeongyu/senpi#310.
Review this PR as the single commit on top of fix/compaction-fallback-fsm.

Summary

  • keep streamed compaction progress to one transient display row
  • preserve the active loader and useful preview text without expanding the status container
  • prevent long multiline summaries from pushing the composer and prior transcript through terminal viewport remaps

Problem

compaction_progress previously rendered up to 4,000 characters of accumulated summary text through multiline
Text inside statusContainer, immediately above the editor. As the summary streamed, every newline increased root
height, moved the composer, and pushed prior transcript rows into scrollback. In a normal terminal this looked like the
input box followed the summary upward and previous output was erased.

Fix

  • preserve the existing accumulated progress state and 4,000-character tail bound
  • normalize display whitespace only
  • render the transient preview with one-row TruncatedText
  • leave compaction generation, persistence, completion, queue transfer, and final summary rendering unchanged

Tests

  • PIN: existing single-line progress rendering passed before the assertion change
  • RED: multiline "live summary\nchunk" produced loader plus two preview rows
  • GREEN: the same event produces one loader row plus one preview row

Validation:

  • focused interactive test: 1 file, 7 tests passed
  • interactive + compaction scope: 43 files, 306 tests passed
  • full workspace: 1,661 passed, 1 skipped
  • npm run check: passed
  • coding-agent build/type validation: passed
  • git diff --check: passed

Manual QA

Browser-rendered xterm.js at 80×24:

  • RED multiline preview retained no history rows in the viewport
  • GREEN bounded preview retained history rows 04–18, loader, preview, and composer

Browser-rendered xterm.js at 50×16:

  • GREEN retained history rows 12–18, loader, truncated preview, and composer

Real source channels:

  • TUI smoke: 5/5
  • mock-loop: 38/38
  • CLI smoke: 7/7
  • all fixture PTYs and sandboxes reported cleanup; real auth remained unchanged

Review

Independent goal, hands-on QA, code quality, security, visual fidelity, and stacked/upstream-context reviewers all
returned PASS with no blockers.


Summary by cubic

Bound the streamed compaction progress preview to a single row to prevent terminal viewport jumps during compaction. Keeps the loader and a useful preview visible without pushing the editor or transcript.

  • Bug Fixes
    • Collapse whitespace and render the preview with TruncatedText; keep the 4,000‑char tail bound.
    • Do not expand statusContainer; preserve the active loader and prevent history/composer shifts.
    • Leave compaction generation/persistence unchanged; update tests to expect exactly two lines (loader + preview) for multiline progress.

Written for commit 21e1356. Summary will update on new commits.

Review in cubic

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include @crb review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: acb7682b-61ce-40e8-a818-335c50ced828

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compaction-tui-stability

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@minpeter

Copy link
Copy Markdown
Owner Author

Superseded by standalone upstream Draft PR code-yeongyu#322. The replacement is based directly on upstream main and contains only the bounded compaction progress preview fix.

@minpeter minpeter closed this Jul 24, 2026
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