Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Enforce
min_request_intervalbetween concurrent callers, not only sequential ones.The minimum-interval check currently runs before acquiring the request-pacing lock. With
max_concurrent > 1, several callers can read the same previous start time and sleep until the same deadline, then all enter almost simultaneously. Through the installed SDK, four requests configured for 100 ms spacing started at approximately 0 / 100 / 100 / 101 ms. The basic limiter used byFinancialDataFetcherexposes both concurrency and minimum-interval settings, so this can exceed a data provider's configured pacing.Move the interval calculation and wait under the existing async lock, alongside the requests-per-second check and timestamp update. Request bodies remain outside the lock and can still overlap. No public API or default changes.
This does not change the synchronous bookkeeping in #923, interrupted context entry in #1016, or keyword argument forwarding in #1027.
Related issue number
No matching issue or PR was found in the all-state duplicate search.
Validation
CPython 3.12.14, normal package imports from an editable source install, no external service calls or rate-limiter mocks:
python -m pytest tests/utils -q: 151 passed, 30 subtests passed, 1 unrelated baseline failure. The unchanged transcript test expectssubagents/worker-1.jsonl, while the implementation writes.ms_agent/subagents/worker-1.jsonl. The same failure was reproduced before the source edit.pre-commit installcompleted. All applicable changed-file pre-commit hooks passed, as did compilation andgit diff --check.The full repository test suite, real provider calls, other Python versions, and non-Linux platforms were not run.
Checklist
AI assistance: prepared and tested with OpenAI Codex. No human-review attestation is claimed; submitted as a draft without requesting reviewers.