fix: don't block StatusMessageWatcher exit with 6s sleep on exception (#753)
## Summary `StatusMessageWatcher` sleeps 6 seconds on exit to let the final status/status-message propagate. Two issues with the current placement: - **API asymmetry**: the sync `stop()` does the sleep itself, while the async twin does it in `__aexit__`. So manual sync `stop()` paid the 6s even though manual `await stop()` did not. - **Exceptional exits were delayed**: both `__exit__` and `__aexit__` ignored the `exc_type` they receive, so a `Ctrl+C` or any exception bubbling out of `with`/`async with` was held up 6 seconds. This change: - Moves `time.sleep(self._final_sleep_time_s)` out of sync `stop()` into `__exit__` (matches async shape). - Gates the sleep in both `__exit__` and `__aexit__` on `exc_type is None` so exceptional exits propagate immediately. Normal-exit behavior (the final-message capture window) is preserved. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
V
Vlada Dusek committed
48f50378e92e2058ff8e5aaba45ef9e3a6e5f081
Parent: 69dde64
Committed by GitHub <noreply@github.com>
on 4/22/2026, 8:37:46 AM