fix(term): writeInFlight RAF guard + scroll flash retro (v0.32.88)#234
Open
AgentA-asaf wants to merge 3 commits intomainfrom
Open
fix(term): writeInFlight RAF guard + scroll flash retro (v0.32.88)#234AgentA-asaf wants to merge 3 commits intomainfrom
AgentA-asaf wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
ReAgent Diagnostics
| Field | Value |
|---|---|
| ReAgent Version | 5.12.4 |
| Project Context | CLAUDE.md loaded |
| Model | claude-opus-4-6 |
| Effort | high |
| Ref Repos | Disabled |
| Merge Analysis | Clean |
| Review Time | 25.4s |
| Timestamp | 2026-03-26T01:43:11Z |
| Repository | agentmuxai/agentmux |
| PR | #234 |
Issues:
- package.json:3 - Missing version bump for code changes (no diff found for "version" field)
- frontend/app/view/term/termwrap.ts:337 - No
.catch()ondoTerminalWritepromise — if it ever rejects,writeInFlightstaystruepermanently and the terminal stops rendering
… on write rejection Without a .catch(), if doTerminalWrite() ever rejects, writeInFlight stays true permanently — blocking all future RAF writes and freezing terminal rendering. Add .catch() to reset the guard and re-arm the RAF drain loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7416762 to
5311833
Compare
There was a problem hiding this comment.
ReAgent Diagnostics
| Field | Value |
|---|---|
| ReAgent Version | 5.12.4 |
| Project Context | CLAUDE.md loaded |
| Model | claude-opus-4-6 |
| Effort | high |
| Ref Repos | Disabled |
| Merge Analysis | 1 regression(s) detected |
| Review Time | 65.6s |
| Timestamp | 2026-03-27T19:34:22Z |
| Repository | agentmuxai/agentmux |
| PR | #234 |
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates the full Win10 scroll flash investigation into one clean PR on current main (v0.32.88).
Closes: #210, #215, #227 (all superseded by this)
What's in this PR
1.
writeInFlightfix (termwrap.ts) — prevents concurrent RAF writes at high scrollback fillThe original Tier 3 fix (PR #208) had a race:
rafPendingwas cleared beforedoTerminalWriteresolved. Whenterminal.write()takes >16ms (common at 1000+ buffer lines), new data arriving during that window could schedule a second RAF and fire a concurrent write — producing the same flash the Tier 3 fix was meant to prevent.Fix:
writeInFlightflag +armRaf()helper. A new RAF only fires when bothrafPendingandwriteInFlightare false. After each write resolves,armRaf()drains any buffered data.2. RAF timing logs (
termwrap.ts) — surface regressions without greppingEvery RAF flush logs:
chunks,bytes,elapsed,bufLines. Writes >8ms emit at WARN:Tail with:
tail -f ~/.agentmux/logs/agentmux-host-v*.log | grep raf-write3. Retro doc (
docs/retros/retro-scroll-flash-win10.md) — full investigation historyCovers all three root causes, what's merged, what was tried and closed, monitoring instructions, and current status (no flash observed in v0.32.88 sessions).
Closed PRs
No merge needed yet
Flash has not been observed in recent sessions. This PR should sit open for monitoring before merging — the retro doc documents what to watch for.
Test plan
[raf-write] SLOWlines at high bufLines🤖 Generated with Claude Code