Repository navigation
=fix(cli): update in-progress request count immediately when requests are dispatched (#550) - #741
Conversation
…are dispatched (bespokelabsai#550) - Call status_tracker.update_display() immediately after incrementing num_tasks_started and num_tasks_in_progress upon dispatching requests in process_requests_online - Call status_tracker.update_display() when requests fail permanently - In OnlineStatusTracker, allow state changes (in_progress, succeeded, failed) to trigger display updates immediately without waiting for _STATUS_UPDATE_INTERVAL - Add regression test test_online_status_tracker_requests_in_progress_update
EntelligenceAI PR SummaryUpdates online request processing to refresh status displays immediately when requests start or permanently fail. It also allows state-change updates to bypass the periodic refresh interval and adds coverage for in-progress transitions and display formatting. Review Scorecard
Safe to merge with a low blast radius; code quality rated Good (4/5): the 1 comment are minor or cosmetic, with no runtime, logic or security impact. Key Findings:
Need to merge before these are addressed? Anyone with write access can comment Evaluated against
|
WalkthroughThis PR synchronizes online status displays with request lifecycle changes by refreshing progress immediately when requests start or fail after retries. It also updates display-trigger logic to react to task metric changes and improves test coverage and rendering compatibility for ellipsis characters. ChangesFiles
Updated online request processing to refresh the status display when requests enter progress and when exhausted retries produce generic responses and failure counter updates. Modified Files
Updated display assertions to accept either the three-dot leader ( |
| tracker = OnlineStatusTracker() | ||
| tracker.model = "test-model" | ||
| tracker.total_requests = 10 | ||
| tracker.start_tracker(console) |
There was a problem hiding this comment.
Exercise the TQDM path in this regression test
With the default USE_RICH_DISPLAY, start_tracker(console) selects the Rich branch, so this test never exercises the changed TQDM condition. It only checks counters and max concurrency, so it passes if the five-second TQDM gating remains broken.
Prompt to fix with AI
Copy this prompt into your AI coding assistant to fix this issue.
In tests/unittests/test_online_status_tracker.py at lines 127-148, make the regression test explicitly exercise the non-Rich/TQDM mode or otherwise isolate the TQDM update logic, and assert that the rendered/logged status changes immediately after incrementing and decrementing in-progress requests. Preserve the existing Rich-mode coverage separately if needed.
Summary
Fixes #550.
Previously, when requests were dispatched in
process_requests_online,status_tracker.num_tasks_startedandstatus_tracker.num_tasks_in_progresswere incremented, butstatus_tracker.update_display()was never called. Furthermore:in_progressand incrementedfailedwithout triggering anupdate_display().OnlineStatusTracker, state-change updates in TQDM/CLI mode were gated behindcurrent_time - self._last_stats_update >= _STATUS_UPDATE_INTERVAL and (...), preventing state changes from reflecting until 5 seconds elapsed.This caused the CLI to display
In Progress: 0while requests were in-flight to LLM providers.Changes
status_tracker.update_display()immediately after incrementingnum_tasks_startedandnum_tasks_in_progressinprocess_requests_online.status_tracker.update_display()when requests fail permanently inhandle_single_request_with_retries.OnlineStatusTracker.update_display()so task state transitions trigger console updates without delay.test_online_status_tracker_requests_in_progress_updateintests/unittests/test_online_status_tracker.py.Verification
tests/unittests/test_online_status_tracker.pyandtests/unittests/test_status_tracker.py.