|
143 | 143 | ENV_WORKER_ID = "HINDSIGHT_API_WORKER_ID" |
144 | 144 | ENV_WORKER_POLL_INTERVAL_MS = "HINDSIGHT_API_WORKER_POLL_INTERVAL_MS" |
145 | 145 | ENV_WORKER_MAX_RETRIES = "HINDSIGHT_API_WORKER_MAX_RETRIES" |
146 | | -ENV_WORKER_BATCH_SIZE = "HINDSIGHT_API_WORKER_BATCH_SIZE" |
147 | 146 | ENV_WORKER_HTTP_PORT = "HINDSIGHT_API_WORKER_HTTP_PORT" |
| 147 | +ENV_WORKER_MAX_SLOTS = "HINDSIGHT_API_WORKER_MAX_SLOTS" |
| 148 | +ENV_WORKER_CONSOLIDATION_MAX_SLOTS = "HINDSIGHT_API_WORKER_CONSOLIDATION_MAX_SLOTS" |
148 | 149 |
|
149 | 150 | # Reflect agent settings |
150 | 151 | ENV_REFLECT_MAX_ITERATIONS = "HINDSIGHT_API_REFLECT_MAX_ITERATIONS" |
|
229 | 230 | DEFAULT_WORKER_ID = None # Will use hostname if not specified |
230 | 231 | DEFAULT_WORKER_POLL_INTERVAL_MS = 500 # Poll database every 500ms |
231 | 232 | DEFAULT_WORKER_MAX_RETRIES = 3 # Max retries before marking task failed |
232 | | -DEFAULT_WORKER_BATCH_SIZE = 10 # Tasks to claim per poll cycle |
233 | 233 | DEFAULT_WORKER_HTTP_PORT = 8889 # HTTP port for worker metrics/health |
| 234 | +DEFAULT_WORKER_MAX_SLOTS = 10 # Total concurrent tasks per worker |
| 235 | +DEFAULT_WORKER_CONSOLIDATION_MAX_SLOTS = 2 # Max concurrent consolidation tasks per worker |
234 | 236 |
|
235 | 237 | # Reflect agent settings |
236 | 238 | DEFAULT_REFLECT_MAX_ITERATIONS = 10 # Max tool call iterations before forcing response |
@@ -419,8 +421,9 @@ class HindsightConfig: |
419 | 421 | worker_id: str | None |
420 | 422 | worker_poll_interval_ms: int |
421 | 423 | worker_max_retries: int |
422 | | - worker_batch_size: int |
423 | 424 | worker_http_port: int |
| 425 | + worker_max_slots: int |
| 426 | + worker_consolidation_max_slots: int |
424 | 427 |
|
425 | 428 | # Reflect agent settings |
426 | 429 | reflect_max_iterations: int |
@@ -582,8 +585,11 @@ def from_env(cls) -> "HindsightConfig": |
582 | 585 | worker_id=os.getenv(ENV_WORKER_ID) or DEFAULT_WORKER_ID, |
583 | 586 | worker_poll_interval_ms=int(os.getenv(ENV_WORKER_POLL_INTERVAL_MS, str(DEFAULT_WORKER_POLL_INTERVAL_MS))), |
584 | 587 | worker_max_retries=int(os.getenv(ENV_WORKER_MAX_RETRIES, str(DEFAULT_WORKER_MAX_RETRIES))), |
585 | | - worker_batch_size=int(os.getenv(ENV_WORKER_BATCH_SIZE, str(DEFAULT_WORKER_BATCH_SIZE))), |
586 | 588 | worker_http_port=int(os.getenv(ENV_WORKER_HTTP_PORT, str(DEFAULT_WORKER_HTTP_PORT))), |
| 589 | + worker_max_slots=int(os.getenv(ENV_WORKER_MAX_SLOTS, str(DEFAULT_WORKER_MAX_SLOTS))), |
| 590 | + worker_consolidation_max_slots=int( |
| 591 | + os.getenv(ENV_WORKER_CONSOLIDATION_MAX_SLOTS, str(DEFAULT_WORKER_CONSOLIDATION_MAX_SLOTS)) |
| 592 | + ), |
587 | 593 | # Reflect agent settings |
588 | 594 | reflect_max_iterations=int(os.getenv(ENV_REFLECT_MAX_ITERATIONS, str(DEFAULT_REFLECT_MAX_ITERATIONS))), |
589 | 595 | ) |
|
0 commit comments