Skip to content

AutoResearch: HumanReviewScorer busy-polling should use Redis pub/sub #3209

@mrveiss

Description

@mrveiss

Summary

`HumanReviewScorer.score()` holds an async coroutine slot for up to 300s (default timeout) doing nothing but `asyncio.sleep` polling in a loop. With multiple concurrent prompt variants awaiting human review, this wastes coroutine slots.

Current Behavior

```python
while time.monotonic() < deadline:
raw = await redis.get(review_key)
if raw is not None: ...
await asyncio.sleep(self._poll_interval) # 5s default
```

Expected Behavior

Use Redis `BLPOP` with timeout or Redis pub/sub to block efficiently without wasting async slots.

Files

  • `autobot-backend/services/autoresearch/scorers.py` (line ~307)

Origin

Discovered during code review of PR #3202 (Issue #3198)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions