Skip to content

CLI: keep put with long inline text crashes on Path.is_dir() — OSError: File name too long #6

@Daniels77777

Description

@Daniels77777

Description

keep put with long inline text (as first positional argument) crashes with OSError: [Errno 63] File name too long before content detection recognizes it as inline text.

Steps to reproduce

keep put "This is a long note with many words that exceeds the filesystem path length limit and triggers the Path.is_dir check before content type detection can identify it as inline text rather than a file path" -t topic=test

Expected behavior

Long inline text should be recognized as content (not a file path) and stored normally.

Actual behavior

  File "keep/cli_app.py", line 1085, in put
    elif Path(source).is_dir():
  File "pathlib.py", line 876, in is_dir
    return S_ISDIR(self.stat().st_mode)
OSError: [Errno 63] File name too long

The code path at cli_app.py:1085 calls Path(source).is_dir() before checking whether source is inline content. When the string exceeds the OS path length limit (~255 bytes on macOS), stat() raises OSError instead of returning False.

Workaround

Use the MCP keep_flow(state="put", ...) path, which works correctly.

Version

keep-skill 0.136.8, macOS (Darwin 25.5.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions