Repository navigation
Improve PTY device error messages with localization support - #23538
Conversation
- Extract error hints to shared module for reuse across host and renderer - Change multi-line hints from space to newline separator for readability - Add localization of resource-limit hints in the renderer - Prevent duplicate issue requests when toast renders its own link - Handle legacy hint formats from older hosts
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughShared PTY-allocation and terminal-process-limit hints are now used in daemon and renderer error handling. The renderer translates current and legacy hints and preserves diagnostic text. English, Spanish, French, Japanese, Korean, and Chinese messages were added. Local shell-spawn errors use a shared issue request, which the toast removes when it displays its own issue link. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Some terminal allocation errors may display duplicate recovery guidance. The impact is limited to the error message, so this is mergeable with a focused follow-up. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new error presentation does not appear to grant access or create a new action controlled by error text. One narrow recovery risk remains: additional diagnostic lines can now affect how a failed terminal connection is classified. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, solution, testing, and compatibility impact. It omits required template sections and information, including ELI5, Why, Linked Issue, Visual Proof or an explicit N/A explanation, Review, Notes, and the testing checklist selections. Resolution Add the missing template sections. Provide the linked issue, add before/after visual proof or state N/A with a reason, complete the ELI5 and Why sections, document review and platform considerations, and mark or explain the testing checklist items. Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 10 files. (7 skipped: 7 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 960b6838-f765-4431-a5b6-9cac8364c032
📒 Files selected for processing (17)
src/main/daemon/node-pty-error-hints.test.tssrc/main/daemon/node-pty-error-hints.tssrc/main/providers/local-pty-utils.tssrc/renderer/src/components/terminal-pane/TerminalErrorToast.test.tssrc/renderer/src/components/terminal-pane/TerminalErrorToast.tsxsrc/renderer/src/components/terminal-pane/ipc-pty-connect.tssrc/renderer/src/components/terminal-pane/pty-transport-connect-spawn.test.tssrc/renderer/src/components/terminal-pane/terminal-spawn-error-display.test.tssrc/renderer/src/components/terminal-pane/terminal-spawn-error-display.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/terminal-spawn-error-copy.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — one backwards-compatibility edge case inline.
Reviewed changes
- Shared copy module — extracts the new one-line resource-limit hints, the legacy multi-line pair, and the issue-request string into
src/shared/terminal-spawn-error-copy.tsfor host and renderer. - Host hint format —
addNodePtyRecoveryHintnewline-separates the two new hints, keeps a space for other hints, and skips re-prepending when a string already carries a hint. - Renderer localization —
terminal-spawn-error-display.tsswaps the host's English hints (new and legacy) for translated copy and drops the host's plain-text issue request where the toast renders its own linked one. - IPC error detail —
ipc-pty-connect.tsusesreadIpcErrorDetailso a wrapped spawn error keeps its full multi-line hint and diagnostic instead of only the first line. - Translations — adds
ptyAllocationLimit/terminalProcessLimittoen-runtime-required.json,en.json, and the es/fr/ja/ko/zh catalogs.
The new/legacy hint matching, the $&-safe replacers, the newline separator rationale, and the i18n catalog generation all check out.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
- Extract hint-detection logic into hasPtyAllocationHint() helper - Check for both current and legacy PTY allocation hint variants - Prevents duplication when messages already contain legacy hints

Problem
PTY device and terminal process limit errors were English-only and used verbose multi-line hints. Error messages were scattered across the codebase, and the toast component could show duplicate "file an issue" links when both the host and toast tried to request one.
Solution
src/shared/terminal-spawn-error-copy.tsfor reuse across host and rendererterminal-spawn-error-display.tsto localize resource-limit hints and remove duplicate issue requests in the toastTesting
Checklist
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)