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

Method learn_from_error

core/error_database.py:244–258  ·  view source on GitHub ↗

Learn from an error and its fix in one call. Args: error_type: Type of error error_message: Full error message fix: Fix that was applied success: Whether fix worked context: Additional context

(self, error_type: str, error_message: str,
                         fix: str, success: bool = True,
                         context: Dict = None)

Source from the content-addressed store, hash-verified

242 info(f"Recorded fix for {pattern.error_type}: {fix[:50]}...")
243
244 def learn_from_error(self, error_type: str, error_message: str,
245 fix: str, success: bool = True,
246 context: Dict = None):
247 """
248 Learn from an error and its fix in one call.
249
250 Args:
251 error_type: Type of error
252 error_message: Full error message
253 fix: Fix that was applied
254 success: Whether fix worked
255 context: Additional context
256 """
257 key = self.record_error(error_type, error_message, context)
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]]:

Callers 4

test_suggest_fixMethod · 0.95
test_statisticsMethod · 0.95

Calls 2

record_errorMethod · 0.95
record_fixMethod · 0.95

Tested by 4

test_suggest_fixMethod · 0.76
test_statisticsMethod · 0.76