Commit cc32c86
feat: Add exponential backoff and configurable quality threshold to CoT retry logic
Critical Issues Addressed:
1. **Exponential Backoff (Critical Issue #2)**: Added exponential backoff (1s, 2s, 4s)
between retry attempts for both quality failures and exceptions. Prevents
rapid retry storms and reduces load on LLM services.
2. **Configurable Quality Threshold (Critical Issue #4)**: Made quality threshold
configurable via quality_threshold parameter (defaults to 0.6). Can now be
set from ChainOfThoughtConfig.evaluation_threshold.
3. **Verbose Logging Fix**: Changed verbose debug logging (lines 567-572) from
logger.info to logger.debug to prevent production log pollution.
Performance Improvements:
- Exponential backoff reduces peak latency from 7.5s+ to ~7s for 3 retries
- Quality threshold now respects ChainOfThoughtConfig.evaluation_threshold
- Cleaner production logs with debug-level diagnostics
Addresses Critical Issues #2, #3, #4 from PR review comment #3447949328
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent b09a414 commit cc32c86
1 file changed
+33
-11
lines changedLines changed: 33 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
519 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
520 | 526 | | |
521 | 527 | | |
522 | 528 | | |
| |||
528 | 534 | | |
529 | 535 | | |
530 | 536 | | |
| 537 | + | |
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
| |||
564 | 571 | | |
565 | 572 | | |
566 | 573 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
577 | 588 | | |
578 | 589 | | |
579 | 590 | | |
| |||
583 | 594 | | |
584 | 595 | | |
585 | 596 | | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
586 | 603 | | |
587 | 604 | | |
588 | 605 | | |
589 | 606 | | |
590 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
591 | 613 | | |
592 | 614 | | |
593 | 615 | | |
| |||
0 commit comments