{{ message }}
Repository navigation
fix(security-discovery): fan batches out through the shared LLM limiter - #856
Open
elliottwaves-20 wants to merge 2 commits into
Open
elliottwaves-20 wants to merge 2 commits into
elliottwaves-20 wants to merge 2 commits into
Conversation
semantic_security_discovery called the synchronous run_batches, which walks the batches one by one, while the sibling semantic analyzers use run_async(arun_batches) behind the shared limiter. On a large package this analyzer alone kept one request in flight for hours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliottwaves-20 <pail1217@web.de>
…ial-failure tests The refusal tests still mocked the synchronous invoke, so after the switch to arun_batches they failed on a mock mismatch instead of the refusal. Mock ainvoke, assert it was awaited, pin the shared limit in the concurrency test, and cover a partial failure in the fan-out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliottwaves-20 <pail1217@web.de>
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.

Summary
Fixes #854.
semantic_security_discoverynow callsrun_async(analyzer.arun_batches(batches)), likesemantic_quality_policy,semantic_developer_intentand the meta analyzer. Its batches go through the shared limiter and respectSKILLSPECTOR_MAX_LLM_CONCURRENCY.Behaviour
arun_batches_detailedmaps errors the same way asrun_batches_detailed(structured-response validation, runtime limit, provider failures;ValueError/NotImplementedErrorre-raised), sets_last_batch_outcome, and keeps the batch order. One difference, shared with the sibling analyzers: all batches run before aValueErroris raised, so a configuration error can surface after more calls, and if another batch already got a response the node reportsfailedinstead of raising. Both still fail closed.Testing
tests/nodes/analyzers/test_semantic_security_discovery.py: tests moved from patchingrun_batchestoarun_batches. The two refusal tests now mockainvokeand assert it was awaited (otherwise they would pass on a mock mismatch). New: four batches with a shared limit of 2 reach exactly 2 in flight (0 before the fix), a partial failure keeps the successful findings and marks the gap, and a runtime limit from the async fan-out is still recorded.mainstay the same).ruff: clean.🤖 Generated with Claude Code