Skip to content

=fix(cli): update in-progress request count immediately when requests are dispatched (#550) - #741

Open
shobhitagnihotri69 wants to merge 1 commit into
bespokelabsai:mainfrom
shobhitagnihotri69:fix/550-requests-in-progress-display-update
Open

shobhitagnihotri69 wants to merge 1 commit into
bespokelabsai:mainfrom
shobhitagnihotri69:fix/550-requests-in-progress-display-update

Conversation

@shobhitagnihotri69

Copy link
Copy Markdown

Summary

Fixes #550.

Previously, when requests were dispatched in process_requests_online, status_tracker.num_tasks_started and status_tracker.num_tasks_in_progress were incremented, but status_tracker.update_display() was never called. Furthermore:

  1. Permanent failure blocks decremented in_progress and incremented failed without triggering an update_display().
  2. In OnlineStatusTracker, state-change updates in TQDM/CLI mode were gated behind current_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: 0 while requests were in-flight to LLM providers.

Changes

  • Call status_tracker.update_display() immediately after incrementing num_tasks_started and num_tasks_in_progress in process_requests_online.
  • Call status_tracker.update_display() when requests fail permanently in handle_single_request_with_retries.
  • Update OnlineStatusTracker.update_display() so task state transitions trigger console updates without delay.
  • Add regression test test_online_status_tracker_requests_in_progress_update in tests/unittests/test_online_status_tracker.py.

Verification

  • Ran pytest suite: 10/10 passed in tests/unittests/test_online_status_tracker.py and tests/unittests/test_status_tracker.py.
  • Ruff check: clean (0 errors).

…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
@entelligence-ai-pr-reviews

Copy link
Copy Markdown

EntelligenceAI PR Summary

Updates 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

Dimension Rating Basis
Code Quality ●●●●○ 4/5 — Good no critical/significant findings — rated Good
Blast Radius Low changed symbols are referenced only within their own file(s); no high-impact surface touched, 2 file(s) / ~4 line(s) changed (size only — not a blast signal)
Merge Confidence ●●●●○ 4/5 — Mostly Safe code quality 4/5 × Low blast radius

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:

  • No critical or significant issues found

Need to merge before these are addressed? Anyone with write access can comment @entelligence /approve to approve it now. @entelligence help lists every command.

Evaluated against
  • 4/4 changed files reviewed
  • criteria: correctness, security & access control, robustness & error handling, concurrency & data integrity, repo conventions / steering docs
  • steering docs: none found in repo

@entelligence-ai-pr-reviews

Copy link
Copy Markdown

Walkthrough

This 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.

Changes

Files

  • src/bespokelabs/curator/request_processor/online/base_online_request_processor.py
  • src/bespokelabs/curator/status_tracker/online_status_tracker.py

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 update_display() to refresh on task metric changes in addition to the time interval, including changes to in-progress, succeeded, and failed counts.

Files

  • tests/unittests/test_online_status_tracker.py
  • tests/unittests/test_status_tracker.py

Updated display assertions to accept either the three-dot leader (⋯) or Unicode ellipsis (…). Added lifecycle coverage confirming that dispatching and completing requests updates in-progress, started, succeeded, and maximum-concurrency counters.

tracker = OnlineStatusTracker()
tracker.model = "test-model"
tracker.total_requests = 10
tracker.start_tracker(console)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT TEST_REGRESSION 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Requests in Progress in CLI doesn't update whenever a request is sent

1 participant