SIGN IN SIGN UP

Skip URL detection in high-throughput terminal scenarios (#291896)

* Initial plan

* Add debouncing to urlFinder.ts for improved terminal performance

- Buffer terminal data for 500ms before processing (debounce)
- Skip URL detection when data exceeds 10KB threshold (high-throughput scenarios)
- Add unit tests for debouncing behavior

Co-authored-by: alexr00 <[email protected]>

* Address code review feedback: optimize memory usage and use test constant

- Stop buffering data once threshold is exceeded to avoid memory accumulation
- Track total buffer length to avoid recalculating on flush
- Use DEBOUNCE_WAIT_MS constant instead of magic numbers in tests

Co-authored-by: alexr00 <[email protected]>

* Fix timer behavior when threshold is exceeded and improve test comments

- Reset debounce timer even when threshold is exceeded
- Improve test comments to be more accurate about the behavior

Co-authored-by: alexr00 <[email protected]>

* Simplify with `RunOnceWorker`

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: alexr00 <[email protected]>
C
Copilot committed
5dd737d8a9b52f6555d9b5de2aaeacd4156ebc82
Parent: b22bccf
Committed by GitHub <[email protected]> on 2/4/2026, 10:43:40 AM