zot/internal/tui
patriceckhart f5719c6be1 perf(read): drop line numbers from model-facing output
The read tool used to prefix every line with '%6d\t' (6-digit
line number + tab), which added ~7 bytes / ~2 tokens per line to
every read. On typical source files that's 15-20% of the read's
token budget, repeated on every subsequent turn as the tool
result stays in context.

The line numbers weren't earning their keep: the model edits via
exact-match text replacement, never line ranges, and the tui has
always been capable of drawing its own gutter. Now it does:

- Tool output is raw file bytes, no prefix.
- A 'start_line' detail is attached to the ToolResult so the tui
  knows where to start counting.
- The tui renders a synthetic gutter over the raw content using
  the existing renderNumberedFile path (new: renderRawFile), so
  on-screen it still looks exactly like cat -n.

The old numbered format is still recognised for legacy transcripts
saved before this commit (looksLikeNumberedFile guard stays).

Measured: sample.ts (388 lines) used to cost 14957 bytes to send,
now costs 12291 bytes (raw file). Saves ~670 tokens per read of a
medium file; the same fraction applies to larger files too.

Tests: TestReadOffsetLimit rewritten to assert raw output +
start_line detail. TUI renderToolText signature grew one int
(startLine) plumbed through renderToolResultContent.
2026-04-19 17:33:05 +02:00
..
editor.go feat: extension system (subprocess + json-rpc, any language) 2026-04-19 14:09:43 +02:00
highlight.go chore: scrub stray "pi" references from source comments 2026-04-19 17:06:45 +02:00
image.go fix ci: portable syscall.Select via x/sys/unix; gofmt pass 2026-04-18 10:55:42 +02:00
input.go add collapsible code blocks 2026-04-18 10:30:29 +02:00
markdown.go fix code highlighting 2026-04-18 10:16:06 +02:00
quote_paste_test.go tui: quote drag-dropped file paths in the input editor 2026-04-19 13:01:37 +02:00
render.go tui: quote drag-dropped file paths in the input editor 2026-04-19 13:01:37 +02:00
resize_unix.go fix ci: portable syscall.Select via x/sys/unix; gofmt pass 2026-04-18 10:55:42 +02:00
resize_windows.go initial commit 2026-04-17 20:36:38 +02:00
statusbar_test.go feat(ext): phase 4 - full-event interception, arg rewrites, /reload-ext 2026-04-19 17:02:04 +02:00
terminal.go initial commit 2026-04-17 20:36:38 +02:00
theme.go fix ci: portable syscall.Select via x/sys/unix; gofmt pass 2026-04-18 10:55:42 +02:00
view.go perf(read): drop line numbers from model-facing output 2026-04-19 17:33:05 +02:00