Summary
_process_result in GetCodeFromNodeIdTool has a missing return statement, causing it to return None for virtually all results. AI agents silently receive None instead of actual code.
File
app/modules/intelligence/tools/kg_based_tools/get_code_from_node_id_tool.py
Description
The method _process_result only has a return statement inside an if len(str(result)) > 80000: block. For any result under 80,000 characters (the overwhelming majority), the method falls off the end and implicitly returns None.
def _process_result(self, result):
truncated_result = truncate_dict_response(result)
if len(str(result)) > 80000:
logger.warning(...)
return truncated_result
# ← Missing: return result
# Method implicitly returns None here!
Impact
- Any AI agent using
get_code_from_node_id receives None instead of the actual code
- Silently breaks code retrieval for the entire codebase — QnA, debugging, and test generation pipelines all affected
- No error is raised, making this very hard to debug
Expected Behavior
The method should return the actual result when it's under the size limit.
Suggested Fix
Add return result as the final line of _process_result:
def _process_result(self, result):
truncated_result = truncate_dict_response(result)
if len(str(result)) > 80000:
logger.warning(...)
return truncated_result
return result # ← Add this line
Summary
_process_resultinGetCodeFromNodeIdToolhas a missingreturnstatement, causing it to returnNonefor virtually all results. AI agents silently receiveNoneinstead of actual code.File
app/modules/intelligence/tools/kg_based_tools/get_code_from_node_id_tool.pyDescription
The method
_process_resultonly has areturnstatement inside anif len(str(result)) > 80000:block. For any result under 80,000 characters (the overwhelming majority), the method falls off the end and implicitly returnsNone.Impact
get_code_from_node_idreceivesNoneinstead of the actual codeExpected Behavior
The method should return the actual result when it's under the size limit.
Suggested Fix
Add
return resultas the final line of_process_result: