Files
oh-my-pi/packages/coding-agent/src/tools
can1357 de7f43f3d2 refactor(coding-agent/tools): restructured file reading logic to process bytes directly and improve memory efficiency
- Refactored file reading logic to process bytes directly instead of decoding entire chunks into strings, improving memory efficiency and enabling better line boundary detection.
- Restructured line collection state management with dedicated helper functions (setupLineState, appendSegment, finalizeLine, decodeLine) for clearer control flow and byte tracking.
- Enhanced byte limit tracking to accurately count selected lines and bytes separately, fixing calculation of truncation metadata.
- Added firstLinePreview and firstLineByteLength fields to streamLinesFromFile return type to support better handling of oversized first lines.
- Improved firstLineExceedsLimit detection to use actual byte length instead of relying on empty collection state.
2026-01-29 15:37:01 +01:00
..
2026-01-25 19:53:14 +01:00