Skip to content

[Bug] session_index.jsonl loses newline between entries, causing session.not_found on resume #1925

Description

@SunshineR04

Bug Report

Summary

session_index.jsonl can end up with two JSON objects concatenated on the same line (missing newline separator), which causes kimi --session <id> to fail with [session.not_found] even when the session directory exists and is intact.

Environment

  • kimi-code version: v0.27.0
  • Platform: Windows x64
  • Node version: v24.15.0

Steps to Reproduce

  1. Create multiple sessions in the same working directory over several kimi-code launches.
  2. At some point, the index write loses the newline separator between two entries.
  3. Attempt to resume the earlier session by ID: kimi --session <id>.
  4. Error: Failed to resume session <id>: [session.not_found]

Root Cause

session_index.jsonl had two JSON objects on the same line without a newline separator.

When the CLI reads the index line-by-line, the first line fails to parse, so the session entry becomes unreadable.

Workaround

Manually split the concatenated entry onto its own line in ~/.kimi-code/session_index.jsonl.

Notes

  • The session directory is fully intact: state.json, wire.jsonl (~878KB), agents/main/ all present and valid.
  • This appears to be a bug in the index append/write logic where the newline separator is occasionally lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions