Conversation
…eAgent Adds constructor options (maxConcurrent, maxPerSession, queueTimeout) to DelegationManager, a concurrencyLimiter param to delegate(), and acquire/release gating in streamTextWithRetryAndFallback so a shared limiter can cap concurrent AI API calls across all ProbeAgent instances. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Overview: Global AI Concurrency LimiterSummaryThis PR introduces a global AI concurrency limiter to control and throttle concurrent AI API calls across all ProbeAgent instances in a run. The implementation adds constructor options to DelegationManager, passes a concurrencyLimiter parameter through delegate() to ProbeAgent, and implements acquire/release gating in streamTextWithRetryAndFallback. Files ChangedModified Files
Added Files
Architecture & Impact AssessmentWhat This PR Accomplishes
Key Technical Changes
Affected System Components
Component Flow Diagramgraph TD
A[delegate call] --> B[Create ProbeAgent]
B --> C[Pass concurrencyLimiter]
C --> D[streamTextWithRetryAndFallback]
D --> E{Limiter configured?}
E -->|Yes| F[Acquire slot]
E -->|No| G[Execute AI call]
F --> H[Execute AI call]
H --> I{textStream exists?}
I -->|Yes| J[Wrap stream]
I -->|No| K[Release slot]
J --> L[Consume stream]
L --> M[Release slot in finally]
K --> N[Return result]
M --> N
G --> N
Scope Discovery & Context ExpansionDirect Impact
Related Files to Review
Potential Edge Cases
Testing Coverage
Labels
Review Focus Areas
Metadata
Powered by Visor from Probelabs Last updated: 2026-02-15T18:35:00.761Z | Triggered by: pr_opened | Commit: f8aff91 💡 TIP: You can chat with Visor using |
Security Issues (1)
Architecture Issues (7)
Performance Issues (1)
Quality Issues (1)
Powered by Visor from Probelabs Last updated: 2026-02-15T18:35:03.473Z | Triggered by: pr_opened | Commit: f8aff91 💡 TIP: You can chat with Visor using |
Summary
maxConcurrent,maxPerSession,queueTimeout) toDelegationManager, allowing callers to override env-var/hardcoded defaultsconcurrencyLimiterparameter todelegate()and passes it through toProbeAgentstreamTextWithRetryAndFallbackso a sharedDelegationManagerinstance can cap concurrent AI API calls across allProbeAgentinstances in a runTest plan
npm test -- --testPathPattern="concurrency-limiter"— 10/10 passnpm test -- --testPathPattern="delegate"— all 117 existing delegate tests still pass🤖 Generated with Claude Code