Skip to content

Line-range header says "including frontmatter" for plain text files #1976

Open

Description

@phernandez

Found in the 1.0 live MCP test.

What happens

bm_read(identifier="files/app.log.txt", start_line=10, end_line=12) returns:

Lines 10-12 of 30 (document, including frontmatter); next: start_line=13, end_line=15

A .txt file has no frontmatter, so the parenthetical is wrong for it. The text comes from src/basic_memory/markdown/line_scanning.py:79 and the token-budget variant at src/basic_memory/mcp/tools/read.py:212, both written for Markdown notes before #1960 let bm_read slice text files.

Fix

Say "(including frontmatter)" only for Markdown notes; plain text files get Lines 10-12 of 30.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

Activity

  1. claude commented on Oct 29, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 13s —— View job


    Triage

    • Type: Bug (misleading output text)
    • Component: MCP tools (bm_read line-range slicing, plus the shared helper in markdown/line_scanning.py). No Cloud involvement.
    • Priority: Low. The output is cosmetic and nothing is lost or corrupted, but it misleads on plain text files.
    • Complexity: Simple. Make the "(document, including frontmatter)" wording conditional on the target being a Markdown note, in both places the issue cites. Add regression tests for .txt and Markdown.
    • Duplicates: None found.

    The issue already has clear repro steps and a proposed fix, so I have no questions. Per triage scope, I haven't made any code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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