Repository navigation
fix(serial): native fbuild adapter reads until the caller's timeout - #4661
Conversation
fbuild's AsyncSerialMonitor.read_lines() returns only the first available batch. NativeFbuildSerialAdapter (#4657) yielded that one batch and ended, so an RPC reply arriving after a device log line was never read. On an ESP32-C6 the task-watchdog boot message lands first, and every AutoResearch session timed out on setPins. Loop native reads until the deadline, as FbuildSerialAdapter already does. Co-Authored-By: Claude <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: FastLED/FastLED/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesSerial adapter batch reading
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The adapter can deliver a later reply within the read timeout, and no actionable merge-blocking risk remains after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to This is a narrow change to serial response delivery. Buffered lines remain available after early termination, and response matching remains in place. The external monitor’s cancellation and overlapping-read guarantees remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…stic serial fake (#4665) Review follow-ups from #4661 and #4662: the deferred synthesis path now has a WS2812 case (only WS2814 was tested), the native serial test fake waits out its timeout like fbuild's AsyncSerialMonitor, and the AutoResearch doc says the RMT binding applies to any --legacy --rmt run. Co-authored-by: Claude <[email protected]>
Problem
Since #4657, every
bash autoresearch esp32c6 ...session fails before any driver test runs:Root cause
fbuild's
AsyncSerialMonitor.read_lines()returns only the first available batch.NativeFbuildSerialAdapter.read_lines()yielded that one batch and ended the generator, so when the batch was a device log line, the RPC reply in a later batch was never read.FbuildSerialAdapteralready loops native reads until the deadline; its comment documents this exact contract. The Pico 2 smoke in #4657 passed because its replies happened to arrive in the first batch.Fix
Loop native reads until the caller's timeout. The handling of preserved pending lines and early generator close is unchanged.
Evidence
bash autoresearch esp32c6 --parlio --legacy --strip-sizes 1,2,3):setPinswith a timeout.FbuildSerialAdapterreaches the driver tests.leds=2 PASS,leds=3 PASS.leds=1 FAIL class=zero_captureis the pre-existing PARLIO: a 1-LED strip produces no output (AutoResearch zero_capture) on ESP32-C6 #4609.test_native_adapter_reads_past_first_batch_until_timeoutdelivers a reply from the second batch. The factory test's fake monitor now behaves like the real one (one batch, then it waits out the timeout); previously it asserted the single-batch behaviour.uv run pytest ci/tests/test_serial_interface_reset.py: 11 passed.bash linton both files passed.Summary by CodeRabbit