gemini-cli - 💡(How to fix) Fix Missing projectHash makes a real JSONL session unlistable [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#27275Fetched 2026-05-20 03:59:37
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Root Cause

The JSONL loader requires both sessionId and projectHash. If sessionId exists but projectHash is missing, it falls back to the legacy parser. The legacy parser tries to parse the entire file with JSON.parse(fileContent). But JSONL is multiple JSON records separated by newlines, not one JSON document. So the fallback fails and returns null. A session with real messages can become invisible because one metadata field is missing.

Code Example

if (!metadata.sessionId || !metadata.projectHash) {
    return await parseLegacyRecordFallback(filePath, options);
  }

  packages/core/src/services/chatRecordingService.ts:994

  const fileContent = await fs.promises.readFile(filePath, 'utf8');
  const parsed = JSON.parse(fileContent) as unknown;

---

╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                                                                                 │
About Gemini CLI│                                                                                                                                                                                                                                                                                 │
CLI Version                                                                                    0.42.0Git Commit                                                                                     68e2196d5                                                                                                                                                                        │
Model                                                                                          Auto (Gemini 3)Sandbox                                                                                        no sandbox                                                                                                                                                                       │
OS                                                                                             linux                                                                                                                                                                            │
Auth Method                                                                                    Signed in with GoogleTier                                                                                           Gemini Code Assist in Google One AI Pro│                                                                                                                                                                                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RAW_BUFFERClick to expand / collapse

What happened?

The JSONL loader requires both sessionId and projectHash. If sessionId exists but projectHash is missing, it falls back to the legacy parser. The legacy parser tries to parse the entire file with JSON.parse(fileContent). But JSONL is multiple JSON records separated by newlines, not one JSON document. So the fallback fails and returns null. A session with real messages can become invisible because one metadata field is missing.

packages/core/src/services/chatRecordingService.ts:237

  if (!metadata.sessionId || !metadata.projectHash) {
    return await parseLegacyRecordFallback(filePath, options);
  }

  packages/core/src/services/chatRecordingService.ts:994

  const fileContent = await fs.promises.readFile(filePath, 'utf8');
  const parsed = JSON.parse(fileContent) as unknown;

What did you expect to happen?

If a JSONL file has a valid sessionId and real user/gemini messages, it should still be recoverable. projectHash is useful metadata, but it should not be required to decide whether the session exists. The loader could infer the project from the containing directory or tolerate the missing value. At minimum, it should not fall into a parser that is guaranteed to fail for normal JSONL.

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.


╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                                                                                 │
│ About Gemini CLI                                                                                                                                                                                                                                                                │
│                                                                                                                                                                                                                                                                                 │
│ CLI Version                                                                                    0.42.0                                                                                                                                                                           │
│ Git Commit                                                                                     68e2196d5                                                                                                                                                                        │
│ Model                                                                                          Auto (Gemini 3)                                                                                                                                                                  │
│ Sandbox                                                                                        no sandbox                                                                                                                                                                       │
│ OS                                                                                             linux                                                                                                                                                                            │
│ Auth Method                                                                                    Signed in with Google                                                                                                                             │
│ Tier                                                                                           Gemini Code Assist in Google One AI Pro                                                                                                                                          │
│                                                                                                                                                                                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
</details>

Login information

Signed in with Google

Anything else we need to know?

No response

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