MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / find_similar_errors

Method find_similar_errors

core/error_database.py:260–283  ·  view source on GitHub ↗

Find similar error patterns. Args: error_type: Type of error to match error_message: Error message to match limit: Maximum results to return Returns: List of (pattern, similarity_score) tuples

(self, error_type: str, error_message: str,
                            limit: int = 5)

Source from the content-addressed store, hash-verified

258 self.record_fix(key, fix, success)
259
260 def find_similar_errors(self, error_type: str, error_message: str,
261 limit: int = 5) -> List[Tuple[ErrorPattern, float]]:
262 """
263 Find similar error patterns.
264
265 Args:
266 error_type: Type of error to match
267 error_message: Error message to match
268 limit: Maximum results to return
269
270 Returns:
271 List of (pattern, similarity_score) tuples
272 """
273 query = ErrorPattern(error_type, error_message, "", False)
274 results = []
275
276 for pattern in self._cache.values():
277 score = query.similarity_score(pattern)
278 if score > 0.3: # Minimum similarity threshold
279 results.append((pattern, score))
280
281 # Sort by similarity
282 results.sort(key=lambda x: x[1], reverse=True)
283 return results[:limit]
284
285 def suggest_fix(self, error_type: str, error_message: str) -> Optional[str]:
286 """

Callers 4

suggest_fixMethod · 0.95
test_record_fixMethod · 0.95
get_similar_errorsMethod · 0.80

Calls 3

similarity_scoreMethod · 0.95
ErrorPatternClass · 0.85
appendMethod · 0.80

Tested by 2

test_record_fixMethod · 0.76