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

Method record_fix

core/error_database.py:222–242  ·  view source on GitHub ↗

Record a fix for an error. Args: error_key: Error pattern key from record_error fix: Description of fix applied success: Whether fix resolved the issue

(self, error_key: str, fix: str, success: bool = True)

Source from the content-addressed store, hash-verified

220 return key
221
222 def record_fix(self, error_key: str, fix: str, success: bool = True):
223 """
224 Record a fix for an error.
225
226 Args:
227 error_key: Error pattern key from record_error
228 fix: Description of fix applied
229 success: Whether fix resolved the issue
230 """
231 if error_key not in self._cache:
232 warning(f"Error key {error_key} not found")
233 return
234
235 pattern = self._cache[error_key]
236 pattern.fix = fix
237 pattern.success = success
238 if success:
239 pattern.times_fixed += 1
240
241 self._save_database()
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,

Callers 2

learn_from_errorMethod · 0.95
test_record_fixMethod · 0.95

Calls 3

_save_databaseMethod · 0.95
warningFunction · 0.90
infoFunction · 0.90

Tested by 1

test_record_fixMethod · 0.76