gemini-cli - 💡(How to fix) Fix Error renderNodeToOutput makes CLI unusable after a single Edit file approval [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25483Fetched 2026-04-16 07:05:54
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Error Message

Debug Console (F12 to close)


│ ℹ Detected terminal background color: #000000

│ ℹ Detected terminal name: VTE(8203)

│ ℹ Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.

│ ⚠ Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.
│ ℹ Authenticated via "gemini-api-key".
│ ⚠ [STARTUP] Phase 'load_builtin_commands' was started but never ended. Skipping metrics.
│ ⚠ Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.
│ ✖ =========================================
│ This is an unexpected error. Please file a bug report using the /bug tool. │ CRITICAL: Unhandled Promise Rejection!
│ =========================================
│ Reason: RangeError: Invalid count value: -1
│ Stack trace:
│ RangeError: Invalid count value: -1
│ at String.repeat (<anonymous>)
│ at renderBorder (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37307:89)
│ at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37360:5)
│ at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)
│ at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)
│ at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)
│ at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)
│ at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)
│ at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)
│ at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) (x63)

Code Example

Debug Console (F12 to close)               
│ ℹ  Detected terminal background color: #000000                               
│ ℹ  Detected terminal name: VTE(8203)       
│ ℹ  Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.     
          
│ ⚠  Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.     
Authenticated via "gemini-api-key".     
[STARTUP] Phase 'load_builtin_commands' was started but never ended. Skipping metrics.                              
Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.     
=========================================                                 
This is an unexpected error. Please file a bug report using the /bug tool.
    CRITICAL: Unhandled Promise Rejection!  
=========================================                                 
Reason: RangeError: Invalid count value: -1                               
Stack trace:                            
RangeError: Invalid count value: -1     
│        at String.repeat (<anonymous>)      
│        at renderBorder (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37307:89)           
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37360:5)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)      
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)      
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)      
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) (x63)
RAW_BUFFERClick to expand / collapse

What happened?

Beginning: I opened Gemini CLI, gave it instructions to edit some Python files in a repo, it asked me 3 questions to clarify things (3.1-pro). After the answers, it wants to start making edits.

Problem starts: It asks me for permission to edit a file, offers the usual options (accept once, during session, etc.) I choose both accept once, and in a new session chose accept all during session, and in both cases it failed.

Failure: console starts blinking really fast, between output of Debug messages, also edit in progress, next question, etc. Too fast to notice anything except the red lines with the errors which blink and go with the rest of the messages alternatively.

npm --version 11.12.1

node --version v25.9.0

After stopping and trying to /resume, I could get a log:

Debug Console (F12 to close)               
│ ℹ  Detected terminal background color: #000000                               
│ ℹ  Detected terminal name: VTE(8203)       
│ ℹ  Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.     
│ ⚠  Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.     
│ ℹ  Authenticated via "gemini-api-key".     
│ ⚠  [STARTUP] Phase 'load_builtin_commands' was started but never ended. Skipping metrics.                              
│ ⚠  Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.     
│ ✖  =========================================                                 
│    This is an unexpected error. Please file a bug report using the /bug tool.
│    CRITICAL: Unhandled Promise Rejection!  
│    =========================================                                 
│    Reason: RangeError: Invalid count value: -1                               
│    Stack trace:                            
│    RangeError: Invalid count value: -1     
│        at String.repeat (<anonymous>)      
│        at renderBorder (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37307:89)           
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37360:5)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)      
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)      
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5)      
│        at handleContainerNode (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9)     
│        at renderNodeToOutput (file:///home/alfonso/.nvm/versions/node/v25.9.0/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) (x63)

What did you expect to happen?

The usual, I approve an edit, it finishes, and asks for the next edit. If I approve all edits in session, it edits a few files without asking in the repo during the session, and then tells me what it did.

Client information

  • CLI Version: 0.38.1
  • Git Commit: 7f5580034
  • Session ID: e861ff58-cf9b-4728-af8c-baccde8dcdfb
  • Operating System: linux v25.9.0
  • Sandbox Environment: no sandbox
  • Mdel Version: gemini-3.1-pro-preview-customtools
  • Auth Type: gemini-api-key
  • Memory Usage: 298.2 MB
  • Terminal Name: VTE(8203)
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Unsupported

Login information

API key

Anything else we need to know?

No response

extent analysis

TL;DR

The issue is likely caused by an unhandled promise rejection in the Gemini CLI, resulting in a RangeError: Invalid count value: -1 error, and a potential workaround is to try a different terminal or update the CLI version.

Guidance

  • The error message indicates a problem with the renderBorder function, which is called repeatedly, causing the console to blink rapidly. This suggests a rendering issue.
  • The fact that the error occurs when trying to edit files and the console output is rapid and interleaved with debug messages and errors, suggests a potential issue with the terminal or the rendering of the output.
  • Trying a different terminal or updating the Gemini CLI version might help resolve the issue.
  • The provided log suggests that the renderNodeToOutput function is called multiple times, which could be related to the rendering issue.

Example

No code snippet is provided as the issue seems to be related to the Gemini CLI and its rendering, rather than a specific code issue.

Notes

The issue might be specific to the combination of the Gemini CLI version (0.38.1), Node version (v25.9.0), and the terminal used (VTE(8203)). Further investigation or debugging might be necessary to determine the root cause.

Recommendation

Apply workaround: Try a different terminal or update the Gemini CLI version to see if the issue persists. This might help resolve the rendering issue and prevent the unhandled promise rejection.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING