Skip to content

log stream error: path duplication bug in log file path construction #8252

@hemanthsingh003

Description

@hemanthsingh003

Bug Description

When running the kilo CLI (v7.1.19), the following error appears:

log stream error: ENOENT: no such file or directory, open '/Users/hemanth/.local/share/kilo/log/Users/hemanth/.local/share/kilo/log/.log-history'

Root Cause

The log file path is being constructed incorrectly — the log directory path is being prepended twice, resulting in:

/Users/hemanth/.local/share/kilo/log/Users/hemanth/.local/share/kilo/log/.log-history

Instead of the correct path:

/Users/hemanth/.local/share/kilo/log/.log-history

This suggests a string concatenation bug where the full log directory path is used as both the base directory and the filename prefix.

Environment

  • OS: macOS (darwin, arm64)
  • Kilo version: 7.1.19
  • Installation: Homebrew (Kilo-Org/homebrew-tap/kilo)
  • Log directory: ~/.local/share/kilo/log/

Workaround

Manually creating the duplicated directory structure suppresses the error:

mkdir -p ~/.local/share/kilo/log/Users/hemanth/.local/share/kilo/log
touch ~/.local/share/kilo/log/Users/hemanth/.local/share/kilo/log/.log-history

Expected Behavior

The .log-history file should be created/read at ~/.local/share/kilo/log/.log-history without path duplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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