Skip to content

Conversation

@linw1995
Copy link
Owner

@linw1995 linw1995 commented Jan 4, 2026

This PR fixes a blocking issue in coco record when handling child process output containing non-UTF-8 bytes, improves exec command reliability with better logging, and simplifies commit.sh prompt instructions.

Switch to read_until() and lossy UTF-8 decoding so child output containing non-utf8 bytes does not terminate the reader and cause backpressure/hangs.

Key changes:
- Use BufReader::read_until(b'\n', &mut buf) instead of lines().next_line()
- Add take_line() to normalize \n/\r\n and decode via from_utf8_lossy
- Count raw bytes for buffer limits and keep existing flush behavior
Add warning logs when read_until() fails on stdout/stderr streams in exec command.
This improves debugging visibility for child process output reading errors.
Remove redundant formatting guidelines and consolidate prompt instructions
to focus on core requirements. The commit message generation logic remains
unchanged while reducing noise in the prompt template.
@linw1995 linw1995 added the bug Something isn't working label Jan 4, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 84.84848% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (dev@6ff03e5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/exec.rs 84.84% 5 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             dev      #68   +/-   ##
======================================
  Coverage       ?   59.89%           
======================================
  Files          ?       77           
  Lines          ?    15253           
  Branches       ?        0           
======================================
  Hits           ?     9136           
  Misses         ?     6117           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@linw1995 linw1995 merged commit 99c0d18 into dev Jan 4, 2026
3 checks passed
@linw1995 linw1995 deleted the fix/coco-record-blocking branch January 4, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants