google-gemini / google-gemini/gemini-cli
gemini cli keeps crashing
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
[ACTION REQUIRED] 📎 PLEASE ATTACH THE EXPORTED CHAT HISTORY JSON FILE TO THIS ISSUE IF YOU FEEL COMFORTABLE SHARING IT.
### What did you expect to happen?
I am working on a legacy code base and I was hoping to use gemini as investigation helper but it keeps crashing .
### Client information
* **CLI Version:** 0.57.0
* **Git Commit:** 6b0ae9a6c
* **Session ID:** bf2d58e7-92e5-4061-888b-6e7e418a2f03
* **Operating System:** linux v22.22.2
* **Sandbox Environment:** no sandbox
* **Model Version:** auto
* **Auth Type:** oauth-personal
* **Memory Usage:** 300.0 MB
* **Terminal Name:** Unknown
* **Terminal Background:** #0c0c0c
* **Kitty Keyboard Protocol:** Unsupported
### Login information
_No response_
### Anything else we need to know?
Summary: Gemini CLI (v0.56.0) repeatedly shows internal instability across multiple sessions — startup warnings, empty API responses, and now context graph corruption.
Environment: WSL2 (Ubuntu), Windows 11 host, Node v22.22.2, gemini-cli v0.56.0, auth via oauth-personal.
Issues observed, across several separate sessions:
Startup phase collision (recurring on nearly every launch):
⚠ [STARTUP] Cannot start phase 'load_builtin_commands': phase is already active. Call end() before starting again.
Empty API response mid-session (non-transient — retry did not immediately resolve):
✕ The model returned an empty response with no text or thoughts. This may be a transient API issue; please try again.
Context graph corruption after using --resume:
⚠ [InvariantCheck][RenderHistory] Detected 18 duplicate nodes by ID: resp_read_file__call_49613, resp_grep_search__call_77516, [...]
⚠ [HistoryHardener] Missing thought signature on first function call in model turn. Injecting synthetic signature. (x3)
This appeared after reconstructing history from 126 nodes → 79 turns, then a second reconstruction pass (1 node → 1 turn) triggered duplicate-node detection. Seems related to resuming a previous session (gemini --resume ) whose history overlapped with new turns.
Reproduction pattern: issue 3 seems most likely to appear after resuming a long-running session (79+ turns) rather than starting fresh. Issues 1 and 2 appear intermittently regardless of session freshness.
Impact: loss of confidence in session reliability — had to manually verify several agent-reported "completed and verified" claims (MCP server config, checkpointing behavior) because outputs were inconsistent with what the CLI actually reported via direct commands (gemini mcp list, ls, git diff).
Question: is context graph deduplication expected to self-heal, or does accumulated --resume history require manual cleanup (e.g., clearing ~/.gemini/tmp//chats/)? Would appreciate guidance on whether long --resume chains are a known risk factor.
Contributor guide
Research direction
Start by reproducing the reported failures with `gemini --resume `, focusing on the startup phase warning, empty response, and duplicate nodes during history reconstruction. Inspect the resumed chat data under `~/.gemini/tmp//chats/` and compare behavior across fresh and long-running sessions; done means the relevant failure is isolated and the CLI no longer crashes or corrupts resumed history.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100