Repository navigation
fix(desktop): bump @xterm/* to beta.220 for upstream WebGL atlas-merge fix - #4893
Conversation
…e fix Picks up xtermjs/xterm.js#5883 "Fix webgl rendering corruption from atlas page merges" (merged 2026-05-21 by Tyriar). The PR fixes two atlas-merge bugs that match the reported symptom in ParadevAI#3572 (and the sibling cluster ParadevAI#3527, ParadevAI#3794, ParadevAI#4601, ParadevAI#4639): texture binding stays bound to the old page's canvas after a same-index page swap during merge, so glyphs sample garbage. Maintainer Tyriar on the PR: "This has been an issue for a long time, I think it's popped up more recently due to agentic CLIs using a much wider range of character styles." Also adds a one-line VSCode-pattern (microsoft/vscode#120393) fallback inside both onContextLoss handlers: set the module-local suggestedRendererType = "dom" so subsequent terminals on the same path avoid WebGL after a context-loss event. Defense-in-depth for the rarer GPU-process-death class that bypasses the upstream atlas-merge fix. Refs ParadevAI#3572
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit d938793 on May 23, 2026 6:46pm UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR upgrades xterm dependencies to beta.220 across desktop and web applications and enhances WebGL failure recovery. When WebGL context loss occurs at runtime, terminals now persistently disable WebGL for subsequent creation by setting Changesxterm Updates and WebGL Fallback Enhancement
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
Greptile SummaryBumps all
Confidence Score: 4/5Safe to merge; the code changes are a minimal one-line addition to two parallel handlers and the dep bump is straightforward. The onContextLoss additions are correct and consistent with the pre-existing catch-block pattern in both files. The dep bump is coherent — addon-webgl intentionally staying at beta.219 while xterm core moves to beta.220 is expected given where the upstream fix landed. The only wrinkle is that packages/host-service was not updated, causing bun to install a second copy of @xterm/headless@beta.219 alongside the new beta.220, which is a workspace-consistency issue but does not affect runtime behaviour. bun.lock — the new @superset/host-service/@xterm/headless@6.1.0-beta.219 scoped entry signals that packages/host-service/package.json still pins beta.219 and may need a matching bump to clean up the duplicate install.
|
| Filename | Overview |
|---|---|
| apps/desktop/package.json | Bumps all @xterm/* packages from beta.219 to beta.220; @xterm/addon-webgl intentionally lags at beta.219 (contains the WebGL atlas-merge fix, peer-dep updated to ^6.1.0-beta.220). |
| apps/web/package.json | Aligns @xterm/addon-fit and @xterm/xterm to beta.220 to match desktop workspace — workspace consistency alignment. |
| apps/desktop/src/renderer/lib/terminal/terminal-addons.ts | Adds suggestedRendererType = "dom" to the onContextLoss handler, closing the gap between the catch-block fallback and the GPU-process-death failure mode. |
| apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts | Mirrors the same onContextLoss → suggestedRendererType = "dom" fix from terminal-addons.ts for the createTerminalInWrapper code path. |
| bun.lock | Updated hashes for all @xterm/* packages; introduces a new scoped entry @superset/host-service/@xterm/headless@6.1.0-beta.219, meaning host-service was not updated and now installs a second copy of @xterm/headless alongside beta.220. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Terminal Created] --> B{suggestedRendererType == dom?}
B -- yes --> C[Skip WebGL, use DOM renderer]
B -- no --> D[rAF: attempt WebglAddon load]
D --> E{Load succeeds?}
E -- no / catch --> F[suggestedRendererType = dom]
F --> C
E -- yes --> G[WebGL rendering active]
G --> H{onContextLoss fires?}
H -- yes --> I[dispose webglAddon]
I --> J[suggestedRendererType = dom NEW]
J --> K[terminal.refresh 0..rows-1]
K --> C
H -- no --> G
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
bun.lock:6598
**`@superset/host-service` left on `@xterm/headless@6.1.0-beta.219`**
The lockfile now contains a scoped entry `@superset/host-service/@xterm/headless@6.1.0-beta.219` that wasn't present before, meaning bun had to install a second copy because `packages/host-service/package.json` still pins beta.219 while `apps/desktop` and `apps/web` moved to beta.220. The PR description mentions aligning `apps/web` for sherif consistency but doesn't cover `host-service`. Since `@xterm/headless` is headless (no WebGL canvas), the atlas-merge bug itself won't surface there — but two installed copies of the same package add disk bloat and will likely be flagged by the sherif workspace-consistency check on the next run.
Reviews (1): Last reviewed commit: "chore(GH-3572): remove orchestration art..." | Re-trigger Greptile
|
|
||
| "@slack/web-api/eventemitter3": ["eventemitter3@5.0.4", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="], | ||
|
|
||
| "@superset/host-service/@xterm/headless": ["@xterm/headless@6.1.0-beta.219", "", {}, "sha512-k0ilgU1jmvW8L1GfR6Zo5tIFEhOZdwsNdmYKx+CkDBobxpu+rHb5O4iD/ehIlxSupGPzOvIw6+1tRJq3Ky+kZw=="], |
There was a problem hiding this comment.
@superset/host-service left on @xterm/headless@6.1.0-beta.219
The lockfile now contains a scoped entry @superset/host-service/@xterm/headless@6.1.0-beta.219 that wasn't present before, meaning bun had to install a second copy because packages/host-service/package.json still pins beta.219 while apps/desktop and apps/web moved to beta.220. The PR description mentions aligning apps/web for sherif consistency but doesn't cover host-service. Since @xterm/headless is headless (no WebGL canvas), the atlas-merge bug itself won't surface there — but two installed copies of the same package add disk bloat and will likely be flagged by the sherif workspace-consistency check on the next run.
Prompt To Fix With AI
This is a comment left during a code review.
Path: bun.lock
Line: 6598
Comment:
**`@superset/host-service` left on `@xterm/headless@6.1.0-beta.219`**
The lockfile now contains a scoped entry `@superset/host-service/@xterm/headless@6.1.0-beta.219` that wasn't present before, meaning bun had to install a second copy because `packages/host-service/package.json` still pins beta.219 while `apps/desktop` and `apps/web` moved to beta.220. The PR description mentions aligning `apps/web` for sherif consistency but doesn't cover `host-service`. Since `@xterm/headless` is headless (no WebGL canvas), the atlas-merge bug itself won't surface there — but two installed copies of the same package add disk bloat and will likely be flagged by the sherif workspace-consistency check on the next run.
How can I resolve this? If you propose a fix, please make it concise.| webglAddon.onContextLoss(() => { | ||
| webglAddon?.dispose(); | ||
| webglAddon = null; | ||
| suggestedRendererType = "dom"; |
There was a problem hiding this comment.
Why this line: flips the module-local suggestedRendererType to "dom" after a real WebGL context-loss event, so every subsequent terminal in this session skips WebGL too — not just the one that lost context. Before this addition, only the catch block at line 59 set the flag (covers "WebGL throws at construction"); the onContextLoss path disposed the broken addon but left the flag unset, so each new tab kept re-attempting WebGL after one had already failed.
Why we still need it after the @xterm/ bump:* PR #5883 fixes the dominant failure mode (atlas-page-merge corruption — silent, no onContextLoss event fires). This line covers the orthogonal failure mode where WebGL context actually is lost (driver crash, OS sleep/wake, per-document WebGL context cap hit). The two changes catch different things; both needed for full coverage.
VSCode precedent: microsoft/vscode#120393 ("fall back to dom if webgl loses context"). One-way per session — fresh app launches retry WebGL (flag is in-memory only, not persisted).
Same one-line addition is mirrored in helpers.ts:143 for the v1-terminal-cache path, which uses an independent module-local copy of suggestedRendererType.
The xterm bump (#4893) left a stale nested @superset/host-service/@xterm/headless@6.1.0-beta.219 entry while host-service's package.json declared 6.1.0-beta.220, breaking electron-builder's production dep traversal during desktop packaging.
* feat(desktop): skippable v2 onboarding + Settings re-run entry - Add a "Skip for now" button to the onboarding footer, available on every step (including the GitHub-CLI step). Calls completeOnboarding, refetches the session, then routes to /v2-workspaces — the whole flow is escapable, not just the gh-cli gate that main already removed. - Add a "Run setup again" row in Settings → Experimental that re-opens onboarding for already-onboarded users. Backed by a transient onboarding-rerun store so the layout's onboardedAt redirect makes an exception only for this explicit re-launch; not persisted, so a restored /onboarding route on next launch falls back to the redirect. - Footer aligns to the same max-w-2xl px-8 column as the step content (was max-w-[1200px] px-12), with a border-t divider. Action cluster grouped Linear-style: meta/help left (Back + icon-only Get support tooltip), flow actions right (Skip for now, Continue). * refactor(desktop): replace onboarding rerun store with route search param * chore: refresh bun.lock to drop stale host-service nested xterm/headless The xterm bump (#4893) left a stale nested @superset/host-service/@xterm/headless@6.1.0-beta.219 entry while host-service's package.json declared 6.1.0-beta.220, breaking electron-builder's production dep traversal during desktop packaging.
…e fix (ParadevAI#4893) * improvement(ParadevAIGH-3572): capture brief * improvement(ParadevAIGH-3572): scope proposal v1 * improvement(ParadevAIGH-3572): scope challenged + user pushback note * improvement(ParadevAIGH-3572): deep-research findings (PR ParadevAI#5883 + beta.220) * fix(desktop): bump @xterm/* to beta.220 for upstream WebGL atlas-merge fix Picks up xtermjs/xterm.js#5883 "Fix webgl rendering corruption from atlas page merges" (merged 2026-05-21 by Tyriar). The PR fixes two atlas-merge bugs that match the reported symptom in ParadevAI#3572 (and the sibling cluster canvas after a same-index page swap during merge, so glyphs sample garbage. Maintainer Tyriar on the PR: "This has been an issue for a long time, I think it's popped up more recently due to agentic CLIs using a much wider range of character styles." Also adds a one-line VSCode-pattern (microsoft/vscode#120393) fallback inside both onContextLoss handlers: set the module-local suggestedRendererType = "dom" so subsequent terminals on the same path avoid WebGL after a context-loss event. Defense-in-depth for the rarer GPU-process-death class that bypasses the upstream atlas-merge fix. Refs ParadevAI#3572 * improvement(ParadevAIGH-3572): bind scope to option α (upstream bump + fallback) * fix(web): align @xterm/* to beta.220 (matches desktop) * chore(ParadevAIGH-3572): remove orchestration artifacts before PR push
Summary
Picks up xtermjs/xterm.js#5883 "Fix webgl rendering corruption from atlas page merges" — merged 2026-05-21 by xterm.js maintainer Tyriar. The PR fixes two atlas-merge bugs (stale texture binding after same-index page swap; stale
texturePagein vertex buffer after mid-update merge) that produce the wrong-glyph rendering reported in #3572 and the sibling cluster (#3527, #3794, #4601, #4639).Tyriar's approval comment on PR #5883 explicitly cites our use case:
Adopting via dep bump (we are already on the beta.220 train at
beta.219):@xterm/xterm,@xterm/headless,@xterm/addon-*→6.1.0-beta.220(or0.x.0-beta.220for the addons)@xterm/addon-webgl:0.20.0-beta.218→0.20.0-beta.219(peer-dep on^6.1.0-beta.220)Also aligns
apps/webdeps to the same versions (sherif workspace consistency check).Defense-in-depth: VSCode-pattern fallback
Adds one line inside both
onContextLosshandlers (terminal-addons.ts,helpers.ts) to set the module-localsuggestedRendererType = "dom"— modeled on microsoft/vscode#120393. The catch-block on initial WebGL load already did this; the onContextLoss handler had the documented gap. Cheap belt-and-suspenders for the rarer GPU-process-death class of failure that bypasses the atlas-merge fix.Out of scope (deferred follow-ups)
Terminal.clearTextureAtlas()heal on tab-visibility-change — PR fix(desktop): preserve pane layout when removing a workspace from the sidebar #5883 should remove the need@xterm/addon-webgldep (original Strategic option from scope investigation) — moot once upstream fix is adoptedTest plan
bun run typecheck(@superset/desktop) — cleanbun run lint(repo) — clean (Biome treats warnings as errors)bun installresolvesbun.lockwith new versions; native modules rebuild cleanlytail -f, largecat), verify no glyph corruption over 15+ min; confirm WebGL canvas still active in DevToolsCloses
Notes for reviewer
minimumReleaseAge=259200may briefly require--minimum-release-age=0on a fresh local install until the package is ≥3 days old.apps/desktop/src/lib/trpc/routers/permissions.tsand other unrelated changes in the diff vs main come from commits already on main since I started this branch; they are NOT introduced by this PR.Summary by cubic
Bump
@xterm/*to beta.220 to pick up the upstream WebGL atlas-merge fix, preventing wrong-glyph rendering in the terminal. Add a DOM fallback on WebGL context loss for safer recovery. Addresses #3572 and related reports.Bug Fixes
suggestedRendererType = "dom"so new terminals fall back to DOM.Dependencies
apps/desktop:@xterm/xterm,@xterm/headless,@xterm/addon-*→6.1.0-beta.220;@xterm/addon-webgl→0.20.0-beta.219.apps/web: align@xterm/xtermand@xterm/addon-fit→6.1.0-beta.220.Written for commit d938793. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
Chores
Bug Fixes