fix(agent): P0.6 guard human corrections

This commit is contained in:
Dom
2026-05-24 21:07:12 +02:00
parent ad24d16d83
commit b1b32187ba
4 changed files with 150 additions and 8 deletions

View File

@@ -3785,9 +3785,15 @@ async def report_action_result(report: ReplayResultReport):
try:
corr = report.correction
target_spec = original_action.get("target_spec", {})
log_x = corr.get("x_pct")
log_y = corr.get("y_pct")
last_click = corr.get("last_click")
if (log_x is None or log_y is None) and isinstance(last_click, dict):
log_x = last_click.get("x_pct")
log_y = last_click.get("y_pct")
logger.info(
f"[APPRENTISSAGE] Correction humaine reçue : "
f"({corr.get('x_pct', 0):.4f}, {corr.get('y_pct', 0):.4f}) "
f"({float(log_x or 0):.4f}, {float(log_y or 0):.4f}) "
f"pour '{target_spec.get('by_text', '?')}'"
)
_replay_learner.record_human_correction(