KaiWu Cursor commited on
Commit
bb416ab
·
1 Parent(s): 3e0d585

fix(verify): use AddViewProp and save skipped runs once

Browse files

HF conda VTK 9.5+ no longer exposes Renderer.AddActor2D, which aborted
verification and caused retries to allocate duplicate runs directories.

Co-authored-by: Cursor <cursoragent@cursor.com>

agent_core/tools/registry.py CHANGED
@@ -57,7 +57,8 @@ def _execute_build123d_handler(
57
  candidate = session["verify_candidate"]
58
  elif status == "failed" and verification["round"] >= MAX_VERIFY_ROUNDS:
59
  candidate = session["verify_best"]
60
- elif status == "skipped" and verification["reason"] != "max_rounds_reached":
 
61
  candidate = {"code": code, "verification": verification, "views_path": None}
62
 
63
  if candidate:
@@ -65,6 +66,8 @@ def _execute_build123d_handler(
65
  if not saved.get("ok"):
66
  return json_response({**saved, "verification": verification})
67
  payload.update({key: saved[key] for key in SAVED_KEYS if saved.get(key)})
 
 
68
  payload["verification"] = verification
69
  return json_response(payload)
70
 
 
57
  candidate = session["verify_candidate"]
58
  elif status == "failed" and verification["round"] >= MAX_VERIFY_ROUNDS:
59
  candidate = session["verify_best"]
60
+ elif status == "skipped" and verification["reason"] != "max_rounds_reached" and not session.get("saved"):
61
+ # Infra/verify errors already saved once; do not allocate another runs/ dir on retries.
62
  candidate = {"code": code, "verification": verification, "views_path": None}
63
 
64
  if candidate:
 
66
  if not saved.get("ok"):
67
  return json_response({**saved, "verification": verification})
68
  payload.update({key: saved[key] for key in SAVED_KEYS if saved.get(key)})
69
+ elif session.get("saved") and status == "skipped":
70
+ payload.update({key: session["saved"][key] for key in SAVED_KEYS if session["saved"].get(key)})
71
  payload["verification"] = verification
72
  return json_response(payload)
73
 
agent_core/verify/render.py CHANGED
@@ -123,7 +123,11 @@ def render_views(stl_path: Path, png_path: Path) -> dict:
123
  text.GetTextProperty().SetVerticalJustificationToTop()
124
  text.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
125
  text.GetPositionCoordinate().SetValue(0.015, 0.975)
126
- renderer.AddActor2D(text)
 
 
 
 
127
 
128
  _fit_camera(renderer.GetActiveCamera(), bounds, direction, up)
129
  renderer.LightFollowCameraOn()
 
123
  text.GetTextProperty().SetVerticalJustificationToTop()
124
  text.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
125
  text.GetPositionCoordinate().SetValue(0.015, 0.975)
126
+ # VTK 9.5+ Python wheels drop AddActor2D; AddViewProp is the supported synonym.
127
+ if hasattr(renderer, "AddViewProp"):
128
+ renderer.AddViewProp(text)
129
+ else:
130
+ renderer.AddActor2D(text)
131
 
132
  _fit_camera(renderer.GetActiveCamera(), bounds, direction, up)
133
  renderer.LightFollowCameraOn()