Skip to content

Improve read and grep long-line output#278

Merged
konard merged 4 commits into
mainfrom
issue-230-fb58121277cf
Jul 4, 2026
Merged

Improve read and grep long-line output#278
konard merged 4 commits into
mainfrom
issue-230-fb58121277cf

Conversation

@konard

@konard konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #230

Summary

  • Add shared JavaScript and Rust column-window formatting for long text output, including balanced first/last windows, explicit column windows, and match-focused windows.
  • Update read to summarize long files with first/last line ranges by default and support columnOffset / columnLimit for selected lines.
  • Update grep output to keep long matching lines bounded while preserving the matching segment with omitted-column markers.
  • Add docs/case-studies/issue-230 with raw GitHub artifacts, online/library research, extracted requirements, alternatives, and verification notes.

Reproduction and Coverage

The regression tests create long files and long single-line fixtures that reproduce the issue behavior:

  • default read now returns first and last line ranges with ... [omitted lines X..Y] ...;
  • default read on one long line returns first columns, omitted-column range, and last columns;
  • explicit columnOffset / columnLimit returns the requested column window;
  • grep on a long line containing ivu-modal-header{cursor:move} returns the match-focused snippet instead of hiding or dumping the whole line.

Verification

cd js
bun test ./tests/tool_read.js ./tests/tool_grep.js
npm run check
npm test
cd rust
cargo fmt --check
cargo test --test tool_read --test tool_grep
cargo test

Observed locally: JS focused tests passed, JS check passed, full JS suite passed with 609 pass / 4 todo / 0 fail, Rust focused tests passed, and full Rust suite passed.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #230
@konard konard self-assigned this Jul 3, 2026
@konard konard changed the title [WIP] Read/search tools improvements Improve read and grep long-line output Jul 3, 2026
@konard konard marked this pull request as ready for review July 3, 2026 22:50
@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented issue #230 and updated PR #278: #278

Changes made:

  • Added column-windowed read output in JS/Rust, including columnOffset and columnLimit.
  • Updated default read output to show whole-file overviews and balanced long-line snippets.
  • Updated grep/search output to show focused match snippets instead of dumping long lines.
  • Added regression tests for read/search long-line behavior.
  • Added the requested case study under docs/case-studies/issue-230.
  • Added the required JS changeset after CI reported No changeset found.

Verification:

  • Local: cd js && bun test ./tests/tool_read.js ./tests/tool_grep.js
  • Local: cd rust && cargo test --test tool_read --test tool_grep
  • Local: cd js && npm run check
  • Local: full npm test, cargo fmt --check, and cargo test passed earlier.
  • Remote CI on head 5ad3929: JS CI/CD and Rust CI/CD both passed.
  • PR is ready for review, merge state is clean, and local git status is clean.

CI investigation logs were preserved outside the repo at ../ci-logs-issue-230.

Research sources used: ripgrep manpage, grep-printer JSON docs, ripgrep guide, and ripgrep issue #1451.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $14.694795

📊 Context and tokens usage:

  • 407.6K / 200K (204%) input tokens, 54.1K / 128K (42%) output tokens

Total: (407.6K + 8.2M cached) input tokens, 54.1K output tokens, $14.694795 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Thinking level: max (~31999 tokens)
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (6703KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 7af549d into main Jul 4, 2026
16 checks passed
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.

Read/search tools improvements

1 participant