Skip to content

perf(terminal): coalesce per-frame PTY chunks into one xterm write#179

Merged
kjgbot merged 3 commits into
mainfrom
perf/coalesce-pty-drain
Jun 9, 2026
Merged

perf(terminal): coalesce per-frame PTY chunks into one xterm write#179
kjgbot merged 3 commits into
mainfrom
perf/coalesce-pty-drain

Conversation

@kjgbot

@kjgbot kjgbot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Typing felt laggy under heavy TUI redraw streaming. PR #176's fidelity harness measured the symptom: 762/1000 markers rendered after a 10s settle — xterm's term.write() drain couldn't keep up and the main thread saturated.

Root cause

The rAF flush in pty-buffer-store already hands writeChunks the full array of chunks staged for the frame, but writeChunks looped and wrote each chunk individually. Per chunk that drives:

  1. a full xterm VT-parser pass, and
  2. a second full parse into the predictive-echo headless model, plus
  3. a promise tick

— N times per frame. Under a redraw burst (many small chunks/frame) that per-chunk fan-out is the drain hot path.

Fix

xterm's parser is a streaming state machine, so write(a)+write(b) ≡ write(a+b) for both the live terminal and the predictive-echo model. Coalesce the frame's chunks into a single write → N parser passes + N model writes + N ticks collapse to one. Byte content and order are unchanged (one-write-per-byte invariant holds). Per-chunk recordChunkEchoed accounting is preserved (it consumes one pending keystroke per call, so it stays in the loop).

Test / gates

  • New terminal-runtime-registry.dom.test.ts regression: a 3-chunk frame lands exactly one ordered write. Non-vacuous — red without the fix ("expected 3 to be 1"), green with it.
  • Full vitest 237/237, tsc --noEmit clean, build:web succeeds.

Scope / follow-ups

  • This is the provably-equivalent half of the drain finding. A second lever — skipping the predictive-echo model write when there are no in-flight predictions — is deliberately not included: skipping it would let the model's shadow screen drift from the real terminal and cause mispredictions. That needs engine support and is left as a separate, measured change.
  • A redraw-style drain harness (cursor-addressing CSI sequences, not unique markers) to put a before/after number on this is staged on wip/lag-redraw-drain.

🤖 Generated with Claude Code

Review caveat — predictive-echo branch (added on self-review)

The real-parser equivalence test covers the confirmed/live render (the liveTerm.write path, predictions absent). It does not unit-test the predictiveEcho.onServerOutput path under active typing, where per-chunk vs coalesced differ in intermediate writes: per-chunk runs erasePredictionRegion + reconcile once per chunk, coalesced once per frame.

By reasoning (see processServerChunk): the confirmed model converges (model.write(A)+model.write(B) ≡ model.write(A+B)), the survivor filter is monotonic in cursor column, and renderPredictions draws the same final survivors — so the final screen + overlay converge. The dominant lag case (server redraw burst, user not mid-keystroke) has hadPredictions=false, so reconciliation is skipped entirely. Coalescing only batches chunks already staged within one animation frame.

Net: authoritative content is provably identical; the optimistic-echo overlay converges and is self-correcting, but that convergence is argued, not yet covered by a test. A follow-up engine-level test (type + simultaneous redraw burst, assert overlay state matches per-chunk) would close it.

The rAF flush already hands writeChunks the full array of chunks staged for
the frame, but writeChunks looped and wrote each chunk individually. Under
heavy TUI redraw streaming (Claude Code / Ink) that per-chunk fan-out is the
drain hot path: each chunk drives a full xterm VT-parser pass AND a second
full parse into the predictive-echo headless model, plus a promise tick — N
times per frame. The renderer couldn't keep up and typing lagged.

xterm's parser is a streaming state machine, so write(a)+write(b) ≡
write(a+b) for both the live terminal and the predictive-echo model.
Coalescing the frame's chunks into a single write collapses N parser passes
+ N model writes + N ticks into one. Byte content and order are unchanged,
so the one-write-per-byte invariant holds. Per-chunk recordChunkEchoed
accounting is preserved (it consumes one pending keystroke per call).

