Skip to content

fix(coding-agent): do not highlight read errors - #6731

Merged
badlogic merged 1 commit into
earendil-works:mainfrom
dannote:fix-read-error-highlighting
Jul 17, 2026
Merged

badlogic merged 1 commit into
earendil-works:mainfrom
dannote:fix-read-error-highlighting

Conversation

@dannote

@dannote dannote commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • skip file-language syntax highlighting for failed read results
  • keep successful file contents syntax-highlighted as before
  • add regression coverage using an Elixir path and the out-of-range offset error

Root cause

The read renderer derived a language solely from the requested file path. Error text therefore passed through that file's syntax highlighter; for example, an error reading config.exs was highlighted as Elixir.

Tests

  • npm run check
  • ./test.sh

@badlogic
badlogic merged commit a2c5ee3 into earendil-works:main Jul 17, 2026
2 checks passed
@badlogic

Copy link
Copy Markdown
Collaborator

cheers

@dannote
dannote deleted the fix-read-error-highlighting branch July 17, 2026 08:41
gojack10 pushed a commit to gojack10/pi-mono that referenced this pull request Aug 25, 2026
jinhuang712 pushed a commit to jinhuang712/pi that referenced this pull request Sep 11, 2026
Osso pushed a commit to Osso/pi that referenced this pull request Nov 15, 2026
The read renderer picked a highlight language from the requested path
even for error results, so messages like "Offset 120 is beyond end of
file" were colored as source code. Skip highlighting for errors.

(cherry picked from commit a2c5ee3)
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.

2 participants