Skip to content

fix(mcp): drop "including frontmatter" from text file line headers - #2039

Merged
phernandez merged 1 commit into
mainfrom
fix/1976-line-range-header-text-files
Nov 4, 2026
Merged

phernandez merged 1 commit into
mainfrom
fix/1976-line-range-header-text-files

Conversation

@phernandez

Copy link
Copy Markdown
Member

Fixes #1976.

Summary

  • A bm_read line range on a plain text file said Lines 10-12 of 30 (document, including frontmatter). A .txt file has no frontmatter.
  • format_line_read takes a required includes_frontmatter flag:
    • Markdown notes pass True and keep the wording.
    • Text files pass False and get Lines 10-12 of 30.
  • The token-budget header at read.py:212 only applies to notes (text files refuse max_tokens), so it is unchanged.
  • bm-read(3) now says what a text file's header shows.

Test plan

  • tests/markdown/test_line_scanning.py: the text-file header names only the range.
  • tests/mcp/test_tool_bm_read.py: .txt range and empty .txt headers have no frontmatter wording.
  • Related suites: 392 passed. Man page tests: 85 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL4TcbWdXhdvAzxfqjo

bm_read on a plain text file range said "Lines 10-12 of 30 (document,
including frontmatter)". A .txt file has no frontmatter; the wording
predates #1960 letting bm_read slice text files.

format_line_read takes a required includes_frontmatter flag. Markdown
notes pass True and keep the wording; text files pass False and get
"Lines 10-12 of 30". The token-budget header in read.py only applies to
notes, so it is unchanged. bm-read(3) says what a text file header shows.

Fixes #1976.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMYVL4TcbWdXhdvAzxfqjo
Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T00:37:05.979281Z 0300679 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@phernandez
phernandez merged commit 1e8ba03 into main Nov 4, 2026
52 checks passed
@phernandez
phernandez deleted the fix/1976-line-range-header-text-files branch November 4, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant