fix: optimize transitive code search tool #184
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.
Context:
Transitive code search tool returns tuple of 2, the first returned value in the tuple is a boolean indicates whether the vulnerable function is called/reachable from the inspected app, and the 2nd returned value is a path of that call, if the former it True. the path comes in the form of a list of documents.(each document object represent a function/method in the programming language).
Currently, the LLM doesn't use the content of the returned functions documents in the path for subsequent llm calls or reasoning, and it doesn't bring any added value, on the contrary, it's just loading and bombing the context window size, in vain ( and it causes from time to time the LLM Request to crash on Bad request 400, because of context window Exceeding).
Solution :
instead of full function definition per each function in the path, just put the function name alone to make the output of the tool effective in the same way, but much more compact to save and reduce a lot the LLM requests' context size and minimize as possible the total Token count for the heavy agent loop LLM Node.