Regression test asserts a 3-chunk frame lands exactly one ordered write
(red: 3, green: 1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@agent-relay-code[bot], we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 30 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 43cf5b98-0e04-40df-a8d6-eb4fbaa5c9e4

📥 Commits

Reviewing files that changed from the base of the PR and between f1ebaf6 and faf0cb4.

📒 Files selected for processing (1)
  • src/renderer/src/lib/terminal-runtime-registry.dom.test.ts
📝 Walkthrough

Walkthrough

Terminal output pipeline now coalesces multiple PTY chunks from a single drain batch into one write operation before forwarding to the predictive-echo engine and live xterm terminal. A new test validates the coalescing behavior. The agent-store stress test timeout was increased to prevent CI flakiness under large workloads.

Changes

PTY Output Pipeline and Test Stability

Layer / File(s) Summary
PTY chunk coalescing and validation
src/renderer/src/lib/terminal-runtime-registry.ts, src/renderer/src/lib/terminal-runtime-registry.dom.test.ts
Batch writer concatenates all chunks from a single drain cycle into one combined string before sending to predictive-echo and live xterm terminal. Individual chunks continue to be recorded in the typing trace. A new test asserts that three sequentially appended chunks result in exactly one terminal write with the concatenated payload.
Stress test timeout increase
src/renderer/src/stores/agent-store.stress.test.ts
Agent-store stress test timeout raised from 25 seconds to 60 seconds to avoid flakiness during large-scale relay and reconcile operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AgentWorkforce/pear#158: Refactors PTY buffer and runtime plumbing (e.g., pty-buffer-store tail-only batching) that feeds the batched drain behavior implemented in this PR.

Poem

🐰 Chunks of data flow like carrots down the line,
Coalesced as one, in batch they align,
No more fragmented writes to the terminal screen—
One grand chorus of output, the cleanest we've seen!
hops happily 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main change: coalescing per-frame PTY chunks into a single xterm write to improve terminal rendering performance under heavy redraw streaming.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the problem, root cause, fix, testing approach, and scope considerations for the PTY chunk coalescing optimization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/coalesce-pty-drain

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 and usage tips.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #179 against the current checkout. I found no validated breakage and made no code changes.

Validation passed:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts
  • npx tsc --noEmit
  • npm run verify:mcp-resources-drift
  • npm test
  • npx vitest run src/main/broker.test.ts
  • npm run build

Remote status checked via GitHub API: PR is mergeable=true, mergeable_state=clean; checks and packaged-mcp-smoke completed successfully. Cubic’s check completed neutral because its review line limit was reached.

Addressed comments

  • codeant-ai[bot]: Raised free trial PR review limit reached; no code finding to validate or fix.
  • gemini-code-assist[bot]: Raised daily quota limit reached; no code finding to validate or fix.
  • coderabbitai[bot]: Raised PR review rate/usage limit reached and did not start a review; no code finding to validate or fix.
  • cubic-dev-ai: Check output raised monthly review limit reached; no code finding to validate or fix.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

No validated breakage found in the PR changes, so I made no source edits. The PTY chunk coalescing keeps per-chunk typing trace accounting, preserves ordered byte delivery, and uses a single xterm/predictive-echo write per drained frame as intended.

Validation run locally:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts passed: 16 tests
  • npx vitest run passed: 237 tests
  • npx tsc --noEmit passed
  • npm test passed: 104 main tests
  • npm run verify:mcp-resources-drift passed
  • npm run build passed

Remote PR state observed via API: mergeable=true, mergeable_state=clean; GitHub Actions checks and packaged-mcp-smoke completed successfully. Cubic completed neutral because its review limit was reached, so I’m not ending with READY.

Addressed comments

  • codeant-ai[bot]: Raised free trial PR review limit reached; no code finding to validate or fix.
  • gemini-code-assist[bot]: Raised daily quota limit reached; no code finding to validate or fix.
  • coderabbitai[bot]: Raised PR review rate/usage limit reached and did not start a review; no code finding to validate or fix.
  • cubic-dev-ai: Check output raised monthly review limit reached; no code finding to validate or fix.
  • agent-relay-code[bot]: Prior review-only status comment reported no file changes and no findings; stale informational comment, no code finding to validate or fix.

@codeant-ai

codeant-ai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #179 and made one test reliability fix outside the PR diff after reproducing a local full-suite failure.

Changed agent-store.stress.test.ts: increased the heavy stress test timeout from 25_000 to 60_000. The test workload/assertions are unchanged; it was timing out reproducibly at ~28s in this runner and then passed at ~25s after the timeout adjustment.

Validation passed:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts passed: 16 tests
  • npx vitest run src/renderer/src/stores/agent-store.stress.test.ts passed: 7 tests
  • npx vitest run passed: 237 tests
  • npx tsc --noEmit passed
  • npm test passed: 104 tests
  • npm run verify:mcp-resources-drift passed
  • npm run build passed

GitHub API currently reports the PR as mergeable=true, mergeable_state=clean; workflow checks checks and packaged-mcp-smoke are successful, while cubic · AI code reviewer is neutral.

Addressed comments

  • codeant-ai[bot]: Raised free trial PR review limit reached; no code finding to validate or fix.
  • gemini-code-assist[bot]: Raised daily quota limit reached; no code finding to validate or fix.
  • coderabbitai[bot]: Raised PR review rate/usage limit reached and did not start a review; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4656849585: Prior review-only status comment reported no findings and no edits; stale informational comment, no code finding to validate or fix.
  • agent-relay-code[bot] comment 4656929204: Prior review-only status comment reported no findings and noted Cubic’s neutral limit status; stale informational comment, no code finding to validate or fix.
  • cubic-dev-ai check: Raised monthly/review limit via neutral check status; no code finding to validate or fix.

Not ending with READY because the AI reviewer check is neutral rather than passing.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/renderer/src/lib/terminal-runtime-registry.dom.test.ts`:
- Around line 171-203: Extend the test in terminal-runtime-registry.dom.test.ts
that uses registry.acquireTerminalRuntime, ptyBuffer.appendPtyChunk and
ptyBuffer.flushPtyChunksNow to also assert duplicate-chunk preservation and no
replay: after the initial happy-path drain (aaa+bbb+ccc) add a case where you
append duplicate chunks (e.g., 'dup','dup') before a flush and assert
term.__writes records a single combined write preserving both duplicates, then
call ptyBuffer.flushPtyChunksNow(runtime.key) again with no intervening append
and assert term.__writes did NOT increase (no replay); keep using the same
runtime and clean up with registry.disposeTerminalRuntime(runtime.key).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10de8a40-5931-42bd-96b1-03c061874ed0

📥 Commits

Reviewing files that changed from the base of the PR and between 1a5bd5d and f1ebaf6.

📒 Files selected for processing (3)
  • src/renderer/src/lib/terminal-runtime-registry.dom.test.ts
  • src/renderer/src/lib/terminal-runtime-registry.ts
  • src/renderer/src/stores/agent-store.stress.test.ts

Comment thread src/renderer/src/lib/terminal-runtime-registry.dom.test.ts
@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #179 against the current checkout. I found no additional validated breakage, so I made no source edits in this run.

Local validation passed:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts: 16 tests
  • npx vitest run src/renderer/src/stores/agent-store.stress.test.ts: 7 tests
  • npx vitest run: 237 tests
  • npx tsc --noEmit
  • npm test: 104 tests
  • npm run verify:mcp-resources-drift
  • npm run build

Remote API state observed at the end: PR is mergeable=true, mergeable_state=clean; checks and packaged-mcp-smoke are successful; CodeRabbit status is successful; cubic · AI code reviewer is completed with neutral, so I am not ending with READY.

Addressed comments

  • codeant-ai[bot] #4656808721: Raised free trial PR review limit reached; no code finding to validate or fix.
  • gemini-code-assist[bot] #4656808742: Raised daily quota limit reached; no code finding to validate or fix.
  • coderabbitai[bot] #4656809332: Posted walkthrough/summary after review completion; no actionable code finding to validate or fix.
  • agent-relay-code[bot] #4656849585: Prior review-only status reported no findings; stale informational comment, no code finding to validate or fix.
  • agent-relay-code[bot] #4656929204: Prior review-only status reported no findings; stale informational comment, no code finding to validate or fix.
  • codeant-ai[bot] #4657052063: Raised free trial PR review limit reached; no code finding to validate or fix.
  • agent-relay-code[bot] #4657052704: Raised and applied the stress-test timeout reliability fix; already present in current checkout at src/renderer/src/stores/agent-store.stress.test.ts:154.
  • cubic-dev-ai check: Completed neutral due to review limits; no code finding to validate or fix.

@codeant-ai

codeant-ai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #179 and made one focused test fix.

Changed terminal-runtime-registry.dom.test.ts to cover duplicate PTY chunks being preserved in the coalesced write and an empty follow-up drain not replaying prior output.

Validation passed locally:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/stores/agent-store.stress.test.ts
  • npm exec tsc -- --noEmit
  • npx vitest run
  • npm test
  • npm run verify:mcp-resources-drift
  • npm run build

Addressed comments

  • codeant-ai[bot] comment 4656808721: Raised free trial PR review limit reached; no code finding to validate or fix.
  • gemini-code-assist[bot] comment 4656808742: Raised daily quota limit reached; no code finding to validate or fix.
  • coderabbitai[bot] comment 4656809332: Walkthrough plus docstring coverage advisory; no repo CI failure or PR-specific docstring breakage to fix.
  • agent-relay-code[bot] comment 4656849585: Prior review-only status comment reported no findings; stale informational comment, no code finding to fix.
  • agent-relay-code[bot] comment 4656929204: Prior review-only status comment reported no findings; stale informational comment, no code finding to fix.
  • codeant-ai[bot] comment 4657052063: Raised free trial PR review limit reached; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657052704: Prior status comment about the stress timeout fix; already present in agent-store.stress.test.ts.
  • coderabbitai[bot] inline comment 3378581762: Requested duplicate/replay coverage for PTY coalescing; fixed in terminal-runtime-registry.dom.test.ts.
  • coderabbitai[bot] review 4456102332: Summarized the same actionable duplicate/replay request; fixed in terminal-runtime-registry.dom.test.ts.

Not ending with READY because this run leaves a new local edit for the harness to commit, so post-edit remote CI has not completed yet.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed the current checkout against PR #179. I found no additional validated breakage and made no new source edits in this run.

Local validation passed:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/stores/agent-store.stress.test.ts — 23 tests
  • npm exec tsc -- --noEmit

Remote state observed: PR is mergeable=true, mergeable_state=clean; GitHub Actions checks reported success, and the cubic reviewer check completed neutral, so I am not ending with READY.

Addressed comments

  • codeant-ai[bot] comment 4656808721: Free trial review limit notice; no code finding to validate or fix.
  • gemini-code-assist[bot] comment 4656808742: Daily quota limit notice; no code finding to validate or fix.
  • coderabbitai[bot] comment 4656809332: Walkthrough plus duplicate/replay guidance; current checkout already has duplicate preservation and no-replay coverage in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4656849585: Prior review-only status reported no findings; stale informational comment, no code finding to fix.
  • agent-relay-code[bot] comment 4656929204: Prior review-only status reported no findings; stale informational comment, no code finding to fix.
  • codeant-ai[bot] comment 4657052063: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657052704: Stress-test timeout reliability fix is already present in src/renderer/src/stores/agent-store.stress.test.ts:154.
  • agent-relay-code[bot] comment 4657140742: Prior review summary reported no additional breakage; stale informational comment, no code finding to fix.
  • codeant-ai[bot] comment 4657155038: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657155116: Prior summary of the duplicate/replay test fix; already present in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] inline comment 3378581762: Requested duplicate-chunk preservation and no replay coverage; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] review 4456102332: Summarized the same duplicate/replay request; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #179 against the current checkout. I found no additional validated breakage and made no source edits in this run; the actionable CodeRabbit request is already present in the checked-out code.

Local validation passed:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/stores/agent-store.stress.test.ts
  • npm exec tsc -- --noEmit
  • npm test
  • npx vitest run
  • npm run verify:mcp-resources-drift
  • npm run build

Addressed comments

  • codeant-ai[bot] comment 4656808721: Raised free trial PR review limit reached; no code finding to validate or fix.
  • gemini-code-assist[bot] comment 4656808742: Raised daily quota limit reached; no code finding to validate or fix.
  • coderabbitai[bot] comment 4656809332: Walkthrough plus docstring coverage advisory; no PR-specific code finding to fix.
  • coderabbitai[bot] inline comment 3378581762: Requested duplicate/replay coverage for PTY coalescing; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] review 4456102332: Summarized the same duplicate/replay request; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4656849585: Prior status comment reported no findings; stale informational comment, no code finding to fix.
  • agent-relay-code[bot] comment 4656929204: Prior status comment reported no findings; stale informational comment, no code finding to fix.
  • codeant-ai[bot] comment 4657052063: Raised free trial PR review limit reached; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657052704: Raised/applied the stress-test timeout reliability fix; already present in src/renderer/src/stores/agent-store.stress.test.ts:154.
  • agent-relay-code[bot] comment 4657140742: Prior validation/status summary; no code finding to validate or fix.
  • codeant-ai[bot] comment 4657155038: Raised free trial PR review limit reached; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657155116: Prior status summary of the duplicate/replay test fix; already present in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • cubic-dev-ai check: Reported neutral/review-limit status in prior context; no code finding to validate or fix.

Not ending with READY because I did not verify current remote CI/mergeability state from GitHub checks in this run.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #179 against the current checkout. I found no additional validated breakage and made no source edits; the actionable duplicate/replay coverage requested by CodeRabbit is already present at src/renderer/src/lib/terminal-runtime-registry.dom.test.ts.

Validation passed locally:

  • ./node_modules/.bin/vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/stores/agent-store.stress.test.ts — 23 tests
  • npm exec tsc -- --noEmit
  • ./node_modules/.bin/vitest run — 237 tests
  • npm test — 104 tests
  • npm run verify:mcp-resources-drift
  • npm run build

Remote status I could verify through the connector only reported CodeRabbit: success; I could not verify all current required GitHub check runs and mergeability from the available API, so I am not ending with READY.

Addressed comments

  • codeant-ai[bot] comment 4656808721: Free trial review limit notice; no code finding to validate or fix.
  • gemini-code-assist[bot] comment 4656808742: Daily quota limit notice; no code finding to validate or fix.
  • coderabbitai[bot] comment 4656809332: Walkthrough plus docstring coverage advisory; no PR-specific code finding to fix.
  • coderabbitai[bot] inline comment 3378581762: Requested duplicate/replay coverage for PTY coalescing; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] review 4456102332: Summarized the same duplicate/replay request; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4656849585: Prior status comment reported no findings; stale informational comment, no code finding to fix.
  • agent-relay-code[bot] comment 4656929204: Prior status comment reported no findings; stale informational comment, no code finding to fix.
  • codeant-ai[bot] comment 4657052063: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657052704: Stress-test timeout fix is already present in src/renderer/src/stores/agent-store.stress.test.ts:154.
  • agent-relay-code[bot] comment 4657140742: Prior validation/status summary; no code finding to validate or fix.
  • codeant-ai[bot] comment 4657155038: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657155116: Prior summary of the duplicate/replay test fix; already present in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4657217300: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657222993: Prior review-only summary; no additional code finding to validate or fix.
  • cubic-dev-ai check: Reported neutral/review-limit status in prior PR context; no code finding to validate or fix.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed the PR diff and traced the touched runtime, PTY buffer, predictive echo interface, and adjacent tests. I did not find a reproducible breakage in the current checkout, so I did not make code edits.

Addressed comments

  • No bot or reviewer comments were present in .workforce/context.json or any other .workforce artifact, so there were no external review threads to address.

Verification run:

  • npm ci
  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts --config vitest.config.mjs
  • npx vitest run src/renderer/src/stores/agent-store.stress.test.ts --config vitest.config.mjs
  • npx vitest run src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/hooks/use-terminal.dom.test.ts --config vitest.config.mjs
  • npx tsc --noEmit

I cannot claim PR CI or GitHub mergeability from this sandbox, so I’m not marking this READY.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #179 against the checked-out diff and current code. I did not find validated breakage requiring edits; the actionable duplicate/replay coverage requested on the PR is already present in the current checkout.

Local validation passed:

  • npm ci
  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/stores/agent-store.stress.test.ts --config vitest.config.mjs — 23 tests passed
  • npx tsc --noEmit

Remote status available through the connector only reported CodeRabbit: success; I could not verify all required GitHub check runs or mergeability from the available API, so I am not ending with READY.

Addressed comments

  • codeant-ai[bot] comment 4656808721: Free trial PR review limit notice; no code finding to validate or fix.
  • gemini-code-assist[bot] comment 4656808742: Daily quota limit notice; no code finding to validate or fix.
  • coderabbitai[bot] comment 4656809332: Walkthrough plus docstring coverage warning; no PR-specific code finding to fix, and the duplicate/replay guidance is already covered in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] inline comment 3378581762: Requested duplicate/replay coverage for PTY coalescing; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] review 4456102332: Summarized the same duplicate/replay request; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4656849585: Prior review-only status reported no findings; stale informational comment, no code finding to fix.
  • agent-relay-code[bot] comment 4656929204: Prior review-only status reported no findings; stale informational comment, no code finding to fix.
  • codeant-ai[bot] comment 4657052063: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657052704: Stress-test timeout reliability fix is already present in src/renderer/src/stores/agent-store.stress.test.ts:154.
  • agent-relay-code[bot] comment 4657140742: Prior validation/status summary; no code finding to validate or fix.
  • codeant-ai[bot] comment 4657155038: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657155116: Prior summary of the duplicate/replay test fix; already present in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4657217300: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657222993: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657291186: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657315386: Prior review-only summary; no additional code finding to validate or fix.
  • cubic-dev-ai check: Reported neutral/review-limit status in prior PR context; no code finding to validate or fix.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #179 against the current checkout. I found no additional reproducible breakage and made no source edits in this run.

Local validation passed:

  • npx vitest run src/renderer/src/lib/terminal-runtime-registry.dom.test.ts src/renderer/src/stores/pty-buffer-store.test.ts src/renderer/src/stores/agent-store.stress.test.ts --config vitest.config.mjs — 23 tests passed
  • npx tsc --noEmit

Remote API state observed for head faf0cb4: mergeable clean; GitHub Actions checks and packaged-mcp-smoke completed successfully; CodeRabbit status success; cubic reviewer completed neutral due quota.

Addressed comments

  • codeant-ai[bot] comment 4656808721: Free trial review limit notice; no code finding to validate or fix.
  • gemini-code-assist[bot] comment 4656808742: Daily quota notice; no code finding to validate or fix.
  • coderabbitai[bot] comment 4656809332: Walkthrough plus docstring coverage advisory; no PR-specific code finding to fix.
  • coderabbitai[bot] inline comment 3378581762: Requested duplicate/replay coverage for PTY coalescing; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • coderabbitai[bot] review 4456102332: Summarized the same duplicate/replay request; already fixed in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4656849585: Prior review-only status; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4656929204: Prior review-only status; no code finding to validate or fix.
  • codeant-ai[bot] comment 4657052063: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657052704: Stress-test timeout reliability fix already present in src/renderer/src/stores/agent-store.stress.test.ts:154.
  • agent-relay-code[bot] comment 4657140742: Prior validation/status summary; no code finding to validate or fix.
  • codeant-ai[bot] comment 4657155038: Free trial review limit notice; no code finding to validate or fix.
  • agent-relay-code[bot] comment 4657155116: Prior duplicate/replay test-fix summary; already present in src/renderer/src/lib/terminal-runtime-registry.dom.test.ts:201.
  • agent-relay-code[bot] comment 4657217300: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657222993: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657291186: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657315386: Prior review-only summary; no additional code finding to validate or fix.
  • agent-relay-code[bot] comment 4657369074: Prior review-only summary; no additional code finding to validate or fix.
  • cubic-dev-ai check: Neutral quota/line-limit status; no code finding to validate or fix.

@kjgbot kjgbot merged commit 0ddaa42 into main Jun 9, 2026
4 checks passed
@kjgbot kjgbot deleted the perf/coalesce-pty-drain branch June 9, 2026 08:18
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