Skip to content

read: out-of-range / inverted line ranges return success with empty body #373

@justrach

Description

@justrach

Symptom

`codedb_read path=foo line_start=99999 line_end=100000` returns success with body `hash:\n` (empty content). Same for `line_start=100 line_end=10` and negative `line_start`. Agents read empty content as "file is empty in that range" instead of "the range is malformed".

Failing test

`tests.test.issue-bug6: codedb_read errors when line_start > line_end`

Fix

Validate `line_start >= 1`, `line_end >= 1`, `line_start <= line_end` before extraction. Each invalid case → `error: ...`.

Labels

bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